AMD RX570 vainfo and HW acceleration vaapi/vdpau

Hello,
I have problem with few things first vainfo not show info

$ vainfo
Trying display: wayland
Trying display: x11
vaInitialize failed with error code -1 (unknown libva error),exit

another problem is with mpv with --hwdec=vaapi I dont have any info about hw acceleration in log.
with --hwdec=vdpau I got info:

Using hardware decoding (vdpau-copy)

but look like this only work for x264 not for 4K file I dont see any info about hw accel and cpu usage is to high.

$ grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log
[     7.916] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[     7.916] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi

I put in my /etc/environment

VDPAU_DRIVER=radeonsi
LIBVA_DRIVER_NAME=radeonsi
LIBVA_DRIVERS_PATH=/usr/lib/dri/radeonsi_dri.so
vdpauinfo
Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                    3 65536  4096  4096
MPEG2_MAIN                      3 65536  4096  4096
H264_BASELINE                  52 65536  4096  4096
H264_MAIN                      52 65536  4096  4096
H264_HIGH                      52 65536  4096  4096
VC1_SIMPLE                      1 65536  4096  4096
VC1_MAIN                        2 65536  4096  4096
VC1_ADVANCED                    4 65536  4096  4096
MPEG4_PART2_SP                  3 65536  4096  4096
MPEG4_PART2_ASP                 5 65536  4096  4096
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE       0 65536  4096  4096
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
VP9_PROFILE_0                  --- not supported ---
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                  --- not supported ---
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      186 65536  4096  4096
HEVC_MAIN_10                   186 65536  4096  4096
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---
AV1_MAIN                       --- not supported ---
AV1_HIGH                       --- not supported ---
AV1_PROFESSIONAL               --- not supported ---


ps Just now I tried also mpv --hwdec=auto and I got for 4K

[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[ffmpeg] AVHWFramesContext: Unsupported sw format: yuv420p10le
[ffmpeg/video] hevc: Failed setup for format vdpau: hwaccel initialisation returned error.

Did you install install libva-mesa-driver for VAAPI?

1 Like

Yes, I removed from /etc/environment
LIBVA_DRIVER_NAME=radeonsi
LIBVA_DRIVERS_PATH=/usr/lib/dri/radeonsi_dri.so

and now vaapi working for x264 and x265 also in mpv vaapi is selector auto and if I set manual also everything is fine.

vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.3 for AMD Radeon RX 570 Series (polaris10, LLVM 15.0.7, DRM 3.42, 5.15.89-1-lts)
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

Summary now I have only problem with --hwdec=vdpau-copy / --hwdec=vdpau for 4K files

[ffmpeg] AVHWFramesContext: Unsupported sw format: yuv420p10le
[ffmpeg/video] hevc: Failed setup for format vdpau: hwaccel initialisation returned error.

Get rid of anything vdpau-* related, you want to use vaapi-*.