Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: How can I use mpv with CUDA and/or Vulkan? (Read 2388 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How can I use mpv with CUDA and/or Vulkan?

I have an AMD RX 560D and this is my mpv.conf:
Code: [Select]
hwdec=auto-unsafe
hwdec-codecs=all
#vo=gpu-next
deinterlace=auto
scale=spline36
interpolation
tscale=oversample
video-sync=display-resample-vdrop
osd-duration=2000
idle=once
autofit-larger=99%x95%
audio-channels=auto

Usually it looks like this (gpu + gpu-next / unnecessary removed):
Code: [Select]
● Video  --vid=1               (h264 1280x720 29.969 fps) [default]
Cannot load libcuda.so.1
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Using hardware decoding (vaapi-copy).
VO: [gpu] 1280x720 nv12
----------------------------------------
● Video  --vid=1               (h264 1280x720 29.969 fps) [default]
Cannot load libcuda.so.1
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12

In chaotic-aur I found "mpv-full" with "nvidia-utils" as optdep and I installed both:
Code: [Select]
Name                     : mpv-full
Version                  : 0.40.0-1
Hängt ab von             : alsa-lib  ffmpeg  gcc-libs  glibc  hicolor-icon-theme  jack  lcms2  libarchive  libass  libbluray  libcaca  libcdio  libcdio-paranoia  libdisplay-info  libdrm  libdvdnav  libgl  libjpeg  libpipewire  libplacebo  libpulse  libsixel  libva  libvdpau  libx11  libxext  libxkbcommon  libxpresent  libxrandr  libxss  libxv  lua52  mesa  mujs  openal  rubberband  sdl2-compat  sh  sndio  uchardet  vapoursynth  vulkan-icd-loader  wayland  zimg  zlib
Optionale Abhängigkeiten : nvidia-utils: for hardware accelerated video decoding with CUDA [Installiert]
                           python: for stats-conv and umpv scripts [Installiert]
                           python-pyqt6: for stats-conv script [Installiert]
                           python-pyqtgraph: for stats-conv script [Installiert]
                           youtube-dl: for video-sharing websites playback
                           yt-dlp: for video-sharing websites playback [Installiert]
----------------------------------------
Name                     : nvidia-utils
Version                  : 570.133.07-1
Stellt bereit            : vulkan-driver  opengl-driver  nvidia-libgl
Hängt ab von             : libglvnd  egl-wayland  egl-gbm  egl-x11
Optionale Abhängigkeiten : nvidia-settings: configuration tool
                           xorg-server: Xorg support [Installiert]
                           xorg-server-devel: nvidia-xconfig
                           opencl-nvidia: OpenCL support
Benötigt von             : libglvnd
Optional für             : ffmpeg  gpu-screen-recorder  libvdpau  mpv-full  sdl3  vulkan-icd-loader
In Konflikt mit          : nvidia-libgl

Now it's looks like this:
Code: [Select]
● Video  --vid=1               (h264 1280x720 29.969 fps) [default]
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
Using hardware decoding (vaapi-copy).
VO: [gpu] 1280x720 nv12
----------------------------------------
● Video  --vid=1               (h264 1280x720 29.969 fps) [default]
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12
When booting, there is a modprobe warning: nvidia-uvm not found in /lib/modules/6.14.1-artix1-1

What is missing for CUDA and Vulkan?

This is installed:
Code: [Select]
$ pacman -Qsq nvidia
egl-gbm
egl-wayland
egl-x11
libvdpau
nvidia-utils
xf86-video-nouveau
----------------------------------------
$ pacman -Qsq cuda
icu
----------------------------------------
$ pacman -Qsq vulkan
amdvlk
glad
nvidia-utils
spirv-headers
spirv-tools
volk
vulkan-extra-layers
vulkan-extra-tools
vulkan-headers
vulkan-html-docs
vulkan-icd-loader
vulkan-mesa-layers
vulkan-radeon
vulkan-tools
vulkan-utility-libraries
vulkan-validation-layers
vulkan-virtio

Re: How can I use mpv with CUDA and/or Vulkan?

Reply #1
You can't use nvidia features without nvidia GPU. RX 560D is from AMD. You either need ZLUDA as a wrapper for CUDA or just use vaapi with mesa for AMD-adjecent HW acceleration.
Code: [Select]
gpu-api=vulkan
vo=gpu-next
hwdec=vulkan # change to `vaapi` if this doesn't work...
ao=alsa # pulse sucks ass

Re: How can I use mpv with CUDA and/or Vulkan?

Reply #2
You can't use nvidia features without nvidia GPU. RX 560D is from AMD.
I thought CUDA was Nvidia only first, but then opened for others, like vdpau. - Obviously I was wrong.

Vulkan:
First I switched CPU to powersave, cut the Test.mpv (h264 1280x720 29.969 fps) to 12 seconds and removed audio.

I tested without the mpv.conf (shorted):
Code: [Select]
$ time mpv --gpu-api=vulkan --vo=gpu-next --hwdec=vulkan Test.mkv 
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
VO: [gpu-next] 1280x720 yuv420p
real 0m13,985s
user 0m5,397s
sys 0m0,766s

$ time mpv --gpu-api=vulkan --vo=gpu-next --hwdec=vulkan-copy Test.mkv
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg/video] h264: Failed setup for format vulkan: hwaccel initialisation returned error.
VO: [gpu-next] 1280x720 yuv420p
real 0m14,513s
user 0m5,712s
sys 0m0,957s

