I am encountering GPL-incompatible module * uses GPL-only symbol
errors when building nvidia-x11-570.153.02-6.15
:
> nvidia.o: warning: objtool: _nv045909rm+0x77: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv045853rm+0x7f: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035412rm+0x3e: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035411rm+0x27: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035415rm+0x37: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035414rm+0x24: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035413rm+0xca: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035416rm+0x193: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv035418rm+0x17f: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv013509rm+0x5d: 'naked' return found in MITIGATION_RETHUNK build
┃ > nvidia.o: warning: objtool: _nv046215rm+0x12f: 'naked' return found in MITIGATION_RETHUNK build
┃ > MODPOST Module.symvers
┃ > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia.o
┃ > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-uvm.o
┃ > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-modeset.o
┃ > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-drm.o
┃ > ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol '__vma_start_write'
┃ > ERROR: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol '__vma_start_write'
┃ > make[4]: *** [/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source/scripts/Makefile.modpost:147: Module.symvers] Error 1
┃ > make[3]: *** [/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source/Makefile:1953: modpost] Error 2
┃ > make[2]: *** [/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source/Makefile:248: __sub-make] Error 2
┃ > make[2]: Leaving directory '/build/NVIDIA-Linux-x86_64-570.153.02/kernel'
┃ > make[1]: *** [Makefile:248: __sub-make] Error 2
┃ > make[1]: Leaving directory '/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source'
┃ > make: *** [Makefile:115: modules] Error 2
Below is my relevant configuration:
config = lib.mkIf config.nvidiaEnable {
environment.systemPackages = with pkgs; [
egl-wayland
nvitop
];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
"nvidia-drm.modeset=1"
"nvidia-drm.fbdev=1"
];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
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+
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.latest;
};
nixpkgs = {
config = {
allowUnfree = true;
pulseaudio = true;
nvidia.acceptLicense = true;
# packageOverrides = pkgs: { inherit (pkgs) linuxPackages_latest nvidia_x11; };
};
};
services.xserver.videoDrivers = [ "nvidia" ];
I have set boot.kernelPackages = pkgs.linuxPackages_6_14;
for now, which builds correctly.