-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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: various fixes #337289
nixos/nvidia: various fixes #337289
Conversation
d9dc6df
to
ef3b6ad
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.
Overall LGTM, one question is: do cfg.gsp.enable
require additional kernel parameters on non-open drivers?
Nope, per #313440:
|
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.
Tested evaluating various permutations of the config.
Is it possible that this is causing breakage, by removing the default value for I'm seeing
(See Re-adding that makes the error go away: --- a/nixos/modules/hardware/video/nvidia.nix
+++ b/nixos/modules/hardware/video/nvidia.nix
@@ -256,6 +256,7 @@ in
open = lib.mkOption {
example = true;
+ default = false;
description = "Whether to enable the open source NVIDIA kernel module.";
type = lib.types.bool;
defaultText = lib.literalExpression '' Was removing the default intentional? If not, I'll do a PR. (For now, I'll just set |
Yes, that breakage was intentional. Users need to explicitly pick which version of the driver they want since nvidia recommends the open one, but that is incompatible with older drivers. (16xx and earlier if I recall) |
Heh, I guess I expected a nicer error message. Anyway, I quickly found it in the release notes so maybe that's good enough. |
Given that proprietary drivers will go away some time, wouldn't it better to set default value of config.nvidia.open = mkDefault (config.system.stateVersion > "24.XX" && config.nvidia.package.preferOpen); |
I think I´d prefer the build failure over introducing stateVersion switches for this. Doing a new installation doesn't mean that your PC is new. |
That's why I propose to add |
Found this because of the option used but not defined error, would've preferred if it had a nicer message (like such breaking changes often do), something like "blah-blah, nvidia opensourced driver, for newer cards <the condition of 'newer'>, you'd want to set this new mandatory option to true" instead of (as it also sometimes happens) searching the nixos github for the context - could've prevented a couple of issues already created for this |
This fixes error induced intentionally, see NixOS/nixpkgs#337289 (comment) Signed-off-by: Ayoub Nasr <[email protected]>
open = lib.mkOption { | ||
example = true; | ||
description = "Whether to enable the open source NVIDIA kernel module."; | ||
type = lib.types.bool; |
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.
Since this affect quite a few people, we might want to introduce some guiding message here. If we also accept "unset" here, then an assertion could reproduce the changelog above.
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.
You can see how people will get confused here: NixOS/nixos-hardware#1092 (comment)
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.
If we also accept "unset" here, then an assertion could reproduce the changelog above.
That's the original version of this pr, accepting null. But then we would have to cast nullOr types.bool
to types.bool
on every place referencing cfg.open
, or adding a pretty ugly isOpen
indirection. I would rather prefer improving the error message for all mandatory options as in #338362
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.
Since this affect quite a few people, we might want to introduce some guiding message here. If we also accept "unset" here, then an assertion could reproduce the changelog above.
Yep, just helped someone that updated their flake and got this issue. Would love to see a PR to make this message cleaner, at least for the short term.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
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
Description of changes
Cleaning up my backlog
libnvidia-pkcs11.so
-libnvidia-pkcs11.so
missing RPATH entry forlibcrypto.so.1.1
#273064Things 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.