$ time mpv --gpu-api=vulkan --vo=gpu-next --hwdec=vaapi Test.mkv
VO: [gpu-next] 1280x720 yuv420p
real 0m14,026s
user 0m5,282s
sys 0m0,918s

$ time mpv --gpu-api=vulkan --vo=gpu-next --hwdec=vaapi-copy Test.mkv
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12
real 0m14,092s
user 0m2,158s
sys 0m1,620s

$ time mpv --gpu-api=vulkan --hwdec=vaapi-copy Test.mkv
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12
real 0m14,076s
user 0m2,147s
sys 0m1,600s

$ time mpv --hwdec=vaapi-copy Test.mkv
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12
real 0m14,058s
user 0m2,144s
sys 0m1,636s

$ time mpv --hwdec=auto-unsafe Test.mkv
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12
real 0m14,280s
user 0m2,256s
sys 0m1,762s

$ time mpv --hwdec=auto Test.mkv
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 1280x720 nv12
real 0m14,339s
user 0m2,320s
sys 0m1,719s
That "vaapi" doesn't work is new. But in the past I had problems from time to time and had to use "vaapi-copy". Maybe it is disabled because of that.

With "vulkan-copy" I get "[ffmpeg/video] h264: Failed setup for format vulkan: hwaccel initialisation returned error." - Is something missing?

But the main thing for me is solved: With "hwdec=vaapi-copy" instead of "hwdec=auto" the errors (CUDA and VK) are gone: Not in sight = not in mind. ;)

Btw:

With "vo=gpu-next" MPEG2-Videos (DVB-S1) are to bright and with "ao=alsa" the Videos often had no sound: Most in combination with "espeak-ng" which I use a lot in scripts. - I. e. "Check!" when something has finished.

Re: How can I use mpv with CUDA and/or Vulkan?

