CodecPath

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.

CodecPath editors4 min read

Official install

These URLs go to the vendor or store. Nothing is downloaded from this server.

FirefoxRequests a supportedvideo profilelibvaLoads the selectedNVIDIA driverVA-API bridgeTranslates requests forNVDECNVDECDecodes supported frameson the GPU
A working decode request must cross the browser, libva, the translation driver, and NVIDIA's dedicated NVDEC engine.

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.

  1. 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.
  2. Install your distribution's nvidia-vaapi-driver package and libva-utils. Package names differ, so use the repository package rather than copying an untracked shared object into /usr/lib.
  3. Create ~/.config/environment.d/90-nvidia-vaapi.conf with these values:
INI
LIBVA_DRIVER_NAME=nvidia
NVD_BACKEND=direct
  1. Log out completely and sign in again. A terminal opened before the environment change will retain its old values.
  2. Check them with printenv LIBVA_DRIVER_NAME NVD_BACKEND; the expected output is nvidia and direct on 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.

  1. Open about:config, accept the warning, and set media.ffmpeg.vaapi.enabled to true.
  2. On Wayland, start Firefox with its native Wayland backend by setting MOZ_ENABLE_WAYLAND=1; confirm about:support reports wayland under Window Protocol.
  3. Restart every Firefox process. Closing one window is insufficient when another profile or background process remains alive.
  4. Open about:support and find HARDWARE_VIDEO_DECODING in the Decision Log. It should not be blocked, unavailable, or forced off.
  5. 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.

  1. Run the diagnostic with verbose driver messages:
Bash
NVD_LOG=1 LIBVA_DRIVER_NAME=nvidia vainfo
  1. Look for the NVIDIA driver opening successfully and for VAProfile entries matching the codec you intend to play. The libva error: vaGetDriverNameByIndex() failed message means driver discovery failed before the browser became relevant.
  2. In another terminal, watch decoder use:
Bash
nvidia-smi dmon -s u
  1. Start playback, choose a fixed resolution, and wait several seconds. Activity in the dec column during playback is the useful signal; a busy sm or graphics column alone can come from rendering and compositing.
  2. 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:support decision log and activity in the dec column from nvidia-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-driver translates VA-API calls to VDPAU, while the NVIDIA driver covered here uses NVDEC; installing both without explicit driver selection can make troubleshooting harder.

Guides