Nvidia 565.77 won't work in Kernel 6.13(?)

I know this happens every time the Linux kernel has a major update, but I don’t think the latest nvidia drivers, 565.77 work with kernel 6.13. I get the following output:

  LD [M]  nvidia.o
/nix/store/vk4mlknqk9yjbqa68a7rvpfxfdw3rad7-binutils-2.43.1/bin/ld: cannot find ./nvidia/nv-kernel.o: No such file or directory
make[4]: *** [/nix/store/yams2a5wc4qg2i815affb5yh1pbwgf3k-linux-6.13-dev/lib/modules/6.13.0/source/scripts/Makefile.build:387: nvidia.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [/nix/store/yams2a5wc4qg2i815affb5yh1pbwgf3k-linux-6.13-dev/lib/modules/6.13.0/source/Makefile:1989: .] Error 2
make[2]: *** [/nix/store/yams2a5wc4qg2i815affb5yh1pbwgf3k-linux-6.13-dev/lib/modules/6.13.0/source/Makefile:251: __sub-make] Error 2
make[2]: Leaving directory '/build/NVIDIA-Linux-x86_64-565.77/kernel'
make[1]: *** [Makefile:251: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/yams2a5wc4qg2i815affb5yh1pbwgf3k-linux-6.13-dev/lib/modules/6.13.0/source'
make: *** [Makefile:115: modules] Error 2
error: builder for '/nix/store/0vjj1llfcgpliwbicvn0vkixqqa796ks-nvidia-x11-565.77-6.13.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/z9cvr1003mssqg1mc3g5728s9qpf82yr-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/582j49vbd20g3ri6p5ymp108a1myix8g-firmware.drv' failed to build
error: 1 dependencies of derivation '/nix/store/z48yqrd9xvf0k7gjjh077cdj5r8pqkdv-linux-6.13-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/87pa5azx553k50h6ayhlw36gr04nc0v3-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mhbw7q4k87mc0fn58vdr5r1dljcdfzqz-nixos-system-nixos-nvidia-gpu-24.11.713477.ae584d90cbd0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nkspwjj7yrghv1grrg89j4ky7fdifcgs-nixos-system-nixos-24.11.713477.ae584d90cbd0.drv' failed to build

Is there a version of nvidia drivers that’ll work for 6.13? Perhaps a beta version?
Feel free to share.

Hello
So if i remember correctly 565.77 is the newest version for the nvidia driver(beta).
You could try to use the latest/stable driver or you need to downgrade the Kernel until this issue is resolved. The same happened with Kernelversion 6.12. I just waited until the issue got fixed and upgraded then.

Hm, I’m not sure if that’s a beta driver. I was actually able to install it running:

package = config.boot.kernelPackages.nvidiaPackages.stable; # stable

I would assume Stable is the latest stable version; not beta.

I had to continue using kernel to 6.12.10 in order to use 565.77. Therefore:
boot.kernelPackages = pkgs.linuxPackages_6_12;

In the past, I’ve used a beta version of nvidia drivers, and it would allow me to continue using the latest kernel.

pretty sure 565.77 is beta (Latest New Feature Branch Version):

I have it installed with:

package = config.boot.kernelPackages.nvidiaPackages.beta;

And have the 565.77 version.
However regarding your problem it seems like there are some more problems regarding version 6.13 and building tree modules and drivers:

So maybe best to wait a bit until these issues are fixed

1 Like

It is not an unstable issue; it also happens in version 24.11. Something happens during the build process.

The problem is that the NVIDIA driver does not compile with kernel versions 6.12 or 6.13.

it compiles with kernel 6.12 but just not 6.13

I can second this as well.

I’m also on channel 24.11 Stable

It was mentioned in the github issues but you have a mitigation option
you can lock your kernel to 6.12 , boot.kernelPackages = pkgs.linuxPackages_6_12; that worked for me to build all my out of tree modules. there is something not quite right in the 6.13 package right now.

3 Likes

Workaround

    hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
      version = "570.86.16"; # use new 570 drivers
      sha256_64bit = "sha256-RWPqS7ZUJH9JEAWlfHLGdqrNlavhaR1xMyzs8lJhy9U=";
      openSha256 = "sha256-DuVNA63+pJ8IB7Tw2gM4HbwlOh1bcDg2AN2mbEU9VPE=";
      settingsSha256 = "sha256-9rtqh64TyhDF5fFAYiWl3oDHzKJqyOW3abpcf2iNRT8=";
      usePersistenced = false;
    };

Solution provided by fxzzi Build failure: nvidia-x11-565.77-6.13 · Issue #375730 · NixOS/nixpkgs · GitHub

2 Likes