nix-community / nixGL

A wrapper tool for nix OpenGL application [maintainer=@guibou]
677 stars 78 forks source link

Error while running nix-shell with nixGL on archlinux #127

Open jcelerier opened 1 year ago

jcelerier commented 1 year ago

I'm getting this when trying to step into nix:

$ nix-shell
building '/nix/store/08saqbyv5as3y9d5kib0bpyv7aiaqaa1-impure-nvidia-version-file.drv'...
these 3 derivations will be built:
  /nix/store/06jd6sjb0p2m8l2xfjaz8l05cqx6g2as-nvidia-x11-530.41.03-nixGL.drv
  /nix/store/4jiiwg3w5wxhj14mw6h6c9n165mlma25-nixGLNvidia-530.41.03.drv
  /nix/store/v3f80kddgv7yaph25vwgznmaspf29xfh-nixGL.drv
building '/nix/store/06jd6sjb0p2m8l2xfjaz8l05cqx6g2as-nvidia-x11-530.41.03-nixGL.drv'...
unpacking sources
Creating directory NVIDIA-Linux-x86_64-530.41.03
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 530.41.03/nix/store/di2va099dlad32771wznbk9pjl1b57pl-NVIDIA-Linux-x86_64-530.41.03.run: line 729: /build/makeself.rwMjXbJe/zstd: No such file or directory
/nix/store/di2va099dlad32771wznbk9pjl1b57pl-NVIDIA-Linux-x86_64-530.41.03.run: line 720: /dev/tty: No such device or address

Terminated
xz: (stdin): File format not recognized
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
error: builder for '/nix/store/06jd6sjb0p2m8l2xfjaz8l05cqx6g2as-nvidia-x11-530.41.03-nixGL.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/4jiiwg3w5wxhj14mw6h6c9n165mlma25-nixGLNvidia-530.41.03.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v3f80kddgv7yaph25vwgznmaspf29xfh-nixGL.drv' failed to build

my host nvidia driver is 530.41.03-1, nix 2.14-1

blurgyy commented 1 year ago

I also encountered this with nixGL c917918ab9ebeee27b0dd657263d3f57ba6bb8ad on Arch, after the 530.41.03 upgrade:

$ nix log /nix/store/0ylgpj1qa2dam32kk1wmbkhs090763q4-nvidia-x11-530.41.03-nixGL.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
tail: error writing 'standard output': Broken pipe
Creating directory NVIDIA-Linux-x86_64-530.41.03
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 530.41.03/nix/store/di2va099dlad32771wznbk9pjl1b57pl-NVIDIA-Linux-x86_64-530.41.03.run: line 729: /build/makeself.JnUYrn8b/zstd: No such file or directory
tail: error writing 'standard output': Broken pipe
/nix/store/di2va099dlad32771wznbk9pjl1b57pl-NVIDIA-Linux-x86_64-530.41.03.run: line 720: /dev/tty: No such device or address

Terminated
xz: (stdin): File format not recognized
tar: This does not look like a tar archive
tail: error writing 'standard output': Broken pipe
tar: Exiting with failure status due to previous errors
blurgyy commented 1 year ago

Turns out it's not a nixgl issue and has been fixed in nixpkgs: https://github.com/NixOS/nixpkgs/pull/222762

If anybody uses a flake-based environment like me, here's how I fixed this: I added a input inputs.nixpkgs-with-nvidia-driver-fix.url = "github:nixos/nixpkgs/pull/222762/head"; to flake.nix, and used the below config.packageOverrides to override the linuxPackages in my devShell:

# ...
let
  pkgs = import nixpkgs {
    inherit system;
    config = {
      allowUnfree = true;
      cudaSupport = true;
      packageOverrides = pkgs: {
        linuxPackages = (import inputs.nixpkgs-with-nvidia-driver-fix {}).linuxPackages;
      };
    };
    overlays = [
      inputs.nixgl.overlays.default
      jaxOverlays
    ];
  };
in
# ...

Reference: https://stackoverflow.com/a/54135089/13482274

FGiuliari commented 1 year ago

I had the same issues until yesterday, seems they pushed the PR and it is now fixed.

amfern commented 1 year ago

I am still the same issue, i am using ubuntu 22.04 with flakes.

sudo NIXPKGS_ALLOW_UNFREE=1 nix profile install --impure --show-trace github:guibou/nixGL#nixGLNvidia
error: builder for '/nix/store/xg6fkrij6pm4dkxghp6lnhlb5b4dk82g-nvidia-x11-530.41.03-nixGL.drv' failed with exit code 2;
       last 10 log lines:
       > unpacking sources
       > Creating directory NVIDIA-Linux-x86_64-530.41.03
       > Verifying archive integrity... OK
       > Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 530.41.03/nix/store/di2va099dlad32771wznbk9pjl1b57pl-NVIDIA-Linux-x86_64-530.41.03.run: line 729: /build/makeself.Q
FYQMTWS/zstd: No such file or directory
       > /nix/store/di2va099dlad32771wznbk9pjl1b57pl-NVIDIA-Linux-x86_64-530.41.03.run: line 720: /dev/tty: No such device or address
       >
       > Terminated
       > xz: (stdin): File format not recognized
       > tar: This does not look like a tar archive
       > tar: Exiting with failure status due to previous errors
       For full logs, run 'nix log /nix/store/xg6fkrij6pm4dkxghp6lnhlb5b4dk82g-nvidia-x11-530.41.03-nixGL.drv'.
error: 1 dependencies of derivation '/nix/store/cpx61md1wgh926qvljijalsyjlkny1nj-nixGLNvidia-530.41.03.drv' failed to build