Search for apps, problems, ...
Nvidia GPU Video Acceleration with Firefox
If you use Linux – in our example EndeavourOS Arch (with Cinnamon Desktop) and have an NVIDIA Graphic card, you can speed up Firefox by enabling the computing power of your GPU. This implementation is specifically designed to be used by Firefox for accelerated decode of web content. It uses the VA-API implementation that uses NVDEC as a backend. Just follow these steps:
Install the open Nvidia driver
$ yay nvidia-open
Install the API support for libva:
$ yay libva-nvidia-driver
Install a tool to check whether it works
$ yay libva-utils
You should get a similar output when using vainfo in the terminal:
Adjust environment
Open the file /etc/environment with root privileges. Then add the following lines (for Nvidia Drivers > 525):
MOZ_DISABLE_RDD_SANDBOX=1
LIBVA_DRIVER_NAME=nvidia
NVD_BACKEND=direct
Firefox
To use the driver with Firefox, type in the URL field: about:config – and adjust the settings:
| Option | Value | Reason |
|---|---|---|
| media.ffmpeg.vaapi.enabled | true | Required, enables the use of VA-API. |
| media.rdd-ffmpeg.enabled | true | Required, default on FF97. Forces ffmpeg usage into the RDD process, rather than the content process. |
| media.av1.enabled | false | Optional, disables AV1. If your GPU doesn’t support AV1, this will prevent sites using it and falling back to software decoding. |
| gfx.x11-egl.force-enabled | true | Required, this driver requires that Firefox use the EGL backend. It may be enabled by default. It is recommended to test it with the MOZ_X11_EGL=1 environment variable before enabling it in the Firefox configuration. |
Test
Open Firefox and start a video on YouTube. Then go to the terminal and run:
$ nvidia-smi
In the line showing Firefox, you should now see the letter c or at least c/g. If you see it, it works. Alternatively, you can run Nvidia Settings, click on the graphic card, start a video and check if there is more than 0% next to the line Video Engine Utilization.