#1137165 nvidia-kernel-dkms: apt install fails to build nvidia package and install it on kernel>=7

#1137165#5
Date:
2026-05-20 09:18:12 UTC
From:
To:
Dear Maintainer,

Running debian forky or sid won't compile and install the nvidia drivers. Initially the issue was with forky so I updated to sid to see if the issue was resolved; it wasn't.

The error is during the compile and the text during apt update is:

 Failed command:
 env NV_VERBOSE=1 make -j12 modules KERNEL_UNAME=7.0.7+deb14-amd64

 Error! Bad return status for module build on kernel: 7.0.7+deb14-amd64 (x86_64)
 Consult /var/lib/dkms/nvidia-current/550.163.01/build/make.log for more information.
 dpkg: error processing package nvidia-kernel-dkms (--configure):
  old nvidia-kernel-dkms package postinst maintainer script subprocess failed with exit status 10
 Setting up atril-common (1.28.4-1)…
 Setting up firefox-esr (140.11.0esr-1)…
 Setting up firmware-carl9170 (1.9.9-690-gc6e7ab0-0.2)…
 dpkg: dependency problems prevent configuration of nvidia-driver:
  nvidia-driver depends on nvidia-kernel-dkms (= 550.163.01-5) | nvidia-kernel-550.163.01 | nvidia-open-kernel-550.163.01; however:
   Package nvidia-kernel-dkms is not configured yet.
   Package nvidia-kernel-550.163.01 is not installed.
   Package nvidia-kernel-dkms which provides nvidia-kernel-550.163.01 is not configured yet.
   Package nvidia-open-kernel-550.163.01 is not installed.

 dpkg: error processing package nvidia-driver (--configure):
  dependency problems - leaving unconfigured
 Setting up rsync (3.4.3+ds1-2)…

There is a log file created that contains an error. The section with the error contains:

nvidia/nv-mmap.c: In function ‘nv_vma_enter_locked’:
nvidia/nv-mmap.c:844:24: error: ‘VMA_LOCK_OFFSET’ undeclared (first use in this function); did you mean ‘VGA_CRTC_OFFSET’?
  844 |     NvU32 tgt_refcnt = VMA_LOCK_OFFSET;
      |                        ^~~~~~~~~~~~~~~
      |                        VGA_CRTC_OFFSET
nvidia/nv-mmap.c:844:24: note: each undeclared identifier is reported only once for each function it appears in
# CC [M]  nvidia/nv-vm.o
   x86_64-linux-gnu-gcc-15 -Wp,-MMD,nvidia/.nv-vm.o.d -nostdinc -I/usr/src/linux-headers-7.0.7+deb14-common/arch/x86/include -I/usr/src/linux-headers-7.0.7+deb14-amd64/arch/x86/include/generated -I/usr/src/linux-headers-7.0.7+deb14-common/include -I/usr/src/linux-headers-7.0.7+deb14-amd64/include -I/usr/src/linux-headers-7.0.7+deb14-common/arch/x86/include/uapi -I/usr/src/linux-headers-7.0.7+deb14-amd64/arch/x86/include/generated/uapi -I/usr/src/linux-headers-7.0.7+deb14-common/include/uapi -I/usr/src/linux-headers-7.0.7+deb14-amd64/include/generated/uapi -include /usr/src/linux-headers-7.0.7+deb14-common/include/linux/compiler-version.h -include /usr/src/linux-headers-7.0.7+deb14-common/include/linux/kconfig.h -include /usr/src/linux-headers-7.0.7+deb14-common/include/linux/compiler_types.h -D__KERNEL__ -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a -fcf-protection=branch -fno-jump-tables -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=x86-64 -mtune=generic -mno-red-zone -mcmodel=kernel -mstack-protector-guard-reg=gs -mstack-protector-guard-symbol=__ref_stack_chk_guard -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -fno-jump-tables -mharden-sls=all -fpatchable-function-entry=16,16 -fno-delete-null-pointer-checks -O2 -fno-allow-store-data-races -fstack-protector-strong -ftrivial-auto-var-init=zero -fzero-init-padding-bits=all -fno-stack-clash-protection -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fmin-function-alignment=16 -fstrict-flex-arrays=3 -fms-extensions -fno-strict-overflow -fno-stack-check -fconserve-stack -fno-builtin-wcslen -Wall -Wextra -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=2048 -Wno-main -Wno-type-limits -Wno-dangling-pointer -Wvla-larger-than=1 -Wno-pointer-sign -Wcast-function-type -Wno-unterminated-string-initialization -Wno-array-bounds -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wenum-conversion -Wunused -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-packed-not-aligned -Wno-format-overflow -Wno-format-truncation -Wno-stringop-truncation -Wno-override-init -Wno-missing-field-initializers -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -I././common/inc -I./. -Wall -Wno-cast-qual -Wno-format-extra-args -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"550.163.01\" -DNV_FILESYSTEM_ACCESS_AVAILABLE=1 -Wno-unused-function -Wuninitialized -fno-strict-aliasing -ffreestanding -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -Werror=undef -DNV_SPECTRE_V2=0 -DNV_KERNEL_INTERFACE_LAYER -Wno-error -I././nvidia -DNVIDIA_UNDEF_LEGACY_BIT_MACROS -UDEBUG -U_DEBUG -DNDEBUG  -fsanitize=bounds-strict -fsanitize=shift    -DMODULE  -DKBUILD_BASENAME='"nv_vm"' -DKBUILD_MODNAME='"nvidia"' -D__KBUILD_MODNAME=nvidia -c -o nvidia/nv-vm.o nvidia/nv-vm.c
