I’m running Nixos-stable.
I currently have my nvidia GPU configured with the following configuration that I got from Nvidia - NixOS Wiki
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
I’ve followed this configuration in the past, and it worked without any issues. But for some reason now, when I run:
sudo nixos-rebuild switch
I’m met with the following error.
2452 | long get_user_pages(unsigned long start, unsigned long nr_pages,
| ^~~~~~~~~~~~~~
make[4]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/scripts/Makefile.build:243: /build/kernel/nvidia/nv-i2c.o] Error 1
make[4]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/scripts/Makefile.build:243: /build/kernel/nvidia/nv-dma.o] Error 1
make[4]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/scripts/Makefile.build:243: /build/kernel/nvidia/nv.o] Error 1
make[4]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/scripts/Makefile.build:243: /build/kernel/nvidia/nv-acpi.o] Error 1
make[4]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/scripts/Makefile.build:243: /build/kernel/nvidia/nv-dmabuf.o] Error 1
make[3]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/Makefile:1913: /build/kernel] Error 2
make[2]: *** [/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source/Makefile:234: __sub-make] Error 2
make[2]: Leaving directory '/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/build'
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/xc40qp3lkvh5yxvjb16r1pxsbn80m9rd-linux-6.6-dev/lib/modules/6.6.0/source'
make: *** [Makefile:82: modules] Error 2
error: builder for '/nix/store/vkv3qv5wcps5gdhgbw69a25my9q7hhdg-nvidia-x11-525.47.34-6.6.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/wvrc205n5i8sm68qs3s7h67lp2y2ym50-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0bc0h9szwfg7vpdx6cfbw7q1wsy9lzaw-linux-6.6-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/h9dcxpqvlcihi377q04l0sl419kk870j-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ncaas9kasragqcfgyn0033i3851iilq8-nixos-system-nixos-Razer_Blade14_2015-23.05.4738.41de143fda10.drv' failed to build
I’m not sure what caused this error as I’ve had no issues with this nvidia config in the past.