Nvidia open fails to build

this has been now about week or so issue on my nixos and nvidia open fails on build

  nvidia-uvm/uvm_hmm.c: In function 'fill_dst_pfn':
1810 │ nvidia-uvm/uvm_hmm.c:84:39: error: too few arguments to function 'zone_device_page_init'; expected 3, h
     │ ave 1
1811 │    84 | #define ZONE_DEVICE_PAGE_INIT(page)   zone_device_page_init(page)
1812 │       |                                       ^~~~~~~~~~~~~~~~~~~~~
1813 │ nvidia-uvm/uvm_hmm.c:2159:9: note: in expansion of macro 'ZONE_DEVICE_PAGE_INIT'
1814 │  2159 |         ZONE_DEVICE_PAGE_INIT(dpage);
1815 │       |         ^~~~~~~~~~~~~~~~~~~~~
1816 │ In file included from /nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/sou
     │ rce/include/linux/mm.h:33,
1817 │                  from ././common/inc/nv-pgprot.h:30,
1818 │                  from ././common/inc/nv-linux.h:33,
1819 │                  from nvidia-uvm/uvm_linux.h:40,
1820 │                  from nvidia-uvm/uvm_common.h:43,
1821 │                  from nvidia-uvm/uvm_va_block_types.h:27,
1822 │                  from nvidia-uvm/uvm_hmm.h:29,
1823 │                  from nvidia-uvm/uvm_hmm.c:24:
1824 │ /nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/include/linux/memr
     │ emap.h:227:6: note: declared here
