SimulaVR / Simula

Linux VR Desktop
MIT License
2.91k stars 87 forks source link

Nix build fails: line 729: /build/makeself.khG0YkK0/zstd: cannot execute: required file not found #192

Open micimize opened 1 year ago

micimize commented 1 year ago

It looks like the build fails due to some issue extracting the drivers

./result/bin/simula

building '/nix/store/jr8z5rmsmvwzpxff3kxm4y373c3n0591-impure-nvidia-version-file.drv'...
installing 'nixVulkanNvidia-530.30.02'
building '/nix/store/66sz1x97nvkf8akabmw9xhgzcff5j6f0-nvidia-530.30.02.drv'...
unpacking sources
Creating directory NVIDIA-Linux-x86_64-530.30.02
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 530.30.02/nix/store/8zpy6cffgk57wb8vnpyas6c9x21bixmj-NVIDIA-Linux-x86_64-530.30.02.run: line 729: /build/makeself.khG0YkK0/zstd: cannot execute: required file not found
/nix/store/8zpy6cffgk57wb8vnpyas6c9x21bixmj-NVIDIA-Linux-x86_64-530.30.02.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:
       … while calling the 'derivationStrict' builtin

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

       … while evaluating derivation 'nixVulkanNvidia-530.30.02'
         whose name attribute is located at /nix/store/hwis1dw4fzggwk2rdnajg4jirfhg84hx-nixpkgs-unstable/pkgs/stdenv/generic/make-derivation.nix:294:7

       … while evaluating attribute 'text' of derivation 'nixVulkanNvidia-530.30.02'

         at /nix/store/hwis1dw4fzggwk2rdnajg4jirfhg84hx-nixpkgs-unstable/pkgs/build-support/trivial-builders.nix:137:16:

          136|     runCommand name
          137|       { inherit text executable checkPhase meta;
             |                ^
          138|         passAsFile = [ "text" ];

       error: builder for '/nix/store/66sz1x97nvkf8akabmw9xhgzcff5j6f0-nvidia-530.30.02.drv' failed with exit code 2

Godot Engine v3.4.beta.custom_build - https://godotengine.org
ERROR: Condition "!fbc" is true. Returned: ERR_UNCONFIGURED
   at: initialize (platform/x11/context_gl_x11.cpp:154)
ERROR: Error initializing GLAD
   at: is_viable (drivers/gles3/rasterizer_gles3.cpp:141)
Delamare2112 commented 10 months ago

I am very much a Nix noob, so there is probably a better way of fixing this, but I was able to fix this on my system with the following patch:

diff --git a/utils/GetNixGL.sh b/utils/GetNixGL.sh
index 3d5ebb5..2030995 100755
--- a/utils/GetNixGL.sh
+++ b/utils/GetNixGL.sh
@@ -18,7 +18,8 @@ installNixGL() {

 installNixVulkanNvidia() {
     cd ${SIMULA_UTIL_ROOT}/..
-    NIXPKGS_ALLOW_UNFREE=1 nix-env -f ./submodules/godot/nixGLDefault.nix -iA nixVulkanNvidia >/dev/null
+    NIXPKGS_ALLOW_UNFREE=1 nix --extra-experimental-features flakes --extra-experimental-features nix-command run --impure --override-input nixpkgs nixpkgs/nixos-unstable github:guibou/nixGL
+    nix-env -iA nixgl.auto.nixVulkanNvidia
     cd -
 }

@@ -36,5 +37,5 @@ elif [ -z $NVIDIA_VERSION ]; then
 else
     . $HOME/.nix-profile/etc/profile.d/nix.sh
     installNixVulkanNvidia >/dev/null;
-    which nixVulkanNvidia
+    which nixVulkanNvidia-$NVIDIA_VERSION
 fi
TimVosch commented 8 months ago

The above diff didn't work for me, but figured the following out:

In ./submodules/godot/ update nixGL.nix and nixGLDefault.nix with the contents at https://raw.githubusercontent.com/nix-community/nixGL/main/nixGL.nix and https://raw.githubusercontent.com/nix-community/nixGL/main/default.nix respectively.

Update the ./utils/GetNixGL.sh file as such:

diff --git a/utils/GetNixGL.sh b/utils/GetNixGL.sh
index 3d5ebb5..52c2d7d 100755
--- a/utils/GetNixGL.sh
+++ b/utils/GetNixGL.sh
@@ -18,7 +18,7 @@ installNixGL() {

 installNixVulkanNvidia() {
     cd ${SIMULA_UTIL_ROOT}/..
-    NIXPKGS_ALLOW_UNFREE=1 nix-env -f ./submodules/godot/nixGLDefault.nix -iA nixVulkanNvidia >/dev/null
+    NIXPKGS_ALLOW_UNFREE=1 nix-env -f ./submodules/godot/nixGLDefault.nix -iA auto >/dev/null
     cd -
 }

@@ -36,5 +36,5 @@ elif [ -z $NVIDIA_VERSION ]; then
 else
     . $HOME/.nix-profile/etc/profile.d/nix.sh
     installNixVulkanNvidia >/dev/null;
-    which nixVulkanNvidia
+    which nixVulkanNvidia-$NVIDIA_VERSION
 fi
kimabjorkede commented 8 months ago

The above diff didn't work for me, but figured the following out:

In ./submodules/godot/ update nixGL.nix and nixGLDefault.nix with the contents at https://raw.githubusercontent.com/nix-community/nixGL/main/nixGL.nix and https://raw.githubusercontent.com/nix-community/nixGL/main/default.nix respectively.

Update the ./utils/GetNixGL.sh file as such:

diff --git a/utils/GetNixGL.sh b/utils/GetNixGL.sh
index 3d5ebb5..52c2d7d 100755
--- a/utils/GetNixGL.sh
+++ b/utils/GetNixGL.sh
@@ -18,7 +18,7 @@ installNixGL() {

 installNixVulkanNvidia() {
     cd ${SIMULA_UTIL_ROOT}/..
-    NIXPKGS_ALLOW_UNFREE=1 nix-env -f ./submodules/godot/nixGLDefault.nix -iA nixVulkanNvidia >/dev/null
+    NIXPKGS_ALLOW_UNFREE=1 nix-env -f ./submodules/godot/nixGLDefault.nix -iA auto >/dev/null
     cd -
 }

@@ -36,5 +36,5 @@ elif [ -z $NVIDIA_VERSION ]; then
 else
     . $HOME/.nix-profile/etc/profile.d/nix.sh
     installNixVulkanNvidia >/dev/null;
-    which nixVulkanNvidia
+    which nixVulkanNvidia-$NVIDIA_VERSION
 fi

Seems to be almost working.

image

TimVosch commented 8 months ago

@kimabjorkede Looks like that specific driver version is not available. Try upgrading the driver on your host system.

Also check here for versions available: https://download.nvidia.com/XFree86/Linux-x86_64/

But be warned, Simula most likely won't run - even if it compiles. The GLIBC dependency of your OpenXR Runtime will be too new for Simula, as Simula uses an almost 1,5 year old version.

kimabjorkede commented 8 months ago

I just got an nvidia driver that's in https://download.nvidia.com/XFree86/Linux-x86_64/, it seems to be able to continue longer, but it still ends up in an error:

x nvidia-settings.1.gz
source root is .
setting SOURCE_DATE_EPOCH to timestamp 1697746269 of file ./nvidia-bug-report.sh
patching sources
applying patch /nix/store/ig2sxnm2ckn2cbdd44k1gvrcfln5afqk-nvidia-470xx-fix-linux-6.4.patch
patching file nvidia-drm/nvidia-drm-drv.c
Hunk #2 FAILED at 874.
1 out of 2 hunks FAILED -- saving rejects to file nvidia-drm/nvidia-drm-drv.c.rej

error: builder for '/nix/store/c4pc36rljbw7mfqriyvkx8v8ps7bl7yg-nvidia-x11-535.129.03-nixGL.drv' failed with exit code 1
error: build of '/nix/store/c4pc36rljbw7mfqriyvkx8v8ps7bl7yg-nvidia-x11-535.129.03-nixGL.drv', '/nix/store/kfxzs159vgf5lsrzb422hky8gc9zpyqw-nixGLNvidiaBumblebee-535.129.03.drv' failed
Godot Engine v3.4.beta.custom_build - https://godotengine.org
ERROR: Condition "!fbc" is true. Returned: ERR_UNCONFIGURED
   at: initialize (platform/x11/context_gl_x11.cpp:154)
ERROR: Error initializing GLAD
   at: is_viable (drivers/gles3/rasterizer_gles3.cpp:141)
Gtk-Message: 13:30:55.949: Failed to load module "xapp-gtk3-module"
kimabjorkede commented 8 months ago

Using @Delamare2112 's patch it gives a shorter error message:

warning: not writing modified lock file of flake 'github:guibou/nixGL':
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/441dc5d512153039f19ef198e662e4f3dbb9fd65' (2022-08-15)
  → 'github:NixOS/nixpkgs/0cbe9f69c234a7700596e943bfae7ef27a31b735' (2023-10-29)
error: attribute 'nixgl' in selection path 'nixgl.auto.nixVulkanNvidia' not found
Godot Engine v3.4.beta.custom_build - https://godotengine.org
ERROR: Condition "!fbc" is true. Returned: ERR_UNCONFIGURED
   at: initialize (platform/x11/context_gl_x11.cpp:154)
ERROR: Error initializing GLAD
   at: is_viable (drivers/gles3/rasterizer_gles3.cpp:141)
Gtk-Message: 13:33:16.088: Failed to load module "xapp-gtk3-module"
TimVosch commented 8 months ago

@kimabjorkede Unfortunately, I won't be able to be much of help.

The Shorter error is shorter because it can't find the "nvidia driver flake", so it wont even try to compile. However, in both cases there is an xapp-gtk3-module error. It is either a consequence of the driver not being able to be installed, or it is a separate dependency missing.

I'd first try to solve the driver issue before focusing on the xapp-gtk3-module error.

One thing I notice is that it is trying to install Nvidia Bumblebee. This is usually for notebooks with both an integrated GPU and a dedicated GPU. You might try to bypass it to only use your dedicated GPU, but that might require changes to your OS setup and/or the flake.

Good luck!

kimabjorkede commented 8 months ago

I think I'll give up until someone properly fixes this.

It's a shame as Simula looks really cool!

TimVosch commented 8 months ago

@kimabjorkede IIRC the devs are mainly focusing on getting the headset hardware and fabrication worked out before continuing on the software. So I expect issues like these will be addressed sooner or later :)

hellkaim commented 4 months ago

Hi fellows.

The solution by [Delamare2112](https://github.com/Delamare2112) seems to work for me on current Arch.

Mean while, I am now bumping on:

building '/nix/store/73cv6s6kfz2j7cvaw1isw5m2cmzfbbir-user-environment.drv'...
/nix/store/7x7sfhml0ki360gl7zsxpgyx24jc3bb0-godot-3.2/bin/godot.x11.opt.debug.64: /nix/store/76l4v99sk83ylfwkz8wmwrm4s8h73rhd-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/m3i46laviz11sywkad3xylq0ikwzfs29-libglvnd-1.7.0/lib/libGLX.so.0)
/nix/store/7x7sfhml0ki360gl7zsxpgyx24jc3bb0-godot-3.2/bin/godot.x11.opt.debug.64: /nix/store/76l4v99sk83ylfwkz8wmwrm4s8h73rhd-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/m3i46laviz11sywkad3xylq0ikwzfs29-libglvnd-1.7.0/lib/libGLdispatch.so.0)
/nix/store/7x7sfhml0ki360gl7zsxpgyx24jc3bb0-godot-3.2/bin/godot.x11.opt.debug.64: /nix/store/76l4v99sk83ylfwkz8wmwrm4s8h73rhd-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/m3i46laviz11sywkad3xylq0ikwzfs29-libglvnd-1.7.0/lib/libEGL.so.1)

so have to figure out how to add correct glibC version.