NVIDIA / NVIDIA/open-gpu-kernel-modules

[DKMS] Debian 13: Module build fails during kernel update due to non-executable .sh scripts in build directory

Open
#1,258 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

build-problem
Dominant language
C
Stars
17.4k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

NVIDIA Open GPU Kernel Modules Version

595.71.05

Operating System and Version

Description: Debian GNU/Linux 13 (trixie)

Kernel Release

Linux amr5 6.12.94+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.94-1 (2026-06-20) x86_64 GNU/Linux

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.
  • I am running on a stable kernel release.
Build Command

Just a standard DKMS build while updating to a new kernel version via apt

Terminal output/Build Log

Setting up linux-image-6.12.96+deb13-amd64 (6.12.96-1) ...
I: /initrd.img is now a symlink to boot/initrd.img-6.12.96+deb13-amd64
/etc/kernel/postinst.d/dkms:
Sign command: /lib/modules/6.12.96+deb13-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Autoinstall of module nvidia/595.71.05 for kernel 6.12.96+deb13-amd64 (x86_64)
Building module(s).........(bad exit status: 2)
Failed command:
'make' -j32 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=6.12.96+deb13-amd64 modules

Error! Bad return status for module build on kernel: 6.12.96+deb13-amd64 (x86_64)
Consult /var/lib/dkms/nvidia/595.71.05/build/make.log for more information.

Autoinstall on 6.12.96+deb13-amd64 failed for module(s) nvidia(10).

Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
dpkg: error processing package linux-image-6.12.96+deb13-amd64 (--configure):
installed linux-image-6.12.96+deb13-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-6.12.96+deb13-amd64:
linux-headers-6.12.96+deb13-amd64 depends on linux-image-6.12.96+deb13-amd64 (= 6.12.96-1) | linux-image-6.12.96+deb13-amd64-unsigned (= 6.12.96-1); however:
Package linux-image-6.12.96+deb13-amd64 is not configured yet.
Package linux-image-6.12.96+deb13-amd64-unsigned is not installed.

dpkg: error processing package linux-headers-6.12.96+deb13-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-6.12.96+deb13-amd64 (= 6.12.96-1); however:
Package linux-image-6.12.96+deb13-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-headers-amd64:
linux-headers-amd64 depends on linux-headers-6.12.96+deb13-amd64 (= 6.12.96-1); however:
Package linux-headers-6.12.96+deb13-amd64 is not configured yet.

More Info

When DKMS triggers an automated build for the NVIDIA kernel module during kernel updates (via dpkg / apt post-installation hooks), the process fails with a bad return status (exit code 2).

The root cause is that shell helper scripts (*.sh) located inside the DKMS build directory (/var/lib/dkms/nvidia//build/) lack executable permissions (0644 instead of 0755). When make attempts to execute them during the compilation phase, execution is denied.

Since sources are overwritten every install, only fixes like this helps:

while true; do chmod +x /var/lib/dkms/nvidia/595*/build/*.sh; done

Currently I fix it by adding PRE_BUILD="chmod +x *.sh" to /usr/src/nvidia-595.71.05/dkms.conf

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /usr/src/nvidia-595.71.05/dkms.conf and the shell scripts in /var/lib/dkms/nvidia//build; inspect how the DKMS build handles their permissions during a kernel update. Reproduce the standard DKMS build through the apt/dpkg kernel update flow, and consider the issue resolved when the NVIDIA module builds successfully without the manual chmod workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, shell
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.