Reply #3
Can you install libva-utils and send the output of vainfo? Are you using vulkan-radeon for Vulkan? (check if you're not using amdvlk, which has overall worse performance and does not support Vulkan video decode)

I'm pretty sure the RX 560 has hardware-accelerated h264 video decode.

Re: How can I use mpv with CUDA and/or Vulkan?

Reply #4
@1st: I restored the Backup from before my CUDA+VK-tries. Now this is installed:
Code: [Select]
$ pacman -Qsq amd
amd-ucode
vulkan-radeon
xf86-video-amdgpu

$ pacman -Qsq nvidia
libvdpau
xf86-video-nouveau

$ pacman -Qsq cuda
icu

$ pacman -Qsq libva
libva
mesa
vamp-plugin-sdk

$ pacman -Qsq vulkan
spirv-tools
vulkan-icd-loader
vulkan-mesa-layers
vulkan-radeon
vulkan-virtio

$ pacman -Qsq vdpau
libvdpau
mesa
$ pacman -Qsq mesa
glu
mesa
mesa-utils
vulkan-mesa-layers

Can you install libva-utils and send the output of vainfo? Are you using vulkan-radeon for Vulkan? (check if you're not using amdvlk, which has overall worse performance and does not support Vulkan video decode)
I had installed "amdvlk" for my tries, but didn't change anything. Now it's away again.

hwdec-capability is not the problem, even with hevc-hdr:
Code: [Select]
$ vainfo
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Mesa Gallium driver 25.0.3-arch1.1 for AMD Radeon RX 460 Graphics (radeonsi, polaris11, ACO, DRM 3.61, 6.14.1-artix1-1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

I discovered that it works without "copy" (and is much faster), when using "vo=vdpau" or "vo=vaapi" (again CPU with "powersave" and without "mpv.conf"):
Code: [Select]
$ time mpv --fs --vo=vdpau --hwdec=auto-unsafe 4k-hevc-hdr.mkv 
[vo/vdpau] Warning: this compatibility VO is low quality and may have issues with OSD, scaling, screenshots and more.
[vo/vdpau] vo=gpu is the preferred choice in any case and includes VDPAU support via hwdec=vdpau or vdpau-copy.
Using hardware decoding (vdpau).
VO: [vdpau] 3840x2160 vdpau[yuv420p10]
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
real 0m3,859s
user 0m0,878s
sys 0m0,244s

$ time mpv --fs --vo=vaapi --hwdec=auto-unsafe 4k-hevc-hdr.mkv
[vo/vaapi] Warning: this compatibility VO is low quality and may have issues with OSD, scaling, screenshots and more.
[vo/vaapi] vo=gpu is the preferred choice in any case and includes VA-API support via hwdec=vaapi or vaapi-copy.
Using hardware decoding (vaapi).
VO: [vaapi] 3840x2160 vaapi[p010]
real 0m4,011s
user 0m0,873s
sys 0m0,332s

$ time mpv --fs --vo=gpu --hwdec=auto-unsafe 4k-hevc-hdr.mkv
Cannot load libcuda.so.1
[ffmpeg/video] hevc: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Using hardware decoding (vaapi-copy).
VO: [gpu] 3840x2160 p010
real 0m7,349s
user 0m4,628s
sys 0m1,990s

$ time mpv --fs --vo=gpu-next --hwdec=auto-unsafe 4k-hevc-hdr.mkv
Cannot load libcuda.so.1
[ffmpeg/video] hevc: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Using hardware decoding (vaapi-copy).
VO: [gpu-next] 3840x2160 p010
real 0m7,451s
user 0m4,686s
sys 0m2,240s

With "mpv -v --fs --hwdec=auto-unsafe 4k-hevc-hdr.mkv" this seems to be the important part:
Code: [Select]
[vd] Opening decoder hevc
[vd] Looking at hwdec hevc-nvdec...
[vo/gpu] Loading hwdec drivers for format: 'cuda'
[vo/gpu] Loading hwdec driver 'cuda'
Cannot load libcuda.so.1
[vo/gpu/cuda] Failed to load CUDA symbols
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec hevc-vaapi...
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vo/gpu] Loading hwdec driver 'vaapi'
[vo/gpu/vaapi] libplacebo dmabuf interop requires support for PL_HANDLE_DMA_BUF import.
[vo/gpu/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends.
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec hevc-vulkan...
[vo/gpu] Loading hwdec drivers for format: 'vulkan'
[vo/gpu] Loading hwdec driver 'vulkan'
[vd] Trying hardware decoding via hevc-vulkan.
[vd] Selected decoder: hevc - HEVC (High Efficiency Video Coding)
[vf] User filter list:
[vf]   (empty)
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi vulkan vdpau cuda yuv420p10le
[vd] Codec profile: Main 10 (0x2)
[ffmpeg/video] hevc: Device does not support the VK_KHR_video_decode_queue extension!
[vd] Hardware decoding of this stream is unsupported?
[vd] Requesting pixfmt 'yuv420p10le' from decoder.
[vd] Attempting next decoding method after failure of hevc-vulkan.
[vd] Looking at hwdec hevc-vdpau...
[vo/gpu] Loading hwdec drivers for format: 'vdpau'
[vo/gpu] Loading hwdec driver 'vdpau-gl'
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec hevc-nvdec-copy...
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[vd] Could not create device.
[vd] Looking at hwdec hevc-vaapi-copy...
[vaapi] libva: VA-API version 1.22.0
[vaapi] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[vaapi] libva: Found init function __vaDriverInit_1_22
[vaapi] libva: va_openDriver() returns 0
[vaapi] Initialized VAAPI: version 1.22
[vd] Trying hardware decoding via hevc-vaapi-copy.
[vd] Pixel formats supported by decoder: vaapi vulkan vdpau cuda yuv420p10le
[vd] Codec profile: Main 10 (0x2)
[vd] Requesting pixfmt 'vaapi' from decoder.
[vd] Using hardware decoding (vaapi-copy).

Similar to the 720p x264:
Code: [Select]
[vd] Opening decoder h264
[vd] Looking at hwdec h264-nvdec...
[vo/gpu] Loading hwdec drivers for format: 'cuda'
[vo/gpu] Loading hwdec driver 'cuda'
Cannot load libcuda.so.1
[vo/gpu/cuda] Failed to load CUDA symbols
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec h264-vaapi...
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vo/gpu] Loading hwdec driver 'vaapi'
[vo/gpu/vaapi] libplacebo dmabuf interop requires support for PL_HANDLE_DMA_BUF import.
[vo/gpu/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends.
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec h264-vulkan...
[vo/gpu] Loading hwdec drivers for format: 'vulkan'
[vo/gpu] Loading hwdec driver 'vulkan'
[vd] Trying hardware decoding via h264-vulkan.
[vd] Selected decoder: h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vf] User filter list:
[vf]   (empty)
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vdpau vulkan cuda vaapi yuv420p
[vd] Codec profile: High (0x64)
[ffmpeg/video] h264: Device does not support the VK_KHR_video_decode_queue extension!
[vd] Hardware decoding of this stream is unsupported?
[vd] Requesting pixfmt 'yuv420p' from decoder.
[vd] Attempting next decoding method after failure of h264-vulkan.
[vd] Looking at hwdec h264-vdpau...
[vo/gpu] Loading hwdec drivers for format: 'vdpau'
[vo/gpu] Loading hwdec driver 'vdpau-gl'
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec h264-nvdec-copy...
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[vd] Could not create device.
[vd] Looking at hwdec h264-vaapi-copy...
[vaapi] libva: VA-API version 1.22.0
[vaapi] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[vaapi] libva: Found init function __vaDriverInit_1_22
[vaapi] libva: va_openDriver() returns 0
[vaapi] Initialized VAAPI: version 1.22
[vd] Trying hardware decoding via h264-vaapi-copy.
[vd] Pixel formats supported by decoder: vdpau vulkan cuda vaapi yuv420p
[vd] Codec profile: High (0x64)
[vd] Requesting pixfmt 'vaapi' from decoder.
[vd] Using hardware decoding (vaapi-copy).

Because of "[vo/gpu/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends." I discovered that "vaapi" still works with "--gpu-api=opengl":
Code: [Select]
$ time mpv --fs --gpu-api=auto --hwdec=auto-unsafe 4k-hevc-hdr.mkv 
Cannot load libcuda.so.1
[ffmpeg/video] hevc: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Using hardware decoding (vaapi-copy).
VO: [gpu] 3840x2160 p010
real 0m7,378s
user 0m4,603s
sys 0m1,988s

$ time mpv --fs --gpu-api=vulkan --hwdec=auto-unsafe 4k-hevc-hdr.mkv
Cannot load libcuda.so.1
[ffmpeg/video] hevc: Device does not support the VK_KHR_video_decode_queue extension!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Using hardware decoding (vaapi-copy).
VO: [gpu] 3840x2160 p010
real 0m7,374s
user 0m4,582s
sys 0m2,052s

$ time mpv --fs --gpu-api=opengl --hwdec=auto-unsafe 4k-hevc-hdr.mkv
Cannot load libcuda.so.1
Using hardware decoding (vaapi).
VO: [gpu] 3840x2160 vaapi[p010]
real 0m4,265s
user 0m1,185s
sys 0m0,389s

So "--gpu-api=opengl --hwdec=vaapi" seems to be the best choice for me.

Otherwise it uses "libplacebo" and needs "--hwdec=vaapi-copy". - Or is there anything missing for Vulkan?

Btw:

To switch to "powersave" I use my "gov"-Script:
Code: [Select]
#!/bin/bash
if [ -z $1 ]
then cat /sys/devices/system/cpu/cpufreq/policy0/s*{gov*,_*a*freq*}
exit;fi
if [ ! -z $2 ];then t=$2
for g in /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq
do echo $((t*10**5))|sudo tee $g >/dev/null
done;fi
case "$1" in
p)
for g in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
do echo performance|sudo tee $g >/dev/null
done
;;
s)
for g in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
do echo powersave|sudo tee $g >/dev/null
done
;;
u)
for g in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
do echo schedutil|sudo tee $g >/dev/null
done
;;
o)
for g in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
do echo ondemand|sudo tee $g >/dev/null
done
;;
*) if [ -z $2 ];then echo "gov p/s/u/o [Takt] <- (p)erformance / power(s)ave / sched(u)til / (o)ndemand";exit;fi
;;
esac
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_{governor,max_freq}
Examples:
Code: [Select]
$ gov
conservative ondemand userspace powersave performance schedutil
powersave
4000000 3400000 2800000 2100000 1400000
4000000

