Error when compiling NVIDIA drivers: 'struct drm_driver' has no member named 'dumb_destroy'

I am running a GTX 1650. I don’t know what other info might be worth giving for something like this, it feels like a nixpkg thing but I’m not sure.
There’s this patch that should hopefully fix the issue, but I have no idea on how to apply it

Here we go again! This usually happens when you’re using linux_latest on NixOS stable.

There is a big (somewhat unresolved) discussion on the topic here: Aggressive Kernel removal on EOL in NixOS - #28 by clefru

In a nutshell however, the basic problem is that not all kernels are compatible with all nvidia drivers, becauae it’s an out-of-tree module.

Typically we don’t apply the support patches downstream, because by the time it becomes a problem for us, nvidia have already updated their driver, and we end up just updating the package. This usually happens quite quickly on NixOS unstable, but becauae of NixOS stable’s stability requirements, it usually lags behind a bit until someone stumbles across this (am on holiday atm, so missed this one :p).

So looks like it happened again. The driver is on version 535.86.05-6.4.4 on unstable, but on version 530.41.03-6.4.4 on stable. Chances are the newer driver already supports the new linux version.

In practice, this probably means someone will have to backport the driver package. This is where it gets problematic.


For the “correct” fix…

Despite watching this exact thing happen some 6 times now, I still don’t know if simply backporting is appropriate, or if linux_latest is effectively a forbidden package if you use out-of-tree modules.

I’ve seen the update pass review 4 times, and get stuck until irrelevance twice because of stability concerns. I believe we need some actual process around this, but I’m not sure where to start discussion on such a thing.

It appears that we have an actual maintainer for that package now, but he doesn’t have a discourse handle - I guess we should raise an issue on GitHub, but I don’t think it would be the first time this topic has been floated there.

Should I make an RFC? How do I even start that?


For the quick 'n dirty fix…

Just use NixOS unstable until the driver is updated on stable, don’t use linux_latest, or switch to using the linux packages from NixOS unstable while keeping the rest of the system on stable.

All of the above have subtly different issues, but between them there should be an option that’s ok enough on a desktop machine for now.

Thanks a lot for the detailed explanation! While I was reading it, I was waiting for my rebuild to finish, this time using the non-oss kernel modules for nvidia, and that seems to have made the issue go away. Now I’m in kernel 6.4.1-zen1, and driver 530.41.03.
I think I’ve also found an issue with my config, system.autoUpgrade.channel is set to https://nixos.org/channels/nixos-unstable, while my system.stateVersion is 23.05. I think this was an accident, and I don’t know if I actually intended to have this as it is

Ah, right. For the record, I don’t believe they’re ready to use as daily drivers yet. But good to know that those are yet another row in the failure matrix.

To (probably) quote your config, have you read the comment? See here: NixOS Search

Admittedly, this is a bit hard to understand if you don’t think about compatibility a lot, but in a nutshell, you’re never supposed to change system.stateVersion. So there should be no problem with your config.