This task outlines the procedure for testing that ffmpeg-driven VAAPI acceleration in Firefox is considered "working". For this test to pass, when Firefox is playing videos, we verify the GPU on the system is used for rendering.
Note: The Budgie and MATE desktop environments do not yet support Wayland. Gnome currently has support disabled on Solus for now but will be enabled soon™
Prerequisites:
- Install libva-utils which will allow you to run vainfo
Smoke Test
Run vainfo. Make sure you see sane output like VA-API version, driver version, and a lot of lines with VAEntrypointVLD.
If you get any errors, ❌ STOP ❌ . VAAPI is not working correctly on the system.
Further setup
GPU Check and Firefox config
- Firefox requires a GPU with support for OpenGL 3.2 or newer or GLES 3.0 or newer to enable hardware acceleration. Verify your hardware supports this with glxinfo | grep "OpenGL.*profile version" for OpenGL and eglinfo | grep version for GLES
- To support 4k video in Firefox, go to about:config
- Ensure media.mediasource.webm.enabled is set to true
- Also make sure you don't have any addons that prefer / force the H264 codec (ideally, run Firefox with a profile that has no extensions installed)
If you have an AMD GPU
Set the following environment variable
LIBVA_DRIVER_NAME=radeonsi
If you have an Intel GPU
- Install intel-media-driver to support VAAPI.
- Install intel-gpu-tools to be able to run intel_gpu_top
If you have an nVidia GPU there's a little extra setup:
- The nvidia-vaapi-driver and nvidia-glx-driver packages must be installed
- You need to add a kernel boot flag. Create the file /etc/kernel/cmdline.d/10-nvidia.conf and add nvidia-drm.modeset=1, then reboot.
- Run sudo clr-boot-manager mount-boot
- UEFI: Check cat /boot/loader/entries/Solus-*.conf | grep nvidia-drm.modeset=1
- BIOS: Check sudo cat /boot/grub/grub.cfg | grep nvidia-drm.modeset=1
- Verify that dmesg | grep nvidia-modeset returns output
- Verify that the kernel is currently loaded with nvidia-modeset with grep nvidia-drm.modeset /proc/cmdline
- The following environment variables need to be set in your bashrc / zshrc / fish variables:
MOZ_DISABLE_RDD_SANDBOX=1 EGL_PLATFORM=wayland __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json LIBVA_DRIVER_NAME=nvidia
Firefox setup
- In Firefox, navigate to about:config
- Look for the property media.ffmpeg.vaapi.enabled. Create it if it doesn't exist. Set this to "true". Ensure the following values are set as follows:
- widget.dmabuf.force-enabled true
- media.rdd-ffmpeg.enabled true
- gfx.x11-egl.force-enabled true
- gfx.webrender.software false
- Look for the property media.ffmpeg.vaapi.enabled. Create it if it doesn't exist. Set this to "true". Ensure the following values are set as follows:
- Restart FF and navigate to about:support and check these under the GPU section:
- Under Graphics, "Compositing" should be "WebRender" (not "WebRender (Software)")
- Under GPU#1, "VAAPI" should exist and have
- available by default
- force_enabled by user: Force enabled by pref (not present for Intel)
- blocklisted by env: Blocklisted by gfxinfo (not present for Intel)
Testing
nVidia test:
- Start Firefox.
- In terminal run nvidia-smi. Note any firefox processes and the Memory-Usage.
- Start up a YouTube video.
- Re-run nvidia-smi. There should still be firefox process(es), and the Memory-Usage increases, this verifies that Firefox is using hardware rendering.
Intel test:
- Start up a YouTube video.
- Run sudo intel_gpu_top. You should see the memory utilization go up.
AMD test:
YouTube tests:
Start firefox in terminal so you can see if there are any errors. In particular, look for anything with "VA-API".
MOZ_LOG="PlatformDecoderModule:5" MOZ_X11_EGL=1 firefox
You don't want to see "Failed to create VA-API device context"
Test the following videos at 1080p60 and use right-click -> stats for nerds. If things are working, there should be a field Codecs with something like VP9X (verifying the VP9 codec is in use), and opus
Twitch tests:
IF and only if the above works, test the following Twitch video(s) and use right-click -> stats for nerds to check that HW accel is enabled
- (...)
- (...)
Helpful for visuals re. what a test could look like
Firefox Hardware Video Decoding Using VAAPI & Wayland
Report format example:
GPU: Radeon RX Vega 64
Desktop: KDE Plasma Desktop (X11 + Wayland sessions both tested)
System: Up to date -unstable install
Result: Acceleration confirmed working under both X11, XWayland (the default in a Wayland session with the command supplied above?) and Wayland native (MOZ_LOG="PlatformDecoderModule:5" MOZ_X11_EGL=1 MOZ_ENABLE_WAYLAND=1 firefox in a terminal)