nvidia/nv-mmap.c: In function ‘nv_vma_start_write’:
nvidia/nv-mmap.c:896:9: error: too many arguments to function ‘__is_vma_write_locked’; expected 1, have 2
  896 |     if (__is_vma_write_locked(vma, &mm_lock_seq))
      |         ^~~~~~~~~~~~~~~~~~~~~      ~~~~~~~~~~~~
In file included from /usr/src/linux-headers-7.0.7+deb14-common/arch/x86/include/asm/uaccess.h:12,
                 from /usr/src/linux-headers-7.0.7+deb14-common/include/linux/uaccess.h:13,
                 from /usr/src/linux-headers-7.0.7+deb14-common/include/linux/sched/task.h:13,
                 from /usr/src/linux-headers-7.0.7+deb14-common/include/linux/sched/signal.h:9,
                 from ././common/inc/nv-lock.h:35,
                 from ././common/inc/nv-linux.h:32,
                 from nvidia/nv-mmap.c:27:
/usr/src/linux-headers-7.0.7+deb14-common/include/linux/mmap_lock.h:282:20: note: declared here
  282 | static inline bool __is_vma_write_locked(struct vm_area_struct *vma)
      |                    ^~~~~~~~~~~~~~~~~~~~~
nvidia/nv-mmap.c:905:42: error: ‘VMA_LOCK_OFFSET’ undeclared (first use in this function); did you mean ‘VGA_CRTC_OFFSET’?
  905 |         detached = refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt);
      |                                          ^~~~~~~~~~~~~~~
      |                                          VGA_CRTC_OFFSET
# CC [M]  nvidia/nv-vtophys.o

Normally Id wait a few days and this kind of issue is fixed but its been over a week now and as I can't see any reports of this issue (except on nvidia's webiste) I'm guessing that not a lot of people have my exact setup.

The issue started, I think, when the kernel went to version 7 and has subsiquently been updated multiple times till this current version. All seemed to have the same compile issue as far as I can recall.

Its an HP victus laptop with an AMD Ryzen 5 5600H with Radeon Graphics processor and a 3050 chip set up in Optimus mode.

Very strangely I'm currently writing this from the v7 kernel even though the compile has only worked for the 6.19.13+deb14-amd64 kernel during the apt dist-update.

Thanks in advance for any help, even if its just "it will be fixed eventually".

I should say I'm a "user" with a few years under my belt so I may be able to provide more information if required.

Also, looking at the bug it would suggest that if a newer version was available that worked for v7 then it would no longer work for v6 unless there were multiple versions of the code as its a parameter error that if shrunk to 1 parm in v7 would break due to the calling requirement of 2 in v6.

#1137165#10
Date:
2026-05-20 10:09:39 UTC
From:
To:
I have worked out how I can boot to the v7 kernel.

I currently use a couple of conf files within /etc/X11/xorg.conf.d/ that
allow me to boot to either "just the amd" laptop screen or both the laptop
"amd" screen and the "nvidia" external desktop monitors (via HDMI & via a
USB dock with HDMI/Displayport). My current boot is for the amd only
version... so guessing nothing is being loaded as far as the nvidia is
concerned; hence it works where as previously some of the versions/boot
failed with diver errors (possibly due to the hdmi actually being plugged
in at boot and/or making the nvidia conf file active depending on if I'm at
my desk or on the couch!)

These are the conf (currently held) files. The current boot is completely
X11 default handling.

cat /etc/X11/xorg.conf.d/10-prime_nvidiagpu.conf.hold
Section "ServerLayout"
    Identifier  "layout"
    Screen 0    "nvidia"
    Inactive    "amdgpu"
EndSection

Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
    BusID       "PCI:1:0:0" # Sample: "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier  "nvidia"
    Device      "nvidia"
    Option      "AllowEmptyInitialConfiguration"
    #  Option         "ForceFullCompositionPipeline" "on"
    #  Option         "AllowIndirectGLXProtocol" "off"
    #  Option         "TripleBuffer" "on"
