NVIDIA 4070 Super requires a specific driver

I am a relatively new user, so my terminology might be a bit off.

How can I set up configuration.nix to pull in a specific driver for a 4070 Super?

I’m trying to set this variable:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.foobar

Where “foobar” can be something like “production” or “stable”.

From my testing, “production” is 535.129.03 and “stable” is 545.29.02.

I think I need 550.40.07 for my card to work.

FWIW, I have all the other necessary NVIDIA-specific configuration.nix stuff set up. I can get Xorg to (kinda) work with the drivers I have tested so far, but it isn’t running properly.

I am willing to provide whatever information is needed to fix this, and I am willing to learn.


I have been trying to fix this since my original post.

Once of the biggest problems I had was the “viewport” scaled “outside” of my display.

After a bunch of experimenting and research, I figured out that my display was the problem. (Note: This never happened with my previous AMD 6800XT card.)

So the solution was this: https://www.nvidia.com/content/Control-Panel-Help/vLatest/en-us/mergedProjects/nvdsp/Resizing_your_desktop_reference.htm

Specifically, to turn on “Just Scan” on my display.

I still have other problems with this card but at least I can read the screen now.

So, you can in theory do this. But it’s probably best to fully explain why this is so hard and why nobody in their right mind should buy nvidia GPUs when they intend to use a Linux system (no offense, I’ve known this for over a decade and still repeated that mistake just a few years ago).

The nvidia driver is a third-party kernel module. What this means is that it’s a bit of code that is not part of the Linux kernel, but prepared in such a way that it is loaded into the Linux kernel as foreign code at boot time.

This means that it is not tied to the Linux release schedule, and the kernel is developed entirely without care for what happens to the nvidia driver. It could not be made to care even if that was desired, the nvidia driver makes effectively arbitrary changes to the kernel. Even more so because the nvidia driver is proprietary, and has a habit of borderline-infringing on kernel copyright (though admittedly, there’s also an open kernel module now, which is a tiny step in the right direction).

These kinds of issues don’t happen at all with in-kernel drivers, like the official AMD and intel drivers, as well as nouveau (the driver for nvidia cards developed by third party FOSS developers, who have historically been almost unable to get power management - and therefore anything more than the bare minimum rendering capability - to work; this is currently improving a bit).

Linux distributions end up having to pick up the pieces of this mismatch. After all, the average user would not be able to pick versions of the Linux kernel and nvidia driver that work together, let alone compile them and get them prepared to actually run. Nor should they be expected to, doing so would be incredibly tedious.

Nvidia doesn’t particularly care, of course, distro maintainers effectively work for free for them to make their hardware usable. Without distro maintainers, it’s unlikely anyone would have cared about Linux for use with their GPUs in the first place, so they don’t have much leverage.

What does this mean for you in practice? Well, the NixOS maintainers need to be careful to make sure that a specific version of Linux works with a specific version of the nvidia driver. There aren’t many such maintainers. As a result, updates are far from instant, especially on the stable channels, because nvidia also doesn’t have any clear stability guarantees for updates.

The build system for the nvidia driver version is also quite complex. As such, it’s not trivial to find the current nvidia driver version on search.nixos.org. I typically just look at the package definitions for my current nixpkgs branch.

This is the current beta definition for nixos-23.11 (stable): https://github.com/NixOS/nixpkgs/blob/6832d0d99649db3d65a0e15fa51471537b2c56a6/pkgs/os-specific/linux/nvidia-x11/default.nix#L59
And this is the one for nixos-unstable: https://github.com/NixOS/nixpkgs/blob/f8e2ebd66d097614d51a56a755450d4ae1632df1/pkgs/os-specific/linux/nvidia-x11/default.nix#L59

Note that the discourse bot will automatically change those links to be permalinks, if you want to see up-to-date files in the future you will need to manually select the correct branch.

As you see, nixos-unstable currently has the version of the driver you’re looking for. So switching to unstable and using the beta driver will give you what you want.

You can in also override the package version as you see fit. I often do this because - in addition to being horrible to package and work with - nvidia’s drivers are also often very buggy, especially if you use wayland. In simple cases, that’d look something like this:

hardware.nvidia = {
  package = config.boot.kernelPackages.nvidiaPackages.beta.overrideAttrs (old: let
    version = "550.40.07";
  in {
    src = pkgs.fetchurl {
      url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}.run";
      sha256 = "";

YMMV though, as the actual build instructions might not work with any old nvidia driver version.

Hope that wasn’t too much of an information dump, and sorry for the bad news. I should start an nvidia-on-NixOS support group.


Thank you for the very detailed reply.

I was able to get the beta driver installed after switching to the unstable channel.

The fact that I wasn’t able to search package versions via NixOS Search is kinda weird, but at least I know now to look deeper.

Now that I have that “solved” I put the AMD card back into service. I don’t really need the 4070 Super so I’ll just sell it.

The good part of this journey is your reply is now “findable” so future people with this problem won’t need to waste as much time as I did.


I’d like to add that we’ve added nvidiaPackages.mkDriver as an escape hatch to get a different driver than what we package normally. This allows you to pin the driver to a specific version by copying the attributes from nixpkgs.

You will need to figure out any required patching to get it working yourself though.

1 Like