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

nvidiaLegacy340 broken on 18.09 with Linux 4.19.2 #50707

Closed
florianjacob opened this issue Nov 19, 2018 · 2 comments · Fixed by #50841
Closed

nvidiaLegacy340 broken on 18.09 with Linux 4.19.2 #50707

florianjacob opened this issue Nov 19, 2018 · 2 comments · Fixed by #50841

Comments

@florianjacob
Copy link
Contributor

Issue description

Our current legacy nvidia driver of the 340 branch does not work with kernel version 4.19.2:

[…]
/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/source/include/linux/rtc.h: In function 'rtc_tv_nsec_ok':
/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/source/include/linux/rtc.h:245:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (to_set->tv_nsec < TIME_SET_NSEC_FUZZ) {
                      ^
/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/source/include/linux/rtc.h:250:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (to_set->tv_nsec > NSEC_PER_SEC - TIME_SET_NSEC_FUZZ) {
                      ^
/build/kernel/nv.c: In function 'nv_start_rc_timer':
/build/kernel/nv.c:2407:5: error: implicit declaration of function 'init_timer'; did you mean 'init_timers'? [-Werror=implicit-function-declaration]
     init_timer(&nvl->rc_timer);
     ^~~~~~~~~~
     init_timers
/build/kernel/nv.c:2408:28: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     nvl->rc_timer.function = nvidia_rc_timer;
                            ^
/build/kernel/nv.c:2409:18: error: 'struct timer_list' has no member named 'data'
     nvl->rc_timer.data = (unsigned long) nvl;
                  ^
cc1: some warnings being treated as errors
make[3]: *** [/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/source/scripts/Makefile.build:306: /build/kernel/nv.o] Error 1
make[2]: *** [/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/source/Makefile:1517: _module_/build/kernel] Error 2
make[2]: Leaving directory '/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/build'
make[1]: *** [Makefile:146: sub-make] Error 2
make[1]: Leaving directory '/nix/store/92q2v3lr0ls0p7j3sk0drp05iga3yazs-linux-4.19.2-dev/lib/modules/4.19.2/source'
NVIDIA: left KBUILD.
nvidia.ko failed to build!

NixOS is currently on the 340.104 version, but upstream is on 340.107:
https://www.nvidia.com/download/driverResults.aspx/135161/en-us

I hope that updating to 340.107 resolves the issue, but I don't understand how to update the different checksums for the nvidia driver.

Steps to reproduce

services.xserver.videoDrivers = [ "nvidiaLegacy340" ];
boot.kernelPackages = pkgs.linuxPackages_latest;

Technical details

/nix/store/kic17fw8wil74k04kzh3dha43izrr9j3-bash-interactive-4.4-p23-dev
copying path '/nix/store/kic17fw8wil74k04kzh3dha43izrr9j3-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...

  • system: "x86_64-linux"
  • host os: Linux 4.19.2, NixOS, 18.09.1363.b37872d4268 (Jellyfish)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • channels(root): "nixos-18.09.1363.b37872d4268"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@cyounkins
Copy link
Contributor

The hashes are located at https://github.com/NixOS/nixpkgs/blob/release-18.09/pkgs/os-specific/linux/nvidia-x11/default.nix#L32

and can be generated like so:

# nix-prefetch-url http://us.download.nvidia.com/XFree86/Linux-x86_64/340.104/NVIDIA-Linux-x86_64-340.104.run
path is '/nix/store/0v30yddx1sdsj2cnzxfvdm8shisn3x8n-NVIDIA-Linux-x86_64-340.104.run'
18k65gx6jg956zxyfz31xdp914sq3msn665a759bdbryksbk3wds

# nix-prefetch-url http://us.download.nvidia.com/XFree86/Linux-x86_64/340.107/NVIDIA-Linux-x86_64-340.107.run
path is '/nix/store/5083hr9iscfzy6yrkldlzp0hbcvgaq84-NVIDIA-Linux-x86_64-340.107.run'
0pv9yv3x0kg9hfkmc50xb54ahxkbnyy2vyy4hj2h0s6m9sb5kqz3

# nix-prefetch-url http://us.download.nvidia.com/XFree86/Linux-x86/340.104/NVIDIA-Linux-x86-340.104.run
path is '/nix/store/i3xjphbmyxz2wwmkkw0cqy5zwhhcm47k-NVIDIA-Linux-x86-340.104.run'
1l8w95qpxmkw33c4lsf5ar9w2fkhky4x23rlpqvp1j66wbw1b473

# nix-prefetch-url http://us.download.nvidia.com/XFree86/Linux-x86/340.107/NVIDIA-Linux-x86-340.107.run
path is '/nix/store/x2ciqxw9br84hvbv32mnj9zdxl8bglgd-NVIDIA-Linux-x86-340.107.run'
0mh83affz6bim26ws7kkwwcfj2s6vkdy4d45hifsbshr82qd52wd

# nix-prefetch-url https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-340.104.tar.bz2
path is '/nix/store/hqpgx82ak2xfk0l11f1gf7y8bf527cvp-nvidia-settings-340.104.tar.bz2'
1vvpqimvld2iyfjgb9wvs7ca0b0f68jzfdpr0icbyxk4vhsq7sxk

# nix-prefetch-url https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-340.107.tar.bz2
path is '/nix/store/grm94883wjy8lknap52m9naqav9q5vb9-nvidia-settings-340.107.tar.bz2'
1rgaa24acdyqa1rqrx56293vxpskr792njqqpigqmps04llsx703

# nix-prefetch-url https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-340.104.tar.bz2
path is '/nix/store/099v0vs4lgnsx8p9h3ds8l3jwh0jh8pd-nvidia-persistenced-340.104.tar.bz2'
0zqws2vsrxbxhv6z0nn2galnghcsilcn3s0f70bpm6jqj9wzy7x8

# nix-prefetch-url https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-340.107.tar.bz2
path is '/nix/store/9x78zvjfl9wgdgmg6nlq01f4axxgx82f-nvidia-persistenced-340.107.tar.bz2'
0nwv6kh4gxgy80x1zs6gcg5hy3amg25xhsfa2v4mwqa36sblxz6l

Please try:

  legacy_340 = generic {
    version = "340.107";
    sha256_32bit = "0mh83affz6bim26ws7kkwwcfj2s6vkdy4d45hifsbshr82qd52wd";
    sha256_64bit = "0pv9yv3x0kg9hfkmc50xb54ahxkbnyy2vyy4hj2h0s6m9sb5kqz3";
    settingsSha256 = "1rgaa24acdyqa1rqrx56293vxpskr792njqqpigqmps04llsx703";
    persistencedSha256 = "0nwv6kh4gxgy80x1zs6gcg5hy3amg25xhsfa2v4mwqa36sblxz6l";
    useGLVND = false;

    patches = maybePatch_drm_legacy ++ [ ./vm_operations_struct-fault.patch ];
  };

@florianjacob
Copy link
Contributor Author

@cyounkins Thanks alot for giving me a hand and teaching me how to get those four hashes! 👍

Updating to 340.107 indeed resolves this issue. PR: #50841

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

Successfully merging a pull request may close this issue.

2 participants