EndSection

Section "Device"
    Identifier  "amdgpu"
    # Driver      "amdgpu"
    Driver      "modesetting"
    BusID       "PCI:6:0:0"  # Sample: "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "amdgpu"
    Device "amdgpu"
EndSection

cat /etc/X11/xorg.conf.d/10-prime_amdgpu.conf.hold
Section "ServerLayout"
    Identifier  "layout"
    Screen 0    "amdgpu"
    Inactive    "nvidia"
    Option      "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier  "nvidia"
    Driver      "nvidia"
    BusID       "PCI:1:0:0" # Sample: "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier  "nvidia"
    Device      "nvidia"
    Option      "AllowEmptyInitialConfiguration"
    #  Option         "ForceFullCompositionPipeline" "on"
    #  Option         "AllowIndirectGLXProtocol" "off"
    #  Option         "TripleBuffer" "on"
EndSection

Section "Device"
    Identifier  "amdgpu"
    Driver      "amdgpu"
    #   Driver      "modesetting"
    BusID       "PCI:6:0:0"  # Sample: "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "amdgpu"
    Device "amdgpu"
EndSection

#1137165#15
Date:
2026-05-27 08:51:38 UTC
From:
To:
Dear Maintainer

I am running on a fresh install with all updates as of this morning.

Operating System: Debian GNU/Linux forky/sid
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2
Kernel Version: 7.0.9+deb14-amd64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-4790 CPU @ 3.60GHz
Memory: 16 GiB of RAM (14.6 GiB usable)
Graphics Processor 1: NVIDIA GeForce GTX 1060 3GB
Graphics Processor 2: Intel® HD Graphics 4600
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B85M-HD3

Please find attached make.log created a few minutes ago.

With thanks and best wishes
Gray

#1137165#20
Date:
2026-06-03 08:55:17 UTC
From:
To:
Dear Maintainer

I have just updated the desktop to 7.0.10 and the terminal output
relating to the dkms issue:

Setting up nvidia-kernel-dkms (550.163.01-5)…
Loading new nvidia-current/550.163.01 DKMS files...
Building for 7.0.9+deb14-amd64 and 7.0.10+deb14-amd64

Building initial module nvidia-current/550.163.01 for 7.0.9+deb14-amd64
Sign command: /lib/modules/7.0.9+deb14-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Certificate or key are missing, generating self signed certificate for
MOK...

Building module(s)...........(bad exit status: 2)
Failed command:
env NV_VERBOSE=1 make -j8 modules KERNEL_UNAME=7.0.9+deb14-amd64

Error! Bad return status for module build on kernel: 7.0.9+deb14-amd64
(x86_64)
Consult /var/lib/dkms/nvidia-current/550.163.01/build/make.log for more
information.
dpkg:error processing package nvidia-kernel-dkms (--configure):
old nvidia-kernel-dkms package postinst maintainer script subprocess
failed with exit status 10
dpkg:dependency problems prevent configuration of nvidia-driver:
nvidia-driver depends on nvidia-kernel-dkms (= 550.163.01-5) |
nvidia-kernel-550.163.01 | nvidia-open-kernel-550.163.01; however:
  Package nvidia-kernel-dkms is not configured yet.
  Package nvidia-kernel-550.163.01 is not installed.
  Package nvidia-kernel-dkms which provides nvidia-kernel-550.163.01 is
not configured yet.
  Package nvidia-open-kernel-550.163.01 is not installed.

dpkg:error processing package nvidia-driver (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.42-16)…
Processing triggers for initramfs-tools (0.151)…
update-initramfs: Generating /boot/initrd.img-7.0.10+deb14-amd64
Processing triggers for update-glx (1.2.2)…
Processing triggers for glx-alternative-nvidia (1.2.2)…
update-alternatives: using /usr/lib/nvidia to provide /usr/lib/glx (glx)
in auto mode
Processing triggers for glx-alternative-mesa (1.2.2)…
Processing triggers for libc-bin (2.42-16)…
Processing triggers for initramfs-tools (0.151)…
update-initramfs: Generating /boot/initrd.img-7.0.10+deb14-amd64
Errors were encountered while processing:
nvidia-kernel-dkms
nvidia-driver
Error: Sub-process /usr/bin/dpkg returned an error code (1)

...and please find the attached make.log from
/var/lib/dkms/nvidia-current/550.163.01/build

