Vulkan Video Decoding: Usage Guide and FAQ #13909
Replies: 250 comments 74 replies
-
| 
         AMD on Windows appears to be 5000/6000 series according to https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-11-2-vlk-video-code-decode  (possibly 7000 works?). It doesn't work on Polaris:   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         After bc28dce, you need to patch your Mesa with this PR to get AV1 decoding on radv.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Reliably crashes driver for me with this sample: https://0x0.st/HbHJ.mkv  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Sounds like you probably need to file a mesa issue for that - and even if it was an mpv issue, please open a separate one. This FAQ isn't the place to report it.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         @aufkrawall AMD currently needs https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23227 to avoid crashes, which also fixes quite a lot of bugs  | 
  
Beta Was this translation helpful? Give feedback.
-
        what does this error mean, my device has amd and i used the following config  | 
  
Beta Was this translation helpful? Give feedback.
-
        
 I don't know if that specific driver is required, they may have been included in 23.2.1 where they added other extensions, the driver notes aren't clear. 7000 series wasn't launched when the 22-11-2 Vulkan video drivers were released so that driver doesn't officially support them. If they did include the video extensions in newer drivers then they may support 7000 series but someone with those GPUs will need to test.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Yeah, I've reported to nvidia months ago that their descriptor buffer implementation is broken, but they haven't fixed it yet.  | 
  
Beta Was this translation helpful? Give feedback.
-
        
 Github claims you attached an audio-only file...  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         That file is also broken on anv, it's glitchy and the decode is very slow while utilizing 100% of Render/3D engine.  | 
  
Beta Was this translation helpful? Give feedback.
-
        
 It's an HEVC file. My experience on ANV is that any HEVC playback pegs the GPU at 100%  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Also: This is a highly questionable sample.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Will this work with hasvk in the future? I tried using it through wine (I dont want to have to compile everything) and got this error   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         NVIDIA 1650 Super, Tested on windows with: mpv --vo=gpu-next --gpu-api=vulkan --hwdec=vulkan --gpu-context=winvk This video has problem: https://4kmedia.org/sony-whale-in-tonga-hdr-uhd-4k-demo/  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         for fedora, you need to edit mesa.spec and rebuild with codecs enabled  https://themaister.net/blog/2023/01/05/vulkan-video-shenanigans-ffmpeg-radv-integration-experiments/ https://forum.endeavouros.com/t/compiling-mesa-22-2-with-codec-support-the-easy-way/30390  | 
  
Beta Was this translation helpful? Give feedback.
        
          
            
              This comment was marked as off-topic.
            
          
            
        
      
    
            
              This comment was marked as off-topic.
            
          
            
        
        
          
            
              This comment was marked as spam.
            
          
            
        
      
    
            
              This comment was marked as spam.
            
          
            
        -
| 
         Working fine on nvidia r570 drivers and ffmpeg 7.1, decoding H265 8/10-bit, H264 and AV1 without issue, but the frame timings are significantly worse when compared to nvdec, 2ms vs 7ms when decoding a 4K AV1 video.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         The 570.124.04 driver has fixed the frame timing difference between vulkan and nvdec, now they are pretty much the same.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Even though the AMD RADV iGPU is enumerated first, mpv will default to using the discrete NVIDIA gpu with  I can manually set the vulkan device to the AMD RADV, and it will use vaapi instead of nvdec, but isn't mpv supposed to use the first device enumerated?  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         There’s a known problem that NVIDIA’s Vulkan layer selects the discrete GPU by default 
     | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Hi there, i have an AMD GPU (RADV) that is builtin into my Ryzen 7 5700G and i noticed that mpv now uses waylandvk by default on my system where it used just wayland as context until recently. I noticed it, because it is horribly slow, its barely usable. Using --profile=best causes most of the frames to be dropped and using profile=fast gets me through with 90% GPU usage and a few frame drops here and there. For comparison with --gpu-context=wayland, profile=fast uses like 5~10% GPU and profile=best works without frame drops at ~90% GPU usage. So i put gpu-context=wayland into my mpv.conf now but i am wondering what causes this insane frame drop. Its a FullHD Video i watch on a 4K Screen (so it is using the upscaling), H.264 (with vaapi decoding) and a pretty low bit-rate. Like 3mbps or so (YouTube Quality). So not sure what exactly is the issue here, but waylandvk is not usable for me, at all.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Could someone that knows a bit more about this than me figure out if AMD GPUs still require RADV_PERFTEST? I do not know where to look at to find that information. According to another comment in this discussion it depends on a certain Mesa version, and also on the VCN version. So it would be nice to know which Mesa versions with which VCN versions don't require the flag to work. The Arch Wiki does not mention RADV_PERFTEST itself as a requirement to get Vulkan Video Decoding to work, only Mesa 25.1 or higher. (On the KDE page under the HDR section)  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         does glsl shaders like KrigBilateral and SSimDownscaler support in vulkan backend or i should keep using openGL to use them  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I'm trying to use vulkan video instead of nvdec due to it being inefficient, forcing the GPU into a high power profile. 
 Specs are: 5070ti, Version: 570.144, Arch Linux, Wayland, Plasma, Open GPU Kernel Modules. Hope someone can help, unsure if this is a driver thing with the new 50 series.. 
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         ANV_VIDEO_DECODE=1 to ANV_DEBUG=video-decode  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Khronos Announces Vulkan Video Decode VP9 Extension  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I can't get vulkan decode working on my 9070.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I'm on Intel (i3 1215u iGPU)+Arch Linux with current Mesa. Vulkan decoding works, but fast forwarding/skipping any H265 file makes it crash with this error: H264 files work without issues.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         I was wondering what else is needed for this to work with virtio-gpu via venus driver  | 
  
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Vulkan Video Decoding: Usage Guide and FAQ
On the 28th of May, we reached the significant milestone of finally merging all the required functionality into ffmpeg, libplacebo, and mpv to do end-to-end Vulkan video decoding and presentation. Although the functionality is now all there, we still have a complex landscape in terms of what is supported on what hardware and with what drivers. This document attempts to lay out all the requirements and limitations, so you have a chance of successfully using the feature.
Why should I even care about Vulkan video decoding?
It's a fair question. Right now, the actual functionality you gain access to is not terribly different from what you would get with existing video decoding APIs that ffmpeg and mpv already support. However, Vulkan video decoding has the potential to be a credible cross-vendor, cross-platform API that is well supported, and can work efficiently with Vulkan based filtering and post-processing. In the short term, there will be rough edges, and a narrower set of supported codecs (don't hold your breath for mpeg2 and vp8), but in the future, it will hopefully be the most performant and capable way to do hardware decoding and processing.
Software Requirements
We have finally reached the point where all the required components have made official releases. Ensure you are running with the following releases or newer:
These requirements mean you will likely have to compile everything for yourself (especially on Linux), but Shinchiro's windows builds appear to be functional.
Hardware and Driver Requirements
Usage
The basic command line arguments:
Depending on your system configuration, you may additionally need to force the right
gpu-context:--gpu-context=winvk--gpu-context=x11vk--gpu-context=waylandvkCapabilities
ANV_DEBUG=video-decodein your environment to expose video decodingRADV_PERFTEST=video_decodein your environment to expose video decodingBeta Was this translation helpful? Give feedback.
All reactions