$ gov p
[sudo] Passwort für user:
performance
4000000

$ gov t 28
performance
2800000

$ gov o 21
ondemand
2100000

$ gov u 34
schedutil
3400000

$ gov h
gov p/s/u/o [Takt] <- (p)erformance / power(s)ave / sched(u)til / (o)ndemand
I limit the max_freq to keep the PC silent or in summer, when it's to hot anyway.  8)

Re: How can I use mpv with CUDA and/or Vulkan?

Reply #5
VAAPI on vulkan requires drm modifier support which that card doesn't have. So it would only work on opengl. Vulkan hardware decoding should work with the RADV_PERFTEST=video_decode environment variable though.

Re: How can I use mpv with CUDA and/or Vulkan?

Reply #6
Vulkan hardware decoding should work with the RADV_PERFTEST=video_decode environment variable though
Thank you! That works: :)
Code: [Select]
$ time RADV_PERFTEST=video_decode mpv --fs --gpu-api=vulkan --hwdec=vulkan 4k-hevc-hdr.mkv
Using hardware decoding (vulkan).
VO: [gpu] 3840x2160 vulkan[p010]
real 0m9,475s
user 0m2,038s
sys 0m0,681s
But opengl+vaapi is faster:
Code: [Select]
$ time mpv --fs --gpu-api=opengl --hwdec=vaapi 4k-hevc-hdr.mkv
Using hardware decoding (vaapi).
VO: [gpu] 3840x2160 vaapi[p010]
real 0m8,912s
user 0m1,543s
sys 0m0,420s
Nevertheless I put it in "/etc/environment", to have it when I need it. ;)

