Package: nvidia-kernel-dkms Version: 590.x (confirmed also on
580.126.20) Severity: important

== ROOT CAUSE ==

The NVIDIA Makefile checks for scripts/pahole-flags.sh to decide
whether to inject a custom PAHOLE variable containing an awk
one-liner:

PAHOLE_VARIABLES=$(if $(wildcard
$(KERNEL_SOURCES)/scripts/pahole-flags.sh),, "PAHOLE=$(AWK)
'$(PAHOLE_AWK_PROGRAM)'")

Debian kernels >= 7.0.4 no longer ship scripts/pahole-flags.sh —
pahole flag handling moved to scripts/Makefile.btf (with
CONFIG_DEBUG_INFO_BTF_MODULES=y enabled by default). NVIDIA does not
detect this and injects:

PAHOLE="awk 'BEGIN { pahole_cmd = "pahole"; ... }'"

Kernel 7.0.4 ships a new scripts/gen-btf.sh which invokes ${PAHOLE}
directly in the shell. Shell variable expansion does NOT re-parse
quotes, so awk receives 'BEGIN (literal apostrophe + BEGIN) as its
program argument and errors out:

BTF [M] nvidia-modeset.ko awk: line 1: 'BEGIN awk: line 1: ^ invalid
char in expression make[4]: *** [scripts/Makefile.modfinal:62:
nvidia-modeset.ko] Error 1

== FIX ==

Creating a stub scripts/pahole-flags.sh in the kernel headers causes
NVIDIA to leave PAHOLE_VARIABLES empty. PAHOLE then defaults to the
system pahole binary, which works correctly with PAHOLE_FLAGS already
exported by Makefile.btf.

The permanent fix in the package would be to patch the NVIDIA Makefile
to replace the awk-in-variable approach with a proper wrapper script,
or to extend the detection to also check for Makefile.btf.

A workaround script is available at:
https://github.com/SoplosLinux/nvidia-patches/tree/main/kernel-debian-7.0.4

== AFFECTED ==

nvidia-kernel-dkms 580.126.20 and 590.x on Linux 7.0.4+deb14-amd64
with CONFIG_DEBUG_INFO_BTF_MODULES=y (Debian default). Linux <= 7.0.3
unaffected (gen-btf.sh not yet present).

== NOTE ==

The 580 branch is required for Maxwell (GTX 900) GPUs not supported by
590+. The same root cause affects the 590 branch maintained in Debian.

Regards, Sergi Perich

Reply via email to