Skip to content
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

Build failure: hardware.nvidia #338196

Closed
biscotty666 opened this issue Aug 29, 2024 · 3 comments
Closed

Build failure: hardware.nvidia #338196

biscotty666 opened this issue Aug 29, 2024 · 3 comments
Labels
0.kind: build failure A package fails to build

Comments

@biscotty666
Copy link

biscotty666 commented Aug 29, 2024

Steps To Reproduce

Steps to reproduce the behavior:

  1. Rebuild after update
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/d0e1602ddde669d5beb01aec49d71a51937ed7be' (2024-08-24)
  → 'github:nixos/nixpkgs/71e91c409d1e654808b2621f28a327acfdad8dc2' (2024-08-28)

Build log

error:
       … while calling the 'head' builtin

         at /nix/store/887hpp8a2i99n9jjwcvz6qkhhhqsvzkg-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/887hpp8a2i99n9jjwcvz6qkhhhqsvzkg-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `hardware.nvidia.open' is used but not defined.
┏━ 1 Errors:
 ⋮
┃
┃          1574|         || pred here (elemAt values 1) (head values) then
┃          1575|           head values
┃              |           ^
┃          1576|         else
┃
┃        … while evaluating the attribute 'value'
┃
┃          at /nix/store/887hpp8a2i99n9jjwcvz6qkhhhqsvzkg-source/lib/modules.nix:8…
┃
┃           820|     in warnDeprecation opt //
┃           821|       { value = addErrorContext "while evaluating the option `${s…
┃              |         ^
┃           822|         inherit (res.defsFinal') highestPrio;
┃
┃        (stack trace truncated; use '--show-trace' to show the full trace)
┃
┃        error: The option `hardware.nvidia.open' is used but not defined.log here if short otherwise a link to a gist

Additional context

Add any other context about the problem here.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.47, NixOS, 24.11 (Vicuna), 24.11.20240824.d0e1602`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/store/ia1zpg1s63v6b3vin3n7bxxjgcs51s2r-source`

But I am using flakes and following unstable.

{ config, lib, pkgs, ... }:
{

  hardware.graphics = {
    enable = true;
  };

  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {
    modesetting.enable = true;

    nvidiaSettings = true;

    prime = {
      sync.enable = true;
      intelBusId = "PCI:0:2:0";
      nvidiaBusId = "PCI:1:0:0";
    };

  };
}

Add a 👍 reaction to issues you find important.

@biscotty666 biscotty666 added the 0.kind: build failure A package fails to build label Aug 29, 2024
@BCNelson
Copy link

It was an intentional breaking change #337289 (comment)

@biscotty666
Copy link
Author

TY.

@lebensterben
Copy link
Contributor

To sum up, hardware.nvidia.open is non-optional and must be set now:

  • When true, use open source NVIDIA kernel module, this is now recommended by NVIDIA, but it doesn't work with older drivers.
  • When false, use proprietary kernel module. This is needed for people with older NVIDIA cards.

More information: https://developer.nvidia.com/blog/nvidia-transitions-fully-towards-open-source-gpu-kernel-modules/

getchoo added a commit to getchoo-contrib/nixpkgs that referenced this issue Sep 16, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

No branches or pull requests

3 participants