All Projects → elFarto → nvidia-vaapi-driver

elFarto / nvidia-vaapi-driver

Licence: other
A VA-API implemention using NVIDIA's NVDEC

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to nvidia-vaapi-driver

vdpau-va-driver-vp9
Experimental VP9 codec support for vdpau-va-driver (NVIDIA VDPAU-VAAPI wrapper) and chromium-vaapi
Stars: ✭ 68 (-91.38%)
Mutual labels:  nvidia, vaapi, nvdec
Deeppicar
Deep Learning Autonomous Car based on Raspberry Pi, SunFounder PiCar-V Kit, TensorFlow, and Google's EdgeTPU Co-Processor
Stars: ✭ 242 (-69.33%)
Mutual labels:  nvidia
Nvidia Sniper
🎯 Autonomously buy Nvidia Founders Edition GPUs as soon as they become available.
Stars: ✭ 193 (-75.54%)
Mutual labels:  nvidia
Relion
Image-processing software for cryo-electron microscopy
Stars: ✭ 219 (-72.24%)
Mutual labels:  nvidia
Jetson Nano Baseboard
Antmicro's open hardware baseboard for the NVIDIA Jetson Nano and Jetson Xavier NX
Stars: ✭ 209 (-73.51%)
Mutual labels:  nvidia
Gl ssao
optimized screen-space ambient occlusion, cache-aware hbao
Stars: ✭ 220 (-72.12%)
Mutual labels:  nvidia
Macos Egpu Cuda Guide
Set up CUDA for machine learning (and gaming) on macOS using a NVIDIA eGPU
Stars: ✭ 187 (-76.3%)
Mutual labels:  nvidia
nvidia-docker-bootstrap
For those times when nvidia-docker is not possible (like AWS ECS)
Stars: ✭ 19 (-97.59%)
Mutual labels:  nvidia
Jetson Containers
Machine Learning Containers for NVIDIA Jetson and JetPack-L4T
Stars: ✭ 223 (-71.74%)
Mutual labels:  nvidia
Nicehashquickminer
Super simple & easy Windows 10 cryptocurrency miner made by NiceHash.
Stars: ✭ 211 (-73.26%)
Mutual labels:  nvidia
Moonlight Common C
Core implementation of Nvidia's GameStream protocol
Stars: ✭ 218 (-72.37%)
Mutual labels:  nvidia
Nvidia Htop
A tool for enriching the output of nvidia-smi.
Stars: ✭ 213 (-73%)
Mutual labels:  nvidia
Nemosminer
NemosMiner multi algo profit switching NVIDIA miner
Stars: ✭ 224 (-71.61%)
Mutual labels:  nvidia
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (-74.4%)
Mutual labels:  nvidia
Plotoptix
Data visualisation in Python based on OptiX 7.2 ray tracing framework.
Stars: ✭ 252 (-68.06%)
Mutual labels:  nvidia
Smart Sketch
🖌 photorealistic drawings from simple sketches using NVIDIA's GauGAN
Stars: ✭ 195 (-75.29%)
Mutual labels:  nvidia
Genomeworks
SDK for GPU accelerated genome assembly and analysis
Stars: ✭ 215 (-72.75%)
Mutual labels:  nvidia
Jetson easy
🔩 Automatically script to setup and configure your NVIDIA Jetson [Nano, Xavier, TX2i, TX2, TX1, TK1] . This script run different modules to update, fix and patch the kernel, install ROS and other...
Stars: ✭ 219 (-72.24%)
Mutual labels:  nvidia
xnxpilot
Openpilot on Jetson Xavier NX
Stars: ✭ 81 (-89.73%)
Mutual labels:  nvidia
F1-demo
Real-time vehicle telematics analytics demo using OmniSci
Stars: ✭ 27 (-96.58%)
Mutual labels:  nvidia

nvidia-vaapi-driver

This is an VA-API implementation that uses NVDEC as a backend. This implementation is specifically designed to be used by Firefox for accelerated decode of web content, and may not operate correctly in other applications.

Table of contents

Codec Support

Hardware decoding only, encoding is not supported.

Codec Supported Comments
AV1 ✔️ Firefox 98+ is required.
H.264 ✔️
HEVC ✔️
VP8 ✔️
VP9 ✔️ Requires being compiled with gstreamer-codecparsers-1.0
MPEG-2 ✔️
VC-1 ✔️
MPEG-4 VA-API does not supply enough of the original bitstream to allow NVDEC to decode it.
JPEG This is unlikely to ever work, the two APIs are too different.

YUV444 is supported but requires:

  • >= Turing (20XX/16XX)
  • HEVC
  • Direct backend

To view which codecs your card is capable of decoding you can use the vainfo command with this driver installed, or visit the NVIDIA website here.

Installation

To install and use nvidia-vaapi-driver, follow the steps in installation and configuration. It is recommended to follow testing as well to verify hardware acceleration is working as intended.

Requirements

  • NVIDIA driver series 470 or 500+

