So Firefox 102 just landed in nixpkgs, which contains the fix for VA-API with the RDD sandbox, and there is support for VA-API using the nvidia drivers by default with NixOS now - I’d really like to start rendering videos with my GPU, so I figured I’d give it a try.
From previous experimentation, I know about https://github.com/NixOS/nixpkgs/issues/157061 (which AIUI is fixed, and only basic config should be necessary at this point), I’ve set media.ffmpeg.vaapi.enabled
in my Firefox settings, and I’ve set LIBVA_DRIVER_NAME=nvidia
. I even have modesetting enabled:
tlater ~ $ lsmod | grep modeset
nvidia_modeset 1146880 7 nvidia_drm
nvidia 40828928 368 nvidia_uvm,nvidia_modeset
backlight 24576 2 drm,nvidia_modeset
vainfo
seems to confirm my configuration is correct:
tlater ~ $ NVD_LOG=1 nix shell nixpkgs#libva-utils -c vainfo
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
[12633-12633] ../src/vabackend.c:1634 __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 0x1a5a400
[12633-12633] ../src/export-buf.c: 171 findCudaDisplay Found 3 EGL devices
[12633-12633] ../src/export-buf.c: 175 findCudaDisplay Got EGL_CUDA_DEVICE_NV value '0' from device 0
[12633-12633] ../src/export-buf.c: 135 checkModesetParameter Checking device file: /dev/dri/renderD128
[12633-12633] ../src/export-buf.c: 210 initExporter Got EGLDisplay from CUDA device
[12633-12633] ../src/export-buf.c: 240 initExporter Driver doesn't support 16-bit surfaces
[12633-12633] ../src/export-buf.c: 95 reconnect Reconnecting to stream
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
<unknown profile> : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
[12633-12633] ../src/vabackend.c:1618 nvTerminate Terminating 0x1a5a400
[12633-12633] ../src/export-buf.c: 57 releaseExporter Releasing exporter, 0 outstanding frames
[12633-12633] ../src/export-buf.c: 74 releaseExporter Done releasing frames
Firefox also seems to confirm it’s working:
tlater ~ $ firefox
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
However, when I try a video I get spammed with errors:
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva error: /run/opengl-driver/lib/dri/nvidia_drv_video.so init failed
libva info: va_openDriver() returns 1
Is there anything I’m doing wrong? Is this working for anyone else?