NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.17k stars 13.44k forks source link

nvidia-x11-495.44-5.17 failed to build in latest update #166410

Open mudrii opened 2 years ago

mudrii commented 2 years ago

Describe the bug

System update failed due to Nvidia driver build failure for nvidia-x11-495.44-5.17

Steps To Reproduce

Steps to reproduce the behavior:

  1. update nixos nixos-rebuild switch

Expected behavior

A clear and concise description of what you expected to happen. Install latest nvidia drivers for linux kernel linux-5.17

Screenshots

Error

  CC [M]  /build/kernel/nvidia/os-interface.o
  CC [M]  /build/kernel/nvidia/os-mlock.o
  CC [M]  /build/kernel/nvidia/os-pci.o
/build/kernel/nvidia/nv-mmap.c: In function 'nv_encode_caching':
/build/kernel/nvidia/nv-mmap.c:334:16: warning: this statement may fall through [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough=-Wimplicit-fallthrough=8;;]
  334 |             if (NV_ALLOW_CACHING(memory_type))
      |                ^
/build/kernel/nvidia/nv-mmap.c:337:9: note: here
  337 |         default:
      |         ^~~~~~~
/build/kernel/nvidia/nv-dma.c:976: warning: "IMPORT_SGT_STUBS_NEEDED" redefined
  976 | #define IMPORT_SGT_STUBS_NEEDED 0
      | 
/build/kernel/nvidia/nv-dma.c:970: note: this is the location of the previous definition
  970 | #define IMPORT_SGT_STUBS_NEEDED 1
      | 
In file included from /build/kernel/common/inc/nv-procfs.h:26,
                 from /build/kernel/nvidia/nv-procfs.c:31:
/build/kernel/nvidia/nv-procfs.c: In function 'nv_procfs_open_gpu_info':
/build/kernel/common/inc/nv-procfs-utils.h:104:29: error: implicit declaration of function 'PDE' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Werror=implicit-function-declaration8;;]
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                             ^~~
/build/kernel/common/inc/nv-procfs-utils.h:126:27: note: in expansion of macro 'NV_PDE_DATA'
  126 |                           NV_PDE_DATA(inode));                              \
      |                           ^~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:150:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_HELPER'
  150 |     NV_DEFINE_SINGLE_PROCFS_FILE_HELPER(name, open_callback, close_callback)\
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:38:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY'
   38 |     NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY(name, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:192:1: note: in expansion of macro 'NV_DEFINE_SINGLE_NVRM_PROCFS_FILE'
  192 | NV_DEFINE_SINGLE_NVRM_PROCFS_FILE(gpu_info);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:104:39: error: invalid type argument of '->' (have 'int')
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                                       ^~
/build/kernel/common/inc/nv-procfs-utils.h:126:27: note: in expansion of macro 'NV_PDE_DATA'
  126 |                           NV_PDE_DATA(inode));                              \
      |                           ^~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:150:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_HELPER'
  150 |     NV_DEFINE_SINGLE_PROCFS_FILE_HELPER(name, open_callback, close_callback)\
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:38:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY'
   38 |     NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY(name, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:192:1: note: in expansion of macro 'NV_DEFINE_SINGLE_NVRM_PROCFS_FILE'
  192 | NV_DEFINE_SINGLE_NVRM_PROCFS_FILE(gpu_info);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c: In function 'nv_procfs_open_power':
/build/kernel/common/inc/nv-procfs-utils.h:104:39: error: invalid type argument of '->' (have 'int')
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                                       ^~
/build/kernel/common/inc/nv-procfs-utils.h:126:27: note: in expansion of macro 'NV_PDE_DATA'
  126 |                           NV_PDE_DATA(inode));                              \
      |                           ^~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:150:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_HELPER'
  150 |     NV_DEFINE_SINGLE_PROCFS_FILE_HELPER(name, open_callback, close_callback)\
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:38:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY'
   38 |     NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY(name, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:244:1: note: in expansion of macro 'NV_DEFINE_SINGLE_NVRM_PROCFS_FILE'
  244 | NV_DEFINE_SINGLE_NVRM_PROCFS_FILE(power);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c: In function 'nv_procfs_open_version':
/build/kernel/common/inc/nv-procfs-utils.h:104:39: error: invalid type argument of '->' (have 'int')
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                                       ^~
/build/kernel/common/inc/nv-procfs-utils.h:126:27: note: in expansion of macro 'NV_PDE_DATA'
  126 |                           NV_PDE_DATA(inode));                              \
      |                           ^~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:150:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_HELPER'
  150 |     NV_DEFINE_SINGLE_PROCFS_FILE_HELPER(name, open_callback, close_callback)\
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:38:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY'
   38 |     NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY(name, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:258:1: note: in expansion of macro 'NV_DEFINE_SINGLE_NVRM_PROCFS_FILE'
  258 | NV_DEFINE_SINGLE_NVRM_PROCFS_FILE(version);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c: In function 'nv_procfs_open_file':
/build/kernel/common/inc/nv-procfs-utils.h:104:39: error: invalid type argument of '->' (have 'int')
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                                       ^~
/build/kernel/nvidia/nv-procfs.c:303:16: note: in expansion of macro 'NV_PDE_DATA'
  303 |     nvpp->nv = NV_PDE_DATA(inode);
      |                ^~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c: In function 'nv_procfs_open_params':
/build/kernel/common/inc/nv-procfs-utils.h:104:39: error: invalid type argument of '->' (have 'int')
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                                       ^~
/build/kernel/common/inc/nv-procfs-utils.h:126:27: note: in expansion of macro 'NV_PDE_DATA'
  126 |                           NV_PDE_DATA(inode));                              \
      |                           ^~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:150:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_HELPER'
  150 |     NV_DEFINE_SINGLE_PROCFS_FILE_HELPER(name, open_callback, close_callback)\
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:38:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY'
   38 |     NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY(name, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:469:1: note: in expansion of macro 'NV_DEFINE_SINGLE_NVRM_PROCFS_FILE'
  469 | NV_DEFINE_SINGLE_NVRM_PROCFS_FILE(params);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c: In function 'nv_procfs_open_text_file':
/build/kernel/common/inc/nv-procfs-utils.h:104:39: error: invalid type argument of '->' (have 'int')
  104 | # define NV_PDE_DATA(inode) PDE(inode)->data
      |                                       ^~
/build/kernel/common/inc/nv-procfs-utils.h:126:27: note: in expansion of macro 'NV_PDE_DATA'
  126 |                           NV_PDE_DATA(inode));                              \
      |                           ^~~~~~~~~~~
