Video acceleration · Open source
Configure and verify nvidia-vaapi-driver on Linux
Install the NVIDIA VA-API bridge, select its NVDEC backend, configure Firefox, then verify that playback reaches the GPU rather than the CPU.
Official install
These URLs go to the vendor or store. Nothing is downloaded from this server.
How do you install the VA-API bridge and select NVDEC?
Install the packaged driver first. The driver is a VA-API implementation that uses NVDEC as a backend, translating Linux video-acceleration requests rather than replacing NVIDIA's proprietary kernel and user-space driver stack.
- Confirm that the proprietary NVIDIA driver is loaded by running
nvidia-smi. Stop if the command cannot communicate with the driver, because the VA-API bridge cannot repair a missing kernel module or a mismatched NVIDIA library. - Install your distribution's
nvidia-vaapi-driverpackage andlibva-utils. Package names differ, so use the repository package rather than copying an untracked shared object into/usr/lib. - Create
~/.config/environment.d/90-nvidia-vaapi.confwith these values:
LIBVA_DRIVER_NAME=nvidia
NVD_BACKEND=direct- Log out completely and sign in again. A terminal opened before the environment change will retain its old values.
- Check them with
printenv LIBVA_DRIVER_NAME NVD_BACKEND; the expected output isnvidiaanddirecton separate lines.
Use the direct backend on current proprietary drivers. The project's backend and installation documentation explains that EGL remains available for older configurations, but it is not the sensible first choice on a modern installation.
Do not install libva-vdpau-driver as a substitute. That older translation layer targets VDPAU, while this driver exposes NVIDIA's NVDEC decoder through VA-API; having both installed can also make an unspecified libva search select the wrong backend.
How do you make Firefox request NVIDIA hardware decoding?
Set Firefox's VA-API controls explicitly. Firefox can report compositing correctly while decoding video on the CPU, especially when its RDD sandbox, Wayland session, codec choice, or inherited environment does not match the driver configuration.
- Open
about:config, accept the warning, and setmedia.ffmpeg.vaapi.enabledtotrue. - On Wayland, start Firefox with its native Wayland backend by setting
MOZ_ENABLE_WAYLAND=1; confirmabout:supportreportswaylandunder Window Protocol. - Restart every Firefox process. Closing one window is insufficient when another profile or background process remains alive.
- Open
about:supportand find HARDWARE_VIDEO_DECODING in the Decision Log. It should not be blocked, unavailable, or forced off. - Play a known H.264, VP9, or AV1 sample that the particular GPU can decode, then perform the GPU-side check in the next section.
Codec support is hardware-specific. An older GeForce may decode H.264 but lack VP9 or AV1 support, so an AV1 stream falling back to FFmpeg does not prove that the VA-API configuration is broken; compare the stream codec with NVIDIA's NVDEC support matrix.
Firefox 102 introduced a bug preventing the NVDEC VA-API driver from working under the RDD sandbox in affected setups, which produced old advice to disable media.rdd-ffmpeg.enabled or the sandbox entirely. Do not begin there. Current Firefox releases and the driver's documented sandbox handling should be tried first, since weakening a browser process boundary is a poor permanent fix.
Chromium is a different job. Its Linux VA-API path, sandbox behavior, flags, and distribution patches vary enough that a working vainfo result does not promise decoding in Chrome, Brave, or an Electron application.
How do you prove that decoding is actually running on the GPU?
Verify both layers. vainfo proves that libva can load the NVIDIA driver and enumerate profiles, while live NVDEC activity proves that the browser sent the playing stream through that path.
- Run the diagnostic with verbose driver messages:
NVD_LOG=1 LIBVA_DRIVER_NAME=nvidia vainfo- Look for the NVIDIA driver opening successfully and for
VAProfileentries matching the codec you intend to play. Thelibva error: vaGetDriverNameByIndex() failedmessage means driver discovery failed before the browser became relevant. - In another terminal, watch decoder use:
nvidia-smi dmon -s u- Start playback, choose a fixed resolution, and wait several seconds. Activity in the
deccolumn during playback is the useful signal; a busysmor graphics column alone can come from rendering and compositing. - Stop playback. Decoder activity should fall back, which separates the video workload from unrelated GPU processes.
That two-part test matters. The libva-utils project supplies vainfo, but capability enumeration is only a handshake: it cannot establish that Firefox selected a supported codec profile for the current video.
If vainfo works but dec remains zero, inspect the stream codec, Firefox's HARDWARE_VIDEO_DECODING decision, the active session type, and the environment inherited by the browser. If vainfo itself fails, fix libva driver selection, library architecture, or NVIDIA driver compatibility before changing browser preferences.
Browser task managers are weak evidence. Reduced CPU use can accompany lower resolution, dropped frames, or a codec change, whereas NVDEC utilization identifies the dedicated decode engine directly.
FAQ
- Does a successful vainfo result mean Firefox is hardware decoding?
- No. It means libva loaded the driver and found advertised codec profiles; confirm actual playback with Firefox's
about:supportdecision log and activity in thedeccolumn fromnvidia-smi dmon -s u. - Why does H.264 accelerate while AV1 stays on the CPU?
- The GPU probably lacks AV1 hardware decoding, or Firefox received an unsupported AV1 profile. NVIDIA added different codecs across GPU generations, so test a codec listed for the exact GPU rather than treating every NVDEC-capable card as equivalent.
- Should I disable the Firefox RDD sandbox?
- Usually not. That workaround circulated for older Firefox and driver combinations, but disabling a browser sandbox should be a temporary diagnostic after current packages, the direct backend, and documented driver settings have failed.
- Can libva-vdpau-driver replace the NVDEC VA-API driver?
- No.
libva-vdpau-drivertranslates VA-API calls to VDPAU, while the NVIDIA driver covered here uses NVDEC; installing both without explicit driver selection can make troubleshooting harder.