Unable to build nix due to nvidia drivers due or kernel 6.10(?)

Well, I’m met with a new crossroads as 6.9 is now at the “end of life”:


[nprevail@nixos-joyy-black256GB:~]$ sudo nixos-rebuild switch --upgrade
[sudo] password for nprevail: 
unpacking channels...
building Nix...
building the system configuration...
error:
       … while calling the 'head' builtin

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: linux 6.9 was removed because it reached its end of life upstream

Any thoughts on what nvidia users can do if they’re unable to use the latest kernel?

Pick a longterm version from https://www.kernel.org/.

Easier said than done: I use NixOS on a fairly recent laptop that needs at least 6.7. What should I do now? Should I try the Nvidia Open driver or will I run into the same problem with it?

1 Like

For me, I have no issues with xanmod (6.10.4) and Nvidia (555.58.02) both proprietary and open.

As I remember, the problem was that the kernel was too new for the drivers, but seeing that 6.10 has been out for a while, I don’t think it’s a problem anymore.

1 Like

I know what you mean, I have some hardware that requires a minimum kernel version, but nvidia (depending on how quick they are on updates) effectively sets a maximum kernel version. If there’s no supported kernel version between those two version constraints, you’re SOL.

(That’s one reason I personally don’t touch nvidia, zfs, etc. if I can help it.)

With that being said, you might as well try 6.10 to confirm if that maximum constraint really exists. This post is a month old and fixes may easily have come through since then.

Stable still uses the 550.78 driver, so maybe you need to update that:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
  version = "555.58.02";
  sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
  sha256_aarch64 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY=";
  openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY=";
  settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
  persistencedSha256 = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
};

Nvidia anyway causes enough issues that I recommend overriding the NixOS package version to just about everyone - just make sure to stay up-to-date manually. Gamingonlinux’ nvidia category is pretty nice to point an RSS feed reader at to keep track of new drivers if you do this.

Maybe we should start an nvidia flake with accompanying docs to help work around all this stuff.

9 Likes

Perfect, thank you that worked! Where did you get all the hashes from? Just so I know where I can get them if a new version comes out.

Make them empty strings and nix tells you what they actually are :stuck_out_tongue:

2 Likes

I also saw your post on this earlier this morning, and it worked:

So, I guess “specific nvidia driver version” is the way to go until the update nvidia stable to 555.0+

How did you find this solution?

I would just maintain the driver version downstream at least until the LTS kernel catches up with your hardware, personally.

It was pretty obvious after the fourth time the latest kernel was incompatible with the current nvidia driver version on stable. I think I first started running a different nvidia version in 2022?

Using mkDriver to do this became possible towards the end of last year, I learned about it from one of the nvidia maintainers after I explained to someone here how to do this and they pointed out there’s a nicer way now.

I use xanmod not stable, zen or latest, over 6.10 its not work with error
also i see 550.78 won't compile on 6.10-rc1 due to GPL violations and removed follow_pfn() - #6 by SoftExpert - Linux - NVIDIA Developer Forums
maybe it can solve by using patch

Just update the driver to a version that supports 6.10, 550.78 is ancient by nvidia driver standards: Unable to build nix due to nvidia drivers due or kernel 6.10(?) - #18 by TLATER

Perhaps this would be my learning lesson about ‘mkDriver’: Since 560.35.03 released a few hours ago, how would one go about with inputting the following? Where can I find the following information, or find out if it’s available for NixOS?

version = 
  sha256_64bit = 
  sha256_aarch64 = 
  openSha256 =
  settingsSha256 =
  persistencedSha256 = 

reference: NVIDIA stable driver 560.35.03 released for Linux with Wayland fixes | GamingOnLinux

As @TLATER said before, you can either set these to an empty string, rebuild and it will give you the values, but you can also get this information directly from the PR: linuxPackages.nvidiaPackages.latest: 555.58.02 -> 560.35.03 by Kiskae · Pull Request #336334 · NixOS/nixpkgs · GitHub

Generally, you can get the hashes for all versions (stable, beta, …) from the nvidia-x11 package.

1 Like

Ah, you’re right… I actually didn’t understand what an “empty string” is, but I’ll try to look it up. I don’t want to bother folks any further, but I appreciate everyone’s input!

1 Like

Like this:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
  version = "560.35.03";
  sha256_64bit = "";
  sha256_aarch64 = "";
  openSha256 = "";
  settingsSha256 = "";
  persistencedSha256 = "";
};

"" is a string of zero characters, i.e., an empty string.

You can also use lib.fakeHash, but that’s unnecessary here.

2 Likes

Any idea what values work for 560 ? I managed to use @TLATER 's config for version 555 above, but could not get 560 to work :thinking:

Nor have I: nvidia: Update to 560.35.03 by TLATER · Pull Request #360 · TLATER/dotfiles · GitHub

The build dependencies changed, AIUI, so the update is less trivial now. I still need to sit down and figure it out sometime.

Couldn’t help but notice that some hashes are different from the ones in nixpkgs (which work fine for me).

$ diff nixpkgs.txt tlater.txt
3c3
< sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s=";
---
> sha256_aarch64 = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M=";
6c6
< persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs=";
---
> persistencedSha256 = "sha256-VWTJg/pluRYVVBDiJ+t2uhyodRuIFfHpzCZMte1krDM=";

Could this be the problem?

Hmm, that should result in the download failing, not a build failure. I’ll have to check what’s up.