Failed To Build Kernel Modules

Hello,
I am having troubles installing the nvidia driver,
I downloaded the driver corresponding to my card & I keep on getting this error

ERROR: An error occurred while performing the step: "Building kernel modules".

System Info:
Kernel Version: 6.11.2-amd64
gcc (Debian 14.2.0-6) 14.2.0
Driver Version 470.256.02
nvidia-bug-report.log.gz (153.4 KB)

└─$ lspci -s 3:00.0 -v
03:00.0 VGA compatible controller: NVIDIA Corporation GK106GL [Quadro K4000] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: NVIDIA Corporation Device 097c
        Physical Slot: 2
        Flags: bus master, fast devsel, latency 0, IRQ 11, NUMA node 0, IOMMU group 50
        Memory at f2000000 (32-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Memory at f0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 8000 [size=128]
        Expansion ROM at 000c0000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel modules: nouveau

I also created this file to remove the nouveau kernel, which was not removed somehow

cat /etc/modprobe.d/blacklist-nouveau.conf 
blacklist nouveau 
options nouveau modset =0

Then I updated initramfs successfully & rebooted
$ sudo update-initramfs -u

Whenever I run the lspci -s 3:00.0 -v command, I still get the same result with the novoue kernel
maybe that is the conflict ?

Could it be because the 470.256.02 driver does not support the 6.11.2 kernel? Last month, after I upgraded the kernel to 6.11.2 in Kali Purple, the graphics card driver 470.256.02 failed to build when it was installed.

Without patches the last kernel 470 will build against is the 6.9.x branch, so if not patching your best bet is the long-term-support 6.6.x branch instead (6.9 is EOL, 6.6.x will keep getting releases until December 2026).

Also (as far as I know), NVIDIA’s support for 470 ended in September 2024 so that’s unlikely to get updated again.