#1137165#31
Date:
2026-06-18 14:50:31 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
nvidia-graphics-drivers, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1135362@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dominique Belhachemi <domibel@debian.org> (supplier of updated nvidia-graphics-drivers package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 11 Jun 2026 08:33:08 -0400
Source: nvidia-graphics-drivers
Architecture: source
Version: 550.163.01-5.1
Distribution: unstable
Urgency: medium
Maintainer: Debian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>
Changed-By: Dominique Belhachemi <domibel@debian.org>
Closes: 1135362
Changes:
 nvidia-graphics-drivers (550.163.01-5.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Fix kernel module build failures against Linux 7.0. (Closes: #1135362)
   * Backport VMA locking changes from 595.44.03: rename VMA_LOCK_OFFSET to
     VM_REFCNT_EXCLUDE_READERS_FLAG and add nv_is_vma_write_locked wrapper for
     the dropped mm_lock_seq argument.
   * Fix dma_fence_signal() and dma_fence_signal_locked() void return type for
     Linux 7.0.
   * Suppress PAHOLE awk shim when scripts/Makefile.btf is present: kernel 7.0
     replaced pahole-flags.sh with gen-btf.sh, which invokes $PAHOLE in shell
     context where the single-quoted awk program causes a parse error.
   * Backport MODULE_DESCRIPTION additions from 595.44.06, required by
     CONFIG_MODULE_ALLOW_MISSING_MODULE_DESCRIPTION=n in Forky.
Checksums-Sha1:
 4acf67e233dc70cee8c2cdba8b9bab35d26976a3 7310 nvidia-graphics-drivers_550.163.01-5.1.dsc
 c317986d9793d9d2c27ede2cd8d4cb030f8401d1 248320 nvidia-graphics-drivers_550.163.01-5.1.debian.tar.xz
 56bb75f2d4bab944db99c29a9a9699cb9cfd74c7 22976 nvidia-graphics-drivers_550.163.01-5.1_amd64.buildinfo
Checksums-Sha256:
 5514e522944e0eab82beb2ad558ffae3091a15ddecd43d79df4e1f8e0a372aa9 7310 nvidia-graphics-drivers_550.163.01-5.1.dsc
 8c18eec03de7a91247e18b7e846ced6e2c9876a9d948fc902cee387410c78575 248320 nvidia-graphics-drivers_550.163.01-5.1.debian.tar.xz
 402b0ce70de62dfb819ec456eb44f2a8f33a724c143c0750efedb226eab02d68 22976 nvidia-graphics-drivers_550.163.01-5.1_amd64.buildinfo
Files:
 a353860c6578a00b738af6ee049f519d 7310 non-free/libs optional nvidia-graphics-drivers_550.163.01-5.1.dsc
 6c43b7c76e21be0d98afef149dabb6bc 248320 non-free/libs optional nvidia-graphics-drivers_550.163.01-5.1.debian.tar.xz
 4f08d126fa90222d13294a0289d2d11b 22976 non-free/libs optional nvidia-graphics-drivers_550.163.01-5.1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJHBAEBCgAxFiEE6kgtUJkuk2zr2l/SGbXmyGIZEAEFAmoqv0ETHGRvbWliZWxA
ZGViaWFuLm9yZwAKCRAZtebIYhkQAR5MEACEHjV6wFaNczuDZ7VW/txNvLA+95W5
NJEei+LotPoaDP3WMNTFUT6a9vra1zZ8aw8ivufyalzYtRAflVAB8BgDTGDLZ9tM
ffdE9TY/tgg52DeP5Il7/54B/WOO9U5uAixFT24Qxct5pnOPcUX1nDL2ir+o+tRc
NjRGkhUWvhqbqUAfEwSC2mUtkHU3dCx6cLCY1Wn/WR4YrlPmg/18VlcD0lhVHTya
P4tZm/JpPPoeXUhZHv+jGA1g3dX3wAxoSemc6Yddyw6M/UndXLGkURNuebcNfPF9
EtRh4Zye3bRlsBMtOkZu4+7esYH9yDpdo4yeKihiYOUqQ+hfW1ik5Sp99H9CDvV3
nVOBKGtNjoP6Kb9G2n/JLsK8TPTNllDb9FAvuUGRHV0LJBzQo7uMZNcPezdDSS31
LPaUMOd5tOl4UTvjWe+z06Sp8pswmxiCz/RX1X4srX2MLR9YraPCxBnJNM9dTLNv
NWQsLQ1RtcH9SeHV8hU4oliXCxKyU+SxyNeRkIdYw7FC1VIcOPwAqMlJrebSR9MB
ImHYklGbGgF547PwSFCZNXQgd/E/IMsfhn/cVNg1ooAShQ6jbjmlZxlh1244r9IL
tlqiVoDq25PTsXukpn4hc5OJSJXy2DN+i9gsT/KLHqxq3C7DioUCgI3DVtkLkvmW
Mpbj1gVnPGas6g==
=bWw5
-----END PGP SIGNATURE-----