In 21.04, I was able to successfully enable VA-API support for Firefox for hardware video acceleration using my amdgpu on Wayland. Mainly, following steps from https://ubuntuhandbook.org/index.php/2021/08/enable-hardware-video-acceleration-va-api-for-firefox-in-ubuntu-20-04-18-04-higher/
Since upgraded to 21.10, I've noticed increased CPU usage when playing youtube videos. When I checked by running firefox from command line, I can see that I can't seems to open vaapi driver correctly:
$ /snap/bin/firefox
Importing existing firefox profiles from /home/ymchen/.mozilla/firefox
Found default profile: dhjf4r7r.default-1587103347891
Import done in 3.141 s
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/631/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/631/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: va_openDriver() returns -1
Installing firefox from apt, I can see that vaapi still works:
$ /usr/bin/firefox
libva info: VA-API version 1.12.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
libva info: VA-API version 1.12.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
libva info: VA-API version 1.12.0
Curiously, VA-API version available in snap version is older 1.7.0 compared to the apt installed version 1.12.0. Perhaps the "packaged" version of the dependencies in snap version is outdated?
I've also noticed that the file /snap/firefox/631/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so does not exist. Perhaps Firefox maintainers forgot to package it into the snap?
Yes, I can just use the apt version but I'd like try to support the snap version as has more directly support from upstream Firefox developers but without VA-API, it is often annoying to hear the CPU fan spin up when watching videos.
Any idea how to get Firefox snap to work with VA-API? Thanks