-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/nvidia: assert open
option is manually set on drivers >= 560
#339025
nixos/nvidia: assert open
option is manually set on drivers >= 560
#339025
Conversation
2d2b086
to
bff72e6
Compare
I think there are some implications to this change that need to be considered. Nvidia does not recommend and does not support (?) GPUs prior to Turing with the open drivers. This change might cause the GPU to stop working for users with an older Nvidia GPU. |
What part of this change exactly? No defaults are being set here; it's only explicitly documenting the requirement of setting this option, as introduced in the above PR. The only change will be the error message when this option isn't set |
I've not been following too closely the history of this module but it seems this change now sets a default value to the |
No, there is an assertion that tests |
{ | ||
assertion = cfg.open != null; | ||
message = "`hardware.nvidia.open` must be defined when using driver versions >= 560."; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it here and not where the other assertions are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the open modules support the datacenter drivers as well, so putting this behind the nvidiaEnabled
conditional (which only checks if services.xserver.videoDrivers
includes "nvidia"
) with some of the other assertions could cause this to not work in the event of only hardware.nvidia.datacenter.enable
being set
It could also fixed by allowing to define custom message for such options. #338362 improved message, but it is still bad because it isn't custom. @SuperSandro2000 |
bff72e6
to
17c8832
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Looks good |
This requirement was introduced in NixOS#337289 as a way to make sure users "explicitly pick which version of the driver they want since nvidia recommends the open one, but that is incompatible with older drivers". This is reasonable, however the user isn't informed in any real way aside from the upcoming release notes This has caused a [good](NixOS#337289 (comment)) [amount](NixOS#337289 (comment)) [of](NixOS#338196) [confusion](NixOS/nixos-hardware#1092) amongst users. By introducing this assertion and using a new `useOpenModules` local variable, we can have the same behavior but display a proper error message to hopefully clear things up until we can safely make this a default
17c8832
to
43764ae
Compare
Description of changes
This requirement was introduced in #337289 as a way to make sure users "explicitly pick which version of the driver they want since nvidia recommends the open one, but that is incompatible with older drivers". This is reasonable, however the user isn't informed in any real way aside from the upcoming release notes
This has caused a good amount of confusion amongst users. By introducing this assertion and using a new
useOpenModules
local variable, we can have the same behavior but display a proper error message to hopefully clear things up until we can safely make this a default#338362 was also mentioned as an alternative to this here, however given our special case of it only needing to be set sometimes, I believe giving this message explicitly is a lot more user friendly
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.