Package manager

Distribution Package name
ArchAUR libva-nvidia-driver
ArchAUR nvidia-vaapi-driver-git
Debian,Ubuntu nvidia-vaapi-driverdebian ubuntu
Fedora, RHEL and derivates (Rocky, Alma, etc). nvidia-vaapi-driver

Feel free to add your distributions package in an issue/PR.

Building

You'll need meson, the gstreamer-plugins-bad library, and nv-codec-headers installed.

Package manager Packages Optional packages for additional codec support
pacman meson gst-plugins-bad ffnvcodec-headers
apt meson gstreamer1.0-plugins-bad libffmpeg-nvenc-dev libva-dev libgstreamer-plugins-bad1.0-dev
yum/dnf meson libva-devel gstreamer1-plugins-bad-freeworld nv-codec-headers gstreamer1-plugins-bad-free-devel

Then run the following commands:

meson setup build
meson install -C build

Removal

By default the driver installs itself as /usr/lib64/dri/nvidia_drv_video.so (this might be /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so on some distros). To uninstall the driver, simply remove this file. In addition, this file is usually symlinked to /usr/lib64/dri/vdpau_drv_video.so (or /usr/lib/x86_64-linux-gnu/dri/vdpau_drv_video.so) if the VDPAU to VA-API driver is installed, so this symlink will need to be restored for that driver to work normally again.

Configuration

IMPORTANT: The direct backend is currently required on NVIDIA driver series 525 due to a regression (see issue #126).

Kernel parameters

This library requires that the nvidia_drm kernel module is configured with the parameter nvidia-drm.modeset=1

Environment Variables

Environment variables used to control the behavior of this library.

Variable Purpose
NVD_LOG Used to control logging. 1 to log to stdout, anything else to append to the given file.
NVD_MAX_INSTANCES Controls the maximum concurrent instances of the driver will be allowed per-process. This option is only really useful for older GPUs with not much VRAM, especially with Firefox on video heavy websites.
NVD_BACKEND Controls which backend this library uses. Either egl (default), or direct. See direct backend for more details.

Firefox

To use the driver with firefox you will need at least Firefox 96, the following config options need to be set in the about:config page:

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.
widget.dmabuf.force-enabled true Required on NVIDIA 470 series drivers, and currently REQUIRED on 500+ drivers due to a Firefox change. Note that Firefox isn't coded to allow DMA-BUF support without GBM support, so it may not function completely correctly when it's forced on.

In addition the following environment variables need to be set. For permanent configuration /etc/environment may suffice.

Variable Value Reason
MOZ_DISABLE_RDD_SANDBOX 1 Disables the sandbox for the RDD process that the decoder runs in.
EGL_PLATFORM wayland Required on FF98+ when running on Wayland, due to a regression that has been introduced.
LIBVA_DRIVER_NAME nvidia For libva versions prior to 2.15, this forces libva to load the nvidia backend.
__EGL_VENDOR_LIBRARY_FILENAMES /usr/share/glvnd/egl_vendor.d/10_nvidia.json Required for the 470 driver series only. It overrides the list of drivers the glvnd library can use to prevent Firefox from using the MESA driver by mistake.

When libva is used it will log out some information, which can be excessive when Firefox initalises it multiple times per page. This logging can be suppressed by adding the following line to the /etc/libva.conf file:

LIBVA_MESSAGING_LEVEL=1

Chrome

Chrome is currently unsupported, and will not function.

MPV

Currently this only works with a build of MPV from git master.

There's no real reason to run it with mpv except for testing, as mpv already supports using nvdec directly. The test.sh script will run mpv with the file provided and various environment variables set to use the newly built driver

Direct Backend

The direct backend is a experimental backend that accesses the NVIDIA kernel driver directly, rather than using EGL to share the buffers. This allows us a greater degree of control over buffer allocation and freeing.

The direct backend has been tested on a variety of hardware from the Kepler to Lovelace generations, and seems to be working fine. If you find any compatibility issues, please leave a comment here.

Given this backend accesses the NVIDIA driver directly, via NVIDIA's unstable API, this module is likely to break often with new versions of the kernel driver. If you encounter issues using this backend raise an issue and including logs generated by NVD_LOG=1.

This backend uses headers files from the NVIDIA open-gpu-kernel-modules project. The extract_headers.sh script, along with the headers.in file list which files we need, and will copy them from a checked out version of the NVIDIA project to the nvidia-include directory. This is done to prevent everyone needing to checkout that project.

Testing

To verify that the driver is being used to decode video, you can use nvidia-settings or nvidia-smi.

  • nvidia-settings

    By selecting the relevant GPU on the left of the nvidia-settings window, it will show Video Engine Utilization on the right. While playing a video this value should be non-zero.

  • nvidia-smi

    Running nvidia-smi while decoding a video should show a Firefox process with C in the Type column. In addition nvidia-smi pmon will show the usage of the decode engine per-process, and nvidia-smi dmon will show the usage per-GPU.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].