@1st: I restored the Backup from before my CUDA+VK-tries. Now this is installed:
$ 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
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:
$ 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"):
$ 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:
[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:
[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":
$ 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:
#!/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:
$ 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.