#1136776 nvidia-graphics-drivers-tesla-470: FTBFS: nvidia/nv-mmap.c:805:24: error: 'VMA_LOCK_OFFSET' undeclared (first use in this function); did you mean 'VGA_CRTC_OFFSET'?

#1136776#5
Date:
2026-05-15 18:10:18 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202605/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:nvidia-graphics-drivers-tesla-470, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
# CC [M]  nvidia/nv-p2p.o
   x86_64-linux-gnu-gcc-15 -Wp,-MMD,nvidia/.nv-p2p.o.d -nost [too-long-redacted] idia/nv-p2p.o nvidia/nv-p2p.c
nvidia/nv-mmap.c: In function ‘nv_vma_enter_locked’:
nvidia/nv-mmap.c:805:24: error: ‘VMA_LOCK_OFFSET’ undeclared (first use in this function); did you mean ‘VGA_CRTC_OFFSET’?
  805 |     NvU32 tgt_refcnt = VMA_LOCK_OFFSET;
      |                        ^~~~~~~~~~~~~~~
      |                        VGA_CRTC_OFFSET
nvidia/nv-mmap.c:805:24: note: each undeclared identifier is reported only once for each function it appears in
nvidia/nv-mmap.c: In function ‘nv_vma_start_write’:
nvidia/nv-mmap.c:857:9: error: too many arguments to function ‘__is_vma_write_locked’; expected 1, have 2
  857 |     if (__is_vma_write_locked(vma, &mm_lock_seq))
      |         ^~~~~~~~~~~~~~~~~~~~~      ~~~~~~~~~~~~
In file included from /usr/src/linux-headers-7.0.4+deb14-common/include/linux/mm.h:18,
                 from ././common/inc/nv-pgprot.h:17,
                 from ././common/inc/nv-linux.h:20,
                 from nvidia/nv-mmap.c:14:
/usr/src/linux-headers-7.0.4+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:866:42: error: ‘VMA_LOCK_OFFSET’ undeclared (first use in this function); did you mean ‘VGA_CRTC_OFFSET’?
  866 |         detached = refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt);
      |                                          ^~~~~~~~~~~~~~~
      |                                          VGA_CRTC_OFFSET
make[8]: *** [/usr/src/linux-headers-7.0.4+deb14-common/scripts/Makefile.build:294: nvidia/nv-mmap.o] Error 1
make[8]: *** Waiting for unfinished jobs....
make[7]: *** [/usr/src/linux-headers-7.0.4+deb14-common/Makefile:2130: .] Error 2
make[6]: *** [/usr/src/linux-headers-7.0.4+deb14-common/Makefile:260: __sub-make] Error 2
make[6]: Leaving directory '/<<PKGBUILDDIR>>/kernel-source-tree'
make[5]: *** [Makefile:260: __sub-make] Error 2
make[5]: Leaving directory '/usr/src/linux-headers-7.0.4+deb14-common'
make[4]: *** [Makefile:90: modules] Error 2
make[4]: Leaving directory '/<<PKGBUILDDIR>>/kernel-source-tree'
make[3]: *** [debian/rules:314: override_dh_auto_test] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>'
make[2]: *** [debian/rules:225: build] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [debian/rules:225: install] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:225: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1136776#10
Date:
2026-05-24 07:16:25 UTC
From:
To:
Hello,

please find the patch attached.
--------------------
Sincerely yours,
Damir Islamov

#1136776#15
Date:
2026-07-13 08:31:14 UTC
From:
To:
The attached patch makes the open kernel modules from
nvidia-graphics-drivers 550.163.01-4 (550.163.01) -- binary package
nvidia-open-kernel-dkms, DKMS module nvidia-current-open -- build and
run on Linux 7.1.3+deb14-amd64 (current sid).All behavioural
changes are conftest-guarded or rely on interfaces available throughout
the package's supported kernel range, so the tree remains buildable on
pre-7.x kernels (verified, see below).

The patch incorporates Damir Islamov's earlier VMA-locking fix from
this bug, with two adjustments:

 * the nv_is_vma_write_locked() helper is defined in nvidia/nv-mmap.c
   rather than common/inc/nv-mm.h, as the original hunk does not apply
   against the 550 tree's nv-mm.h;
 * the is_vma_write_locked_has_mm_lock_seq_arg conftest is registered
   in nvidia.Kbuild -- without registration the test never runs, the
   NV_IS_VMA_WRITE_LOCKED_HAS_MM_LOCK_SEQ_ARG macro is never defined,
   and the single-argument path is unconditionally selected, which
   would break the build on older kernels.

