Nixpkgs: nvidiaLegacy390 fails to build with linux_latest

Created on 21 Jul 2019  路  9Comments  路  Source: NixOS/nixpkgs

Issue description

On my machine using nixos-unstable the upgrade process does not finish due to following error:

/build/kernel/nvidia-uvm/uvm8_tools.c:207:13: error: conflicting types for 'put_user_pages'
 static void put_user_pages(struct page **pages, NvU64 page_count)
             ^~~~~~~~~~~~~~
In file included from /build/kernel/common/inc/nv-pgprot.h:17:0,
                 from /build/kernel/common/inc/nv-linux.h:20,
                 from /build/kernel/nvidia-uvm/uvm_linux.h:41,
                 from /build/kernel/nvidia-uvm/uvm_common.h:48,
                 from /build/kernel/nvidia-uvm/uvm8_tools.c:23:
/nix/store/bbinqzylgdar5miiarys92z1vyj86026-linux-5.2-dev/lib/modules/5.2.0/source/include/linux/mm.h:1075:6: note: previous declaration of 'put_user_pages' was here
 void put_user_pages(struct page **pages, unsigned long npages);
      ^~~~~~~~~~~~~~

Steps to reproduce

  • run nixos-rebuild switch --upgrade

Technical details

  • system: "x86_64-linux"
  • host os: Linux 5.1.16, NixOS, 19.09pre184855.beff2f8d75e (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(root): "nixos-19.09pre185259.362be9608c3"
  • channels(nek0): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
stale

Most helpful comment

For what it's worth, I get the same error on 19.03 using the regular nvidia package and linuxPackages_latest.

Edit:
Just updated to 19.09. I had solved this in 19.03 by using linuxPackages_5_1, which was removed in 19.09, but now the nvidia package works with linuxPackages_latest. Not sure if it was fixed in the nvidia package or in the kernel.

All 9 comments

Legacy kernel driver and latest kernel... is just a combination that usually won't work. The version in nixpkgs master is the latest one provided by upstream ATM (390.116).

I'm sorry, but I'm constrained by the hardware I have. Do you have any suggestions what I can do about this problem other than getting new(er) hardware or downgrading to nixos-stable?

You can use an older kernel. Even nixos-unstable still defaults to 4.19 branch.

Another option is trying to find a fix for that combination – often one can find these in Nvidia forums or bleeding-edge distros (Arch, Gentoo). The compatibility for 5.2 line will probably appear upstream after some time, but by then linux_latest might be 5.3 already...

@nek0 you could try this adopted patch originally found on gentoo forums :)

For what it's worth, I get the same error on 19.03 using the regular nvidia package and linuxPackages_latest.

Edit:
Just updated to 19.09. I had solved this in 19.03 by using linuxPackages_5_1, which was removed in 19.09, but now the nvidia package works with linuxPackages_latest. Not sure if it was fixed in the nvidia package or in the kernel.

Same error (but no solution provided) happened recently with nvidia-x11 418.74 and linux 5.2.17.

Problem still persists even now in release 19.09. Combination is now nvidia_x11_legacy390 and kernel 5.4.5.

I still get compile errors on linux 5.4.24:

/build/kernel/common/inc/nv-linux.h:1799:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-frontend.c:39:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-frontend.c: In function 'nv_init_module':
/build/kernel/nvidia/nv-frontend.c:349:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-frontend.c: In function 'nv_exit_module':
/build/kernel/nvidia/nv-frontend.c:364:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /build/kernel/nvidia/nv.c:13:
/build/kernel/common/inc/nv-linux.h:1799:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /build/kernel/nvidia/nv-gpu-numa.c:24:
/build/kernel/common/inc/nv-linux.h:1799:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv.c:44:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv.c: In function 'nvidia_init_module':
/build/kernel/nvidia/nv.c:941:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv.c: At top level:
/build/kernel/nvidia/nv.c:1221:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
cc1: some warnings being treated as errors
make[3]: *** [/nix/store/mh023yhf54qzplbq2bqhx4s4lv11afzr-linux-5.4.24-dev/lib/modules/5.4.24/source/scripts/Makefile.build:266: /build/kernel/nvidia/nv-frontend.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [/nix/store/mh023yhf54qzplbq2bqhx4s4lv11afzr-linux-5.4.24-dev/lib/modules/5.4.24/source/scripts/Makefile.build:266: /build/kernel/nvidia/nv-gpu-numa.o] Error 1
In file included from /build/kernel/nvidia/nv-instance.c:13:
/build/kernel/common/inc/nv-linux.h:1799:6: error: "NV_BUILD_MODULE_INSTANCES" is not defined, evaluates to 0 [-Werror=undef]
 #if (NV_BUILD_MODULE_INSTANCES != 0)

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  路  3Comments

lverns picture lverns  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

spacekitteh picture spacekitteh  路  3Comments

edolstra picture edolstra  路  3Comments