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

nvidia proprietary legacy driver 304 fails to compile #33395

Closed
fuzzy-id opened this issue Jan 3, 2018 · 5 comments
Closed

nvidia proprietary legacy driver 304 fails to compile #33395

fuzzy-id opened this issue Jan 3, 2018 · 5 comments

Comments

@fuzzy-id
Copy link
Contributor

fuzzy-id commented Jan 3, 2018

Issue description

nixos-rebuild switch fails when setting services.xserver.videoDrivers = [ "nvidiaLegacy304" ]:

   CC           common-utils/nvgetopt.c
   CC           common-utils/common-utils.c
/nix/store/hqi64wjn83nw4mnf9a5z9r4vmpl72j3r-bash-4.4-p12/bin/bash: hostname: command not found
   CC           _out/Linux_x86_64/g_stamp.c
   LINK         _out/Linux_x86_64/nvidia-settings
/nix/store/zi17ydzr9x1kqjcpfjr93iwg1frpmv8s-binutils-2.28.1/bin/ld: i386 architecture of input file `libXNVCtrl/libXNVCtrl.a(NVCtrl.o)' is incompatible with i386:x86-64 output
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:161: _out/Linux_x86_64/nvidia-settings] Error 1
make[1]: Leaving directory '/tmp/nix-build-nvidia-settings-304.137.drv-0/nvidia-settings-304.137/src'
make: *** [Makefile:23: all] Error 2
builder for ‘/nix/store/g5l68b50xj592r15psdl0fmnbqdgw4py-nvidia-settings-304.137.drv’ failed with exit code 2

Steps to reproduce

Set services.xserver.videoDrivers as described and do a rebuild.

Technical details

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

  • system: "x86_64-linux"
  • host os: Linux 4.14.10, NixOS, 17.09.2594.af6aacddc18 (Hummingbird)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-17.09.2594.af6aacddc18"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
# lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation G72M [GeForce Go 7400] (rev a1)

Note: I tried both not having boot.kernelPackages set and setting it to pkgs.linuxPackages_latest.

@vcunat
Copy link
Member

vcunat commented Jan 3, 2018

It's not about the driver proper but the settings app linuxPackages.nvidia_x11_legacy304.settings. I've seen the problem appear with some minor update of 304, assuming it's a mistake in upstream tarball, but I don't really know. Unstable/master is affected the same way.

@vcunat
Copy link
Member

vcunat commented Jan 3, 2018

It might be possible to hack around it locally by using a 32-bit settings app (or by dropping it).

diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix
index 50c085dd7ee..b8013ba562c 100644
--- a/nixos/modules/hardware/video/nvidia.nix
+++ b/nixos/modules/hardware/video/nvidia.nix
@@ -62,7 +62,7 @@ in
     hardware.opengl.package = nvidiaPackage nvidia_x11 pkgs;
     hardware.opengl.package32 = nvidiaPackage nvidia_libs32 pkgs_i686;
 
-    environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
+    environment.systemPackages = [ nvidia_x11.bin pkgs_i686.nvidia_x11.settings ]
       ++ lib.filter (p: p != null) [ nvidia_x11.persistenced ];
 
     boot.extraModulePackages = [ nvidia_x11.bin ];

@lukateras
Copy link
Member

lukateras commented Jan 4, 2018

Out of curiosity, I have never had an NVidia card, what is there to configure?

At least superficially, pkgs_i686 looks bad due to closure size. Most NVidia owners are probably going to play 32-bit games, but there is OpenCL, artificial networks and bitcoin mining.

@vcunat
Copy link
Member

vcunat commented Jan 4, 2018

I imagine some people won't use it: switching outputs/resolution (but DE often provides that), power management, some OpenGL settings...

abbradar pushed a commit that referenced this issue Mar 27, 2018
Fixes #37768. Fixes #33395. Closes #37866.

abbradar: don't fix settings in a NixOS module.

(cherry picked from commit f396dd1)
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

4 participants
@fuzzy-id @lukateras @vcunat and others