Additional Linux 7.x API changes addressed (new conftest tests
pci_resize_resource_has_exclude_bars_arg, dma_map_ops_has_map_resource,
dev_pagemap_ops_has_folio_free, zone_device_page_init_has_pgmap_arg;
registered in nvidia.Kbuild and nvidia-uvm.Kbuild respectively):

 * in_irq() removed: call sites use in_hardirq() (present since 5.11)
   with a preprocessor fallback in nv-time.h for older kernels
   (common/inc/nv-time.h, nvidia/os-interface.c);
 * __vm_flags removed from vm_area_struct: use __vm_flags_mod(), which
   is present on all kernels that can reach the affected
   !NV_CAN_CALL_VMA_START_WRITE branch and does not re-acquire the VMA
   write lock already taken by nv_vma_start_write()
   (common/inc/nv-mm.h);
 * pci_resize_resource() gained an exclude_bars argument: pass 0,
   conftest-guarded (nvidia/nv-pci.c);
 * dma_map_ops lost its .map_resource member: report resource mapping
   as usable when the member is absent, since the 7.x DMA core handles
   dma_map_resource() generically (nvidia/nv-dma.c);
 * ZONE_DEVICE folio conversion: .folio_free callback wrapper and
   3-argument zone_device_page_init(), both conftest-guarded
   (nvidia-uvm/uvm_pmm_gpu.c, nvidia-uvm/uvm_hmm.c);
 * legacy DRM_ERROR/DRM_WARN/DRM_INFO/DRM_DEBUG/DRM_DEBUG_DRIVER
   macros removed: #ifndef-guarded pr_* shims, no-ops where the
   macros still exist (nvidia-drm/nvidia-drm-priv.h);
 * atomic-state iterator fallbacks read the removed .state member:
   switched to .new_state, present since 4.12 and semantically
   identical at the pre-commit atomic_check call sites
   (nvidia-drm/nvidia-drm-helper.h);
 * struct drm_mode_create_dumb no longer visible transitively in
   nvidia-drm-gem-nvkms-memory.h, causing a prototype-scoped struct
   and a conflicting-types error: forward declaration added;
 * dma_fence_signal()/dma_fence_signal_locked() now return void: the
   nv_dma_fence_* wrappers discard the return and report success,
   which compiles on all supported kernels.

Tested with NVIDIA GeForce RTX 4060 Laptop GPU:
 * Runtime-tested (modules load, nvidia-smi, desktop session) on
   7.1.3+deb14-amd64, 6.12.17-amd64, 6.17.13+deb14-amd64.
 * Build-tested on: 6.12.17-amd64,6.17.12+deb14-amd64
6.17.13+deb14-amd64,6.17.7+deb14+1-amd64
6.18.10+deb14-amd64,6.18.15+deb14-amd64 6.18.8+deb14-amd64,7.1.3+deb14-amd64.
   The legacy conftest branches are selected on the pre-7.x kernels
   and the new branches on 7.1.3, as intended.

All building and testing was done with the open flavor
(nvidia-open-kernel-dkms / nvidia-current-open). The patch only touches
kernel-interface files shared between flavors (conftest.sh, common/inc,
nvidia/, nvidia-drm/, nvidia-uvm/), so it should equally fix the
proprietary nvidia-kernel-dkms build against 7.x, but I have not built
that flavor and cannot confirm. The issue matches #1135362, which was
filed against nvidia-kernel-dkms.

One further note: on 7.1.3 the final module link initially fails in
linux-kbuild's scripts/gen-btf.sh (7.1.3-1), where the awk-wrapper
PAHOLE variable is expanded without eval, so its embedded quoting
reaches awk verbatim. That affects all out-of-tree modules and is
reported separately with a patch as #1141979.