Here everything that contains "video":
Code: [Select]
$ RADV_PERFTEST=video_decode vulkaninfo  -o vulkan.txt

Device Properties and Extensions:
=================================
GPU0:
VkPhysicalDeviceProperties:
---------------------------
apiVersion        = 1.4.305 (4210993)
driverVersion     = 25.0.3 (104857603)
vendorID          = 0x1002
deviceID          = 0x67ef
deviceType        = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName        = AMD Radeon RX 460 Graphics (RADV POLARIS11)
pipelineCacheUUID = a0c631b9-b5df-fc02-5e86-cd1cf4dd97ef

Device Extensions: count = 190
VK_KHR_video_decode_h264                      : extension revision 9
VK_KHR_video_decode_h265                      : extension revision 8
VK_KHR_video_decode_queue                     : extension revision 8
VK_KHR_video_maintenance1                     : extension revision 1
VK_KHR_video_queue                            : extension revision 8

VkQueueFamilyProperties:
========================
queueProperties[0]:
-------------------
minImageTransferGranularity = (1,1,1)
queueCount                  = 1
queueFlags                  = QUEUE_GRAPHICS_BIT | QUEUE_COMPUTE_BIT | QUEUE_TRANSFER_BIT
timestampValidBits          = 64
present support             = true
VkQueueFamilyQueryResultStatusPropertiesKHR:
--------------------------------------------
queryResultStatusSupport = false