/build/kernel/common/inc/nv-procfs-utils.h:150:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_HELPER'
  150 |     NV_DEFINE_SINGLE_PROCFS_FILE_HELPER(name, open_callback, close_callback)\
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:38:5: note: in expansion of macro 'NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY'
   38 |     NV_DEFINE_SINGLE_PROCFS_FILE_READ_ONLY(name, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/kernel/nvidia/nv-procfs.c:1304:1: note: in expansion of macro 'NV_DEFINE_SINGLE_NVRM_PROCFS_FILE'
 1304 | NV_DEFINE_SINGLE_NVRM_PROCFS_FILE(text_file);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [/nix/store/k0v44aqabwi50a9c1rcanfllgcxynrvj-linux-5.17-dev/lib/modules/5.17.0/source/scripts/Makefile.build:288: /build/kernel/nvidia/nv-procfs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/nix/store/k0v44aqabwi50a9c1rcanfllgcxynrvj-linux-5.17-dev/lib/modules/5.17.0/source/Makefile:1831: /build/kernel] Error 2
make[2]: Leaving directory '/nix/store/k0v44aqabwi50a9c1rcanfllgcxynrvj-linux-5.17-dev/lib/modules/5.17.0/build'
make[1]: *** [Makefile:219: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/k0v44aqabwi50a9c1rcanfllgcxynrvj-linux-5.17-dev/lib/modules/5.17.0/source'
make: *** [Makefile:80: modules] Error 2
error: builder for '/nix/store/q0rjqmdfx1sh8d4qs7xdvawl1qwv5zwc-nvidia-x11-495.44-5.17.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/hrl7anrqbn8ppds4adk3rpfyvraphd0b-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fpigj45a8528yjscqbqg6j0j6z7g9ngd-linux-5.17-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5b7r63lbkkdzjg0yjrrpj3asy9fzzgpg-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rz4qvnhqzm6b6dsp406c2lpz5cqf5bn9-nixos-system-p53-nixos-21.11.336735.9b168e5e624.drv' failed to build

Metadata

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

 ~  nix-shell -p nix-info --run "nix-info -m"                                                                                                                                                                171ms
this path will be fetched (0.06 MiB download, 0.30 MiB unpacked):
  /nix/store/n32py8bgkgi73llcc57kffrnwnaf0vm4-bash-interactive-5.1-p8-dev
copying path '/nix/store/n32py8bgkgi73llcc57kffrnwnaf0vm4-bash-interactive-5.1-p8-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.16.16, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4`
 - channels(root): `"home-manage-21.11, home-manager-21.11, nixos-21.11.336735.9b168e5e624, unstable-22.05pre364329.ce8cbe3c01f"`
 - channels(mudrii): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
SDAChess commented 2 years ago

I'm having the same issue here.

SDAChess commented 2 years ago

Try removing any boot.kernelPackages override in your system configuration. That solves it

kjeremy commented 2 years ago

I'm having the same issue. nvidia driver version 510 is supposed to work with kernel 5.17. It should be made available on 21.11

kjeremy commented 2 years ago

It works with the beta driver on 20.11