Try to compile AMD mesa driver for VAAPI

It seems that ClearLinux doesn’t bring back H264/HEVC VAAPI hardware coding in AMD GPU mesa driver, after mesa removed them for patent issues. So I decided to recompile it to add these functionalities, and I found this PKGBULD on GitHub GitHub - archlinux/svntogit-packages at packages/mesa. Following its instructions, ignoring all warnings, and I finally get my VAAPI works. Frankly speaking, ClearLinux is a bad idea for AMD GPU (but a nice choice for AMD CPU).

ClearLinux’s original libva-mesa-driver:

❯ vainfo
Trying display: wayland
Trying display: x11
error: can't connect to X server!
Trying display: drm
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.17.0)
vainfo: Driver version: Mesa Gallium driver 23.1.0-devel for AMD Radeon RX 6600 XT (navi23, LLVM 15.0.7, DRM 3.49, 6.2.1-1280.native)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

My compiled one:

❯ vainfo
Trying display: wayland
Trying display: x11
error: can't connect to X server!
Trying display: drm
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.17.0)
vainfo: Driver version: Mesa Gallium driver 23.0.0 for AMD Radeon RX 6600 XT (navi23, LLVM 15.0.7, DRM 3.49, 6.2.1-1280.native)
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
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

Here I also share my compiled AMD drivers, in case someone may need them.

https://oss.ziyao.wang/usr/lib64/dri/radeonsi_dri.so

https://oss.ziyao.wang/usr/lib64/dri/radeonsi_drv_video.so

1 Like

I have the exact same GPU as you. Did you install any extra dependencies beside what’s in Clear Linux software bundles? What do I have to replace to use compiled version?

I can get it to compile, but as soon as I copy radeonsi_drv_video.so from /usr/local/lib64/drv to /usr/lib64/drv Gnome crashes.

I hope someone can get it to work through 3rd party repos in the future.