VkQueueFamilyVideoPropertiesKHR:
--------------------------------
videoCodecOperations:
None

queueProperties[1]:
-------------------
minImageTransferGranularity = (1,1,1)
queueCount                  = 4
queueFlags                  = QUEUE_COMPUTE_BIT | QUEUE_TRANSFER_BIT
timestampValidBits          = 64
present support             = true
VkQueueFamilyQueryResultStatusPropertiesKHR:
--------------------------------------------
queryResultStatusSupport = false

VkQueueFamilyVideoPropertiesKHR:
--------------------------------
videoCodecOperations:
None

queueProperties[2]:
-------------------
minImageTransferGranularity = (1,1,1)
queueCount                  = 1
queueFlags                  = QUEUE_VIDEO_DECODE_BIT_KHR
timestampValidBits          = 0
present support             = false
VkQueueFamilyQueryResultStatusPropertiesKHR:
--------------------------------------------
queryResultStatusSupport = false

VkQueueFamilyVideoPropertiesKHR:
--------------------------------
videoCodecOperations: count = 2
VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR
VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR

queueProperties[3]:
-------------------
minImageTransferGranularity = (1,1,1)
queueCount                  = 1
queueFlags                  = QUEUE_SPARSE_BINDING_BIT
timestampValidBits          = 64
present support             = false
VkQueueFamilyQueryResultStatusPropertiesKHR:
--------------------------------------------
queryResultStatusSupport = false

VkQueueFamilyVideoPropertiesKHR:
--------------------------------
videoCodecOperations:
None

VkPhysicalDeviceVideoMaintenance1FeaturesKHR:
---------------------------------------------
videoMaintenance1 = true

