They should be preferred these days, so not using them would be the strange decision.
That said, all those packages, even if properly configured, probably interfere with each other. Most of them are for intel anyway. If you installed them with nix-env
, please remove them (and don’t use nix-env
on NixOS anyway). It doesn’t look like this ever could have worked to begin with to me.
Your config should contain exactly this:
hardware.opengl.extraPackages = [
pkgs.nvidia-vaapi-driver
];
environment.variables = {
NVD_BACKEND = "direct";
LIBVA_DRIVER_NAME = "nvidia";
};
Of course, for wayland support in general you still need these variables: dotfiles/nixos-modules/nvidia/default.nix at 561931560d2c12e81f139ef8c681e6d99fc6c54e · TLATER/dotfiles · GitHub
Note that VA-API on Nvidia is currently very limited. With some additional settings you can get it to work on Firefox, but e.g. Chrome cannot use it.
This is what I add for Firefox support:
environment.variables.MOZ_DISABLE_RDD_SANDBOX = "1";
programs.firefox.preferences = {
"media.ffmpeg.vaapi.enabled" = true;
"media.rdd-ffmpeg.enabled" = true;
"media.av1.enabled" = false; # Won't work on the 2060
"gfx.x11-egl.force-enabled" = true;
"widget.dmabuf.force-enabled" = true;
};
Disabling the RDD sandbox is required, but note that this means that the rendering thread escapes the sandbox. If some crafty website manages to find a way to escape that with just WebGL & co., this significantly reduces your browser’s security.
This requires programs.firefox.enable
to function as well, so make sure you install that with the option and not home-manager
or nix-env