1825 │   227 | void zone_device_page_init(struct page *page, struct dev_pagemap *pgmap,
1826 │       |      ^~~~~~~~~~~~~~~~~~~~~
1827 │   CC [M]  nvidia-uvm/uvm_test_rng.o
1828 │ make[5]: *** [/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/scri
     │ pts/Makefile.build:289: nvidia-uvm/uvm_hmm.o] Error 1
1829 │ make[5]: *** Waiting for unfinished jobs....
1830 │ make[4]: *** [/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/Make
     │ file:2055: .] Error 2
1831 │ make[3]: *** [/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/Make
     │ file:248: __sub-make] Error 2
1832 │ make[3]: Leaving directory '/build/source/kernel-open'
1833 │ make[2]: *** [Makefile:248: __sub-make] Error 2
1834 │ make[2]: Leaving directory '/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19
     │ .0/source'
1835 │ make[1]: *** [Makefile:138: modules] Error 2
1836 │ make[1]: Leaving directory '/build/source/kernel-open'
1837 │ make: *** [Makefile:59: modules] Error 2

1 Like

Have you tried kernel version 6.18?

Trying _latest with Nvidia regularly fails. With about the very same cadence a new kernel version gets released.

2 Likes

And anyway seems like a bad idea; the nvidia module is effectively part of the kernel source code, you’re literally mashing together different versions of sub-parts of the same codebase and expecting them to work.

It’ll typically just result in compilation failure, but producing a kernel that will damage your hardware isn’t completely out of the question; you’re not just integrating different bits of software, you’re messing with kernel code in unpredictable ways.

3 Likes

there is some progress on this one some errors are sorted

this one was first the culprit now there is other, but progress still maybe soon will be all good again

nvidia-open> make: *** [Makefile:59: modules] Error 2
error: Cannot build '/nix/store/5p57bwj713qy361v53z6k9kga44zsx18-nvidia-open-6.19-580.126.09.drv'.
       Reason: builder failed with exit code 2.
       Output paths:
         /nix/store/f5g4klac4sgbgj0ii0pk8hdh9hrg2klk-nvidia-open-6.19-580.126.09
       Last 25 log lines:
       >       |                                       ^~~~~~~~~~~~~~~~~~~~~
       > nvidia-uvm/uvm_hmm.c:2159:9: note: in expansion of macro 'ZONE_DEVICE_PAGE_INIT'
       >  2159 |         ZONE_DEVICE_PAGE_INIT(dpage);
       >       |         ^~~~~~~~~~~~~~~~~~~~~
       > In file included from /nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/include/linux/mm.h:33,
       >                  from ././common/inc/nv-pgprot.h:30,
       >                  from ././common/inc/nv-linux.h:33,
       >                  from nvidia-uvm/uvm_linux.h:40,
       >                  from nvidia-uvm/uvm_common.h:43,
       >                  from nvidia-uvm/uvm_va_block_types.h:27,
       >                  from nvidia-uvm/uvm_hmm.h:29,
       >                  from nvidia-uvm/uvm_hmm.c:24:
       > /nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/include/linux/memremap.h:227:6: note: declared here
       >   227 | void zone_device_page_init(struct page *page, struct dev_pagemap *pgmap,
       >       |      ^~~~~~~~~~~~~~~~~~~~~
       > make[5]: *** [/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/scripts/Makefile.build:289: nvidia-uvm/uvm_hmm.o] Error 1
       > make[5]: *** Waiting for unfinished jobs....
       > make[4]: *** [/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/Makefile:2055: .] Error 2
       > make[3]: *** [/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source/Makefile:248: __sub-make] Error 2
       > make[3]: Leaving directory '/build/source/kernel-open'
       > make[2]: *** [Makefile:248: __sub-make] Error 2
       > make[2]: Leaving directory '/nix/store/b4kf7sphmydjzswhm3yyn90qj2a7v4iv-linux-6.19-dev/lib/modules/6.19.0/source'
       > make[1]: *** [Makefile:138: modules] Error 2
       > make[1]: Leaving directory '/build/source/kernel-open'
       > make: *** [Makefile:59: modules] Error 2
       For full logs, run:
         nix log /nix/store/5p57bwj713qy361v53z6k9kga44zsx18-nvidia-open-6.19-580.126.09.drv
error: Cannot build '/nix/store/rpwk10ay8m32yjgxnjz66rlq0ylndb80-linux-6.19-modules.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/chdc40d3fgnq18sw8w3smf3bxsrxvpmw-linux-6.19-modules
error: Cannot build '/nix/store/489nngd7yf0cjcx73brhgyh4gcnxqdm2-nixos-system-nixos-26.05.20260213.a82ccc3.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/p0qyfmbc2zi7dgvazgcshsvrvz41iz90-nixos-system-nixos-26.05.20260213.a82ccc3
┏━ 3 Errors:

This will be fixed whenever nvidia release a new driver version, and will break again a couple months later. Seriously, just don’t use the _latest kernel with nvidia.

Is there a specific reason you’re trying to run 6.19? We should find an alternate solution to that problem.

1 Like

i think i am not even set nvidia _latest, but when i set my lanzaboote it needs unstable so i guess thats why i am on bleeding edge and latest. didint have any issues untill week ago when 6.19 arrived. and i need the secure boot with lanzaboote so i cant remove it. Mostly this is the reason why i am on bleeding edge

Use:

boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_18;
1 Like

Alternatively, if you need 6.19, there is a patch for the latest driver that you can apply like this:

hardware.nvidia = {
  package = cfg.driver.package // {
    open = cfg.driver.package.open.overrideAttrs (old: {
      patches = (old.patches or [ ]) ++ [
        (pkgs.fetchpatch {
          name = "kernel-6.19";
          url = "https://raw.githubusercontent.com/CachyOS/CachyOS-PKGBUILDS/master/nvidia/nvidia-utils/kernel-6.19.patch";
          hash = "sha256-YuJjSUXE6jYSuZySYGnWSNG5sfVei7vvxDcHx3K+IN4=";
        })
      ];
    });
  };
};

There’s some more info in the relevant nixpkgs issue

kernel 6.19.5 is out and it seems that has fixed nvidia/kernel build stuff and some other ones too i actually got my system updated and build now. it only took 1.5 hours but no errors