Video Profiles: count = 60
==========================
placeholder = H.264 Decode (4:2:0 8-bit) Baseline progressive
placeholder = H.264 Decode (4:2:0 8-bit) Main progressive
placeholder = H.264 Decode (4:2:0 8-bit) High progressive
placeholder = H.264 Decode (4:2:0 8-bit) Baseline interlaced (interleaved lines)
placeholder = H.264 Decode (4:2:0 8-bit) Main interlaced (interleaved lines)
placeholder = H.264 Decode (4:2:0 8-bit) High interlaced (interleaved lines)
placeholder = H.264 Decode (4:2:0 8-bit) Baseline interlaced (separate planes)
placeholder = H.264 Decode (4:2:0 8-bit) Main interlaced (separate planes)
placeholder = H.264 Decode (4:2:0 8-bit) High interlaced (separate planes)
placeholder = H.264 Decode (4:2:2 8-bit) Baseline progressive
placeholder = H.264 Decode (4:2:2 8-bit) Main progressive
placeholder = H.264 Decode (4:2:2 8-bit) High progressive
placeholder = H.264 Decode (4:2:2 8-bit) Baseline interlaced (interleaved lines)
placeholder = H.264 Decode (4:2:2 8-bit) Main interlaced (interleaved lines)
placeholder = H.264 Decode (4:2:2 8-bit) High interlaced (interleaved lines)
placeholder = H.264 Decode (4:2:2 8-bit) Baseline interlaced (separate planes)
placeholder = H.264 Decode (4:2:2 8-bit) Main interlaced (separate planes)
placeholder = H.264 Decode (4:2:2 8-bit) High interlaced (separate planes)
placeholder = H.264 Decode (4:4:4 8-bit) Baseline progressive
placeholder = H.264 Decode (4:4:4 8-bit) Main progressive
placeholder = H.264 Decode (4:4:4 8-bit) High progressive
placeholder = H.264 Decode (4:4:4 8-bit) Baseline interlaced (interleaved lines)
placeholder = H.264 Decode (4:4:4 8-bit) Main interlaced (interleaved lines)
placeholder = H.264 Decode (4:4:4 8-bit) High interlaced (interleaved lines)
placeholder = H.264 Decode (4:4:4 8-bit) Baseline interlaced (separate planes)
placeholder = H.264 Decode (4:4:4 8-bit) Main interlaced (separate planes)
placeholder = H.264 Decode (4:4:4 8-bit) High interlaced (separate planes)
placeholder = H.264 Decode (monochrome 8-bit) Baseline progressive
placeholder = H.264 Decode (monochrome 8-bit) Main progressive
placeholder = H.264 Decode (monochrome 8-bit) High progressive
placeholder = H.264 Decode (monochrome 8-bit) Baseline interlaced (interleaved lines)
placeholder = H.264 Decode (monochrome 8-bit) Main interlaced (interleaved lines)
placeholder = H.264 Decode (monochrome 8-bit) High interlaced (interleaved lines)
placeholder = H.264 Decode (monochrome 8-bit) Baseline interlaced (separate planes)
placeholder = H.264 Decode (monochrome 8-bit) Main interlaced (separate planes)
placeholder = H.264 Decode (monochrome 8-bit) High interlaced (separate planes)
placeholder = H.265 Decode (4:2:0 8-bit) Main
placeholder = H.265 Decode (4:2:0 8-bit) Main 10
placeholder = H.265 Decode (4:2:0 8-bit) Main Still Picture
placeholder = H.265 Decode (4:2:0 10-bit) Main
placeholder = H.265 Decode (4:2:0 10-bit) Main 10
placeholder = H.265 Decode (4:2:0 10-bit) Main Still Picture
placeholder = H.265 Decode (4:2:2 8-bit) Main
placeholder = H.265 Decode (4:2:2 8-bit) Main 10
placeholder = H.265 Decode (4:2:2 8-bit) Main Still Picture
placeholder = H.265 Decode (4:2:2 10-bit) Main
placeholder = H.265 Decode (4:2:2 10-bit) Main 10
placeholder = H.265 Decode (4:2:2 10-bit) Main Still Picture
placeholder = H.265 Decode (4:4:4 8-bit) Main
placeholder = H.265 Decode (4:4:4 8-bit) Main 10
placeholder = H.265 Decode (4:4:4 8-bit) Main Still Picture
placeholder = H.265 Decode (4:4:4 10-bit) Main
placeholder = H.265 Decode (4:4:4 10-bit) Main 10
placeholder = H.265 Decode (4:4:4 10-bit) Main Still Picture
placeholder = H.265 Decode (monochrome 8-bit) Main
placeholder = H.265 Decode (monochrome 8-bit) Main 10
placeholder = H.265 Decode (monochrome 8-bit) Main Still Picture
placeholder = H.265 Decode (monochrome 10-bit) Main
placeholder = H.265 Decode (monochrome 10-bit) Main 10
placeholder = H.265 Decode (monochrome 10-bit) Main Still Picture