I am getting a GPL-only symbol error when trying to upgrade from kernel 6.1.75 to 6.1.76 with the NVIDIA-Linux-x86_64-545.29.02 driver. I have tried with both open kernel mods and closed kernel mods.
I have my configuration listed on my gitlab at Daniel McLarty / NixOS Config · GitLab.
Here is the output of the failing install:
building the system configuration...
error: builder for '/nix/store/4n0fb6y3d1vyqbgnpflwm7q69s92dzn2-nvidia-x11-545.29.02-6.1.76.drv' failed with exit code 2;
last 10 log lines:
> LD [M] /build/NVIDIA-Linux-x86_64-545.29.02/kernel/nvidia-drm.o
> LD [M] /build/NVIDIA-Linux-x86_64-545.29.02/kernel/nvidia-peermem.o
> MODPOST /build/NVIDIA-Linux-x86_64-545.29.02/kernel/Module.symvers
> ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol '__rcu_read_lock'
> ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol '__rcu_read_unlock'
> make[3]: *** [/nix/store/kpwm0vhi68njzhcqfbym2jj4jp9h740x-linux-6.1.76-dev/lib/modules/6.1.76/source/scripts/Makefile.modpost:126: /build/NVIDIA-Linux-x86_64-545.29.02/kernel/Module.symvers] Error 1
> make[2]: *** [/nix/store/kpwm0vhi68njzhcqfbym2jj4jp9h740x-linux-6.1.76-dev/lib/modules/6.1.76/source/Makefile:1966: modpost] Error 2
> make[1]: *** [Makefile:238: __sub-make] Error 2
> make[1]: Leaving directory '/nix/store/kpwm0vhi68njzhcqfbym2jj4jp9h740x-linux-6.1.76-dev/lib/modules/6.1.76/source'
> make: *** [Makefile:82: modules] Error 2
For full logs, run 'nix log /nix/store/4n0fb6y3d1vyqbgnpflwm7q69s92dzn2-nvidia-x11-545.29.02-6.1.76.drv'.
error: 1 dependencies of derivation '/nix/store/bdz44ykppdk30f9z6783y31lw4z7lx8v-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/whn97fmkyalv62m9gycrs4l6i7lff8hr-firmware.drv' failed to build
error: 1 dependencies of derivation '/nix/store/d7zdnvg98zd9fnq0ljm7kdygqm0kyybr-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/m9dr76nzb2dw9nv3n0hq14wnsn49z1hm-nixos-system-danielpc-23.11.20240201.25e3d4c.drv' failed to build
Any help would be nice, my system will still boot but until I can build an image I cant update anything or install any new apps.
I hear on Gentoo you can just compile the kernel with a workaround, but I have no clue how you would do the same on NixOS and I dont feel like compiling a kernel for every update.
Ah, that’s probably the patch that broke the GPL condom, then. Yeah, nvidia are abusing the kernel license and the kernel developers didn’t want to potentially need to sue them, so they broke what nvidia was using to make their driver work.
Edit: No, unrelated change that just happens to break the interface nvidia were using. Their drivers need updating, but because this is backported to older kernel branches this is even hitting you on older kernels. Nvidia drivers just aren’t compatible with those Linux versions for the moment.
Looks like someone is already on adding the gentoo patch to NixOS, just have to wait for CI to finish:
I’d argue that shouldn’t be added though, we should wait for Nvidia to update their drivers and just bump their version. But hey, guess the patches are already in.
Looks like someone is already on adding the gentoo patch to NixOS, just have to wait for CI to finish
So If I wait I should be able to update, but right now because NVIDIA wont play nice I just have to wait for NixOS to apply a patch that is a workaround for NVIDIA’s shoddy workmanship.
Just the fact that they insist on maintaining a proprietary driver as a third party kernel module, instead of having a mesa driver. Which is reasonable enough if you don’t subscribe to FOSS ideology and don’t want to provide a mesa driver, as much as I disagree with the decision.
Best option is to buy AMD or intel in the future, then you can entirely avoid this mess.
Just the fact that they insist on maintaining a proprietary driver as a third party kernel module, instead of having a mesa driver.
But it wont build even with hardware.nvidia.open = true; and those are supposed to be able to use the GPL symbol right? Or maybe something is up with how I am defining it in my configs, but changing open from true to false does nothing.
Maybe even the open kernel mods rely on broken symbols?
Hm, yeah, odd. In theory I think the open driers should be able to depend on that symbol. Wonder if the NixOS package is missing something to mark it as GPL.
If I can read GitHub right, the patch should of been merged by now, but my update still is broken. Is it just taking a while or am I messing something up?
To avoid full rebuilds the nixos-* channels and branches are updated when hydra finishes evaluating and building the packageset. You can check https://nixpk.gs/pr-tracker.html?pr=286084 to see when it is available in the cache.
I have an app that I want to install and use but the build is failing because of this error. How can I do install/use the app without nvidia getting updated in the rebuild process?
I have a similar issue. I tried converting to using Flakes, and in the build process I was met with the same problem.
Since it was my first Flake build, I have nothing to convert back to. How can I do the initial build? Will I somehow have to build using an older Linux kernel? Or, is it the NVIDIA driver that I need to somehow downgrade? Or both?
It would be possible to get this specific package from unstable.
However in this case I don’t know where to define it.
Pointing hardware.nvidia.package to the unstable version of linuxKernel.packages.linux_6_1.nvidia_x11 didn’t work for me.
The alternative option is to pin the whole flake to a commit before it broke.
Yeah, if you’re using a flake, you can change the nixpkgs url to include the exact commit:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11?rev=14944a4d567c6679e6054b382cf7f309ae880f0c";
# Or if I misremember, maybe the branch is not allowed if you specify `rev`:
# nixpkgs.url = "github:NixOS/nixpkgs?rev=14944a4d567c6679e6054b382cf7f309ae880f0c";
};
}
That commit is the one that changed to the 6.1.74 kernel version, which is 2 weeks out of date.
You’ll need to remove the rev bit manually later if you want to actually update again. Though frankly, at this point it will likely only take a few hours before hydra finishes, so it might be worth just waiting an evening.
That will require building the kernel, by the way, until hydra publishes a binary, whereas the workaround of sticking to an older commit means you don’t have to do that.
I just applied the @Brisingr05 's workaround to my own configs and it definitely did not rebuild the full kernel. So i guess hydra already has binaries for that.