#1136776#24
Date:
2026-10-09 22:34:17 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
nvidia-graphics-drivers-tesla-470, 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 1136776@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Beckmann <anbe@debian.org> (supplier of updated nvidia-graphics-drivers-tesla-470 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: Fri, 09 Oct 2026 21:50:10 +0200
Source: nvidia-graphics-drivers-tesla-470
Architecture: source
Version: 470.256.02-10
Distribution: unstable
Urgency: medium
Maintainer: Debian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>
Changed-By: Andreas Beckmann <anbe@debian.org>
Closes: 1136776 1140326 1141674
Changes:
 nvidia-graphics-drivers-tesla-470 (470.256.02-10) unstable; urgency=medium
 .
   * Backport drm_atomic_commit_struct_present changes from 580.173.02 and
     strncpy changes from 580.178.04 to fix kernel module build for Linux 7.2.
   * Backport is_vma_write_locked_has_mm_lock_seq_arg changes from 580.142 and
     dma_fence_signal changes from 535.309.01 to fix kernel module build for
     Linux 7.0.  (Closes: #1136776, #1141674, #1140326)
Checksums-Sha1:
 ae5b75f72df07dbfb069127dcb7dc4b50970626b 7918 nvidia-graphics-drivers-tesla-470_470.256.02-10.dsc
 965da2f74630a93003730d9a17e23ed62d078f38 245240 nvidia-graphics-drivers-tesla-470_470.256.02-10.debian.tar.xz
 2f91046ee94bf1f066fd16cf3c2fffb697c54024 7666 nvidia-graphics-drivers-tesla-470_470.256.02-10_source.buildinfo
Checksums-Sha256:
 76cdce348f2ea40e44902cad130c414f107bcb8490e7cc0e5fee7723e47c8324 7918 nvidia-graphics-drivers-tesla-470_470.256.02-10.dsc
 c05d60926d5fc604f06384e881db9348c067018a8ba639562e03329d7f55ca19 245240 nvidia-graphics-drivers-tesla-470_470.256.02-10.debian.tar.xz
 a90988ca440a2424307ab7ca7cc1ac4fe6f6955825a1769062efc49dd31989ca 7666 nvidia-graphics-drivers-tesla-470_470.256.02-10_source.buildinfo
Files:
 624e9ad2acd5e557324fc4b1a29f02b1 7918 non-free/libs optional nvidia-graphics-drivers-tesla-470_470.256.02-10.dsc
 aec6fb52bd96f7046d9667d7363b37ed 245240 non-free/libs optional nvidia-graphics-drivers-tesla-470_470.256.02-10.debian.tar.xz
 8837c14d4364be82e67610dbebbb3c35 7666 non-free/libs optional nvidia-graphics-drivers-tesla-470_470.256.02-10_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCgAuFiEE6/MKMKjZxjvaRMaUX7M/k1np7QgFAmrJZtAQHGFuYmVAZGVi
aWFuLm9yZwAKCRBfsz+TWentCL+MEACi1WNdyklnDDfPXJnojkB3ew3zvh5QDFxM
vweH+e/Vv+LLVifxhsX2zYCFm2zktOK0ZjZtrPkB9ceJSX2pPnQ6MPPCc8XrX3vR
Tdtfus0A9xuKhnl4sw5V9Qm0ZwMpnFM5npbA9I3k95pIlPtKxNRUhw8xkoWKlhdU
Fgm3RqHAdKSXXIzt2zlnTZ2GTm9XN35L4Q7e+4i7bb4nUXDbyR3YYJNBvtP+3skQ
dAanehuXp58hnLgId+e2E/DIYV6KgfUGXiPXTHzqaqT/PMACuRw5IE8DfdS1nq2U
pzOxB96V3EE+AZdz9xBuMbtg2GHbMYGyCF7/YqBADXf13w+aK1lqGXEWfLFgKX8Y
E5NPQ+A3t+0z1gDOFtKke57YGRyddHrXPbTCeLdhWBz3FjMC1SgWD+Du8bVznnVO
X7Hr2RLMLD3iAZjZjfvYkbj6E/4lSeayXOMzfOCko9a2tRmOMIv4XR3lwrsoWcBJ
YF8dGkyx0bIHaexScBrtzIjtLfGCA/0sUH6Yy0499DVh1y8mAoH1jXErpS6+5Acr
cvhw16nHcDP8aczkNGKdMG3ueQhSI3e2BlJUhKlT1yiqjjBxycvm+GqMYjkPAMtx
DPSQ0zYIkYPfQygRtuGYjdrYIdwfjcOdTj49vpIyXna1S0paEpdD1qlYS5GEC9VC
UkQjM4SAMA==
=dNK6
-----END PGP SIGNATURE-----

#1136776#29
Date:
2026-10-09 22:34:17 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
nvidia-graphics-drivers-tesla-470, 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 1141674@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Beckmann <anbe@debian.org> (supplier of updated nvidia-graphics-drivers-tesla-470 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: Fri, 09 Oct 2026 21:50:10 +0200
Source: nvidia-graphics-drivers-tesla-470
Architecture: source
Version: 470.256.02-10
Distribution: unstable
Urgency: medium
Maintainer: Debian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>
Changed-By: Andreas Beckmann <anbe@debian.org>
Closes: 1136776 1140326 1141674
Changes:
 nvidia-graphics-drivers-tesla-470 (470.256.02-10) unstable; urgency=medium
 .
   * Backport drm_atomic_commit_struct_present changes from 580.173.02 and
     strncpy changes from 580.178.04 to fix kernel module build for Linux 7.2.
   * Backport is_vma_write_locked_has_mm_lock_seq_arg changes from 580.142 and
     dma_fence_signal changes from 535.309.01 to fix kernel module build for
     Linux 7.0.  (Closes: #1136776, #1141674, #1140326)
Checksums-Sha1:
 ae5b75f72df07dbfb069127dcb7dc4b50970626b 7918 nvidia-graphics-drivers-tesla-470_470.256.02-10.dsc
 965da2f74630a93003730d9a17e23ed62d078f38 245240 nvidia-graphics-drivers-tesla-470_470.256.02-10.debian.tar.xz
 2f91046ee94bf1f066fd16cf3c2fffb697c54024 7666 nvidia-graphics-drivers-tesla-470_470.256.02-10_source.buildinfo
Checksums-Sha256:
 76cdce348f2ea40e44902cad130c414f107bcb8490e7cc0e5fee7723e47c8324 7918 nvidia-graphics-drivers-tesla-470_470.256.02-10.dsc
 c05d60926d5fc604f06384e881db9348c067018a8ba639562e03329d7f55ca19 245240 nvidia-graphics-drivers-tesla-470_470.256.02-10.debian.tar.xz
 a90988ca440a2424307ab7ca7cc1ac4fe6f6955825a1769062efc49dd31989ca 7666 nvidia-graphics-drivers-tesla-470_470.256.02-10_source.buildinfo
Files:
 624e9ad2acd5e557324fc4b1a29f02b1 7918 non-free/libs optional nvidia-graphics-drivers-tesla-470_470.256.02-10.dsc
 aec6fb52bd96f7046d9667d7363b37ed 245240 non-free/libs optional nvidia-graphics-drivers-tesla-470_470.256.02-10.debian.tar.xz
 8837c14d4364be82e67610dbebbb3c35 7666 non-free/libs optional nvidia-graphics-drivers-tesla-470_470.256.02-10_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCgAuFiEE6/MKMKjZxjvaRMaUX7M/k1np7QgFAmrJZtAQHGFuYmVAZGVi
aWFuLm9yZwAKCRBfsz+TWentCL+MEACi1WNdyklnDDfPXJnojkB3ew3zvh5QDFxM
vweH+e/Vv+LLVifxhsX2zYCFm2zktOK0ZjZtrPkB9ceJSX2pPnQ6MPPCc8XrX3vR
Tdtfus0A9xuKhnl4sw5V9Qm0ZwMpnFM5npbA9I3k95pIlPtKxNRUhw8xkoWKlhdU
Fgm3RqHAdKSXXIzt2zlnTZ2GTm9XN35L4Q7e+4i7bb4nUXDbyR3YYJNBvtP+3skQ
dAanehuXp58hnLgId+e2E/DIYV6KgfUGXiPXTHzqaqT/PMACuRw5IE8DfdS1nq2U
pzOxB96V3EE+AZdz9xBuMbtg2GHbMYGyCF7/YqBADXf13w+aK1lqGXEWfLFgKX8Y
E5NPQ+A3t+0z1gDOFtKke57YGRyddHrXPbTCeLdhWBz3FjMC1SgWD+Du8bVznnVO
X7Hr2RLMLD3iAZjZjfvYkbj6E/4lSeayXOMzfOCko9a2tRmOMIv4XR3lwrsoWcBJ
YF8dGkyx0bIHaexScBrtzIjtLfGCA/0sUH6Yy0499DVh1y8mAoH1jXErpS6+5Acr
cvhw16nHcDP8aczkNGKdMG3ueQhSI3e2BlJUhKlT1yiqjjBxycvm+GqMYjkPAMtx
DPSQ0zYIkYPfQygRtuGYjdrYIdwfjcOdTj49vpIyXna1S0paEpdD1qlYS5GEC9VC
UkQjM4SAMA==
=dNK6
-----END PGP SIGNATURE-----