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

nixGL fails with assertion error on nvidia #154

Closed
tehmatt opened this issue Jan 11, 2024 · 5 comments
Closed

nixGL fails with assertion error on nvidia #154

tehmatt opened this issue Jan 11, 2024 · 5 comments

Comments

@tehmatt
Copy link

tehmatt commented Jan 11, 2024

I'm using nixGL@HEAD and nixpkgs-unstable@HEAD with home-manager. Running home-manager switch fails with the assertion assert useSettings -> !libsOnly;.

A recent PR (NixOS/nixpkgs#278915) looks like it caused this. My uninformed guess is that nixGL should be explicitly setting useSettings to false near

libsOnly = true;
.

Raw stack-trace:

error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/g16z4fs1mrbkxc4x6wm8xbrh13nc7aw4-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/g16z4fs1mrbkxc4x6wm8xbrh13nc7aw4-source/pkgs/build-support/trivial-builders/default.nix:98:16:

           97|         enableParallelBuilding = true;
           98|         inherit buildCommand name;
             |                ^
           99|         passAsFile = [ "buildCommand" ]

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

       error: assertion '(useSettings -> (! libsOnly))' failed

       at /nix/store/g16z4fs1mrbkxc4x6wm8xbrh13nc7aw4-source/pkgs/os-specific/linux/nvidia-x11/generic.nix:61:1:

           60|
           61| assert useSettings -> !libsOnly;
             | ^
           62| assert !libsOnly -> kernel != null;
@andreaswolf
Copy link

@tehmatt FYI I just tested your approach locally and it does not work:

error: anonymous function at /nix/store/4g5j0mzm3razs9gxv9ijnaw5swvpfjgl-nixpkgs-src/pkgs/os-specific/linux/nvidia-x11/generic.nix:30:1 called with unexpected argument 'useSettings'

AFAICS the problem is that useSettings is part of the "outer" function in https://github.com/NixOS/nixpkgs/edit/master/pkgs/os-specific/linux/nvidia-x11/generic.nix, while we're calling the "inner" function in that file in nixGL.nix.

@CleverCompiler
Copy link

CleverCompiler commented Jan 17, 2024

I'm getting the same error on my xps-9650. I had to remove the Nvidia driver to rebuild.

trofi added a commit to trofi/nixpkgs that referenced this issue Jan 25, 2024
…n `libsOnly`"

THe change caused nixGL instantiation failures:

- nix-community/nixGL#157
- nix-community/nixGL#154

I missed the fact that there is no easy way to oberride `useSettings` as
it's an internal argument as ollosed to `useLibs`.

Instead of fixing it let's revert it back and try again later.

This reverts commit 9c51fb0.
@khlopkov
Copy link

khlopkov commented Jan 27, 2024

I'm getting the same error since yesterday.
Seems it been reverted in nixpkgs:master, however nix-channel --update && nix-env -u does not help for me.
Both nix-env -iA nixgl.auto.nixGLDefault and home-manager switch shows the same error.

My nix-channel --list is:

home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixgl https://github.com/guibou/nixGL/archive/main.tar.gz

UPD:

Fixed that by explicitly adding nixpkgs-unstable channel. Works fine with the following channels:

home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixgl https://github.com/guibou/nixGL/archive/main.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

Also works with the following flake inputs:

{
  ...
  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixgl.url = "github:guibou/nixGL"; 
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  ...
}

@tehmatt
Copy link
Author

tehmatt commented Jan 28, 2024

Fixed upstream.

@tehmatt tehmatt closed this as completed Jan 28, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/home-manager-selective-update-of-packages-possible/39199/1

khlopkov added a commit to khlopkov/dotfiles that referenced this issue Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants