tj777
December 20, 2025, 1:16pm
1
Dears,
Below is the snippet from my kali linux, kindly help if someone knows how to fix this error?
I think it’s on the “nvidia/nv-dmabuf.c:844:9: error: implicit declaration of function ‘dma_buf_attachment_is_dynamic’” as below:
Let me know if you need longer version of the log inside /var/lib/dkms/nvidia/570.153.02/build/make.log
Appreciate your help.
Thanks in advance.
nvidia/nv-dmabuf.c: In function ‘nv_dma_buf_map’:
nvidia/nv-dmabuf.c:844:9: error: implicit declaration of function ‘dma_buf_attachment_is_dynamic’ [-Wimplicit-function-declaration]
844 | dma_buf_attachment_is_dynamic(attachment) &&
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC [M] nvidia/nv-memdbg.o
CC [M] nvidia/nv-report-err.o
make[4]: *** [/usr/src/linux-headers-6.17.10+kali-common/scripts/Makefile.build:292: nvidia/nv-dmabuf.o] Error 1
make[4]: *** Waiting for unfinished jobs…
In file included from nvidia/nv.c:34:
nvidia/nv.c: In function ‘nvos_create_alloc’:
././common/inc/nv-linux.h:571:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
571 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:324:5: note: in expansion of macro ‘NV_KZALLOC’
324 | NV_KZALLOC(at, sizeof(nv_alloc_t));
| ^~~~~~~~~~
nvidia/nv.c: In function ‘nv_alloc_file_private’:
././common/inc/nv-linux.h:571:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
571 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:1003:5: note: in expansion of macro ‘NV_KZALLOC’
1003 | NV_KZALLOC(nvlfp, sizeof(nv_linux_file_private_t));
| ^~~~~~~~~~
nvidia/nv.c: In function ‘nvidia_ioctl’:
././common/inc/nv-linux.h:564:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
564 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:2398:5: note: in expansion of macro ‘NV_KMALLOC’
2398 | NV_KMALLOC(arg_copy, arg_size);
| ^~~~~~~~~~
././common/inc/nv-linux.h:564:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
564 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:2501:13: note: in expansion of macro ‘NV_KMALLOC’
2501 | NV_KMALLOC(nvlfp->attached_gpus, arg_size);
| ^~~~~~~~~~
nvidia/nv.c: In function ‘nv_map_guest_pages’:
././common/inc/nv-linux.h:564:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
564 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:3131:5: note: in expansion of macro ‘NV_KMALLOC’
3131 | NV_KMALLOC(pages, sizeof(struct page *) * page_count);
| ^~~~~~~~~~
nvidia/nv.c: In function ‘nv_alloc_kernel_mapping’:
././common/inc/nv-linux.h:564:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
564 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:3626:13: note: in expansion of macro ‘NV_KMALLOC’
3626 | NV_KMALLOC(pages, sizeof(struct page *) * page_count);
| ^~~~~~~~~~
nvidia/nv.c: In function ‘nv_post_event’:
././common/inc/nv-linux.h:578:37: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
578 | NV_MEMDBG_ADD(ptr, size);
| ^
nvidia/nv.c:3881:9: note: in expansion of macro ‘NV_KMALLOC_ATOMIC’
3881 | NV_KMALLOC_ATOMIC(nvet, sizeof(nvidia_event_t));
| ^~~~~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-6.17.10+kali-common/Makefile:2035: .] Error 2
make[2]: *** [/usr/src/linux-headers-6.17.10+kali-common/Makefile:260: __sub-make] Error 2
make[2]: Leaving directory ‘/var/lib/dkms/nvidia/570.153.02/build’
make[1]: *** [Makefile:260: __sub-make] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-6.17.10+kali-common’
make: *** [Makefile:115: modules] Error 2
If you performed the most basic search on this forum, you would immediately find, that kernels 6.16+ require driver v580+ ;-) (unless patched)
As a side note: why v570? nothing particularly wrong with this one, but there are better ones available. Again, a basic search would tell you that v575 is considered the most stable and fully supports both older (like Pascal) and new (Blackwell) GPUs (needs to be batched to work on kernels 6.16 as indicated above). If you want to go for an LTS one for Pascal, then v580 (has some problems however comparing to v575: see the feedback thread ). Finally if you have a Turing or newer GPU and want to go for bleeding edge then v590 (no support for Pascal anymore).
you can find patches for v575 in its feedback thread:
debian:
whatever distro @dinosaur is using:
For people who, like me, cannot run v580 due to its enormous amount of bugs, and prefer to stick with 575.64.05, attached is a patch for compiling the GPL modules of the latter against Linux 6.17.
nvidia-575.64.05-linux-6.17.patch.txt (8.2 KB)
…and if you want to go for kernel 6.18, then here is another patch from @dinosaur :
For people who, like me, cannot run v580 due to its enormous amount of bugs, and prefer to stick with 575.64.05, attached is a patch for compiling the GPL modules of the latter against Linux 6.18.
nvidia-575.64.05-linux-6.18.patch.txt (9.6 KB)
tj777
December 21, 2025, 5:46am
4
Dear morgwai666,
I appreciate your feedback.
That 570 was just automatically when doing the kali apt install dist-upgrade, I didn’t know anything.
Finally, I ended up uninstalling all old whatever drivers and reinstalled with the desired one.
Now I am using kernel 6.17 successfully with 5.90 NVIDIA driver.
Apologize for the search, I should have done that, but you gave me some keywords to let me be better in this new forum, which helps me a lot, thanks.
Here are the steps for the community
# remove all drivers
sudo dkms remove nvidia/570.153.02 --all
sudo apt remove --purge nvidia-*
sudo apt autoremove
# Add NVIDIA repository key
wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
# search for drivers we want to install
└─$ apt search nvidia-driver | grep ^nvidia-
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
nvidia-alternative/unknown 560.35.05-1 i386 [residual-config]
nvidia-detect/unknown 590.44.01-1 amd64
nvidia-driver/unknown 590.44.01-1 amd64
nvidia-driver-assistant/unknown 0.23.44.01-1 all
nvidia-driver-bin/unknown 560.35.05-1 amd64
nvidia-driver-cuda/unknown,now 590.44.01-1 amd64 [installed]
nvidia-driver-full/kali-rolling 550.163.01-4 amd64
nvidia-driver-libs/unknown 590.44.01-1 amd64
nvidia-driver-libs-i386/unknown 555.42.06-1 i386
nvidia-driver-pinning-580/unknown 580-5 all
nvidia-driver-pinning-580.105.08/unknown 580.105.08-1 all
nvidia-driver-pinning-590/unknown 590-5 all
nvidia-driver-pinning-590.44.01/unknown 590.44.01-1 all
nvidia-kernel-dkms/unknown,now 590.44.01-1 amd64 [installed,automatic]
nvidia-kernel-open/unknown 560.35.05-1 amd64
nvidia-kernel-open-dkms/unknown 590.44.01-1 amd64
nvidia-kernel-source/unknown 590.44.01-1 amd64
nvidia-open-kernel-dkms/kali-rolling 550.163.01-4 amd64
nvidia-open-kernel-source/kali-rolling 550.163.01-4 amd64
# Install latest driver WITH open kernel modules
sudo apt install nvidia-driver=590.44.01-1 nvidia-kernel-open-dkms=590.44.01-1
nvidia-cuda-toolkit
# Update initramfs
sudo update-initramfs -u
# Reboot
sudo reboot
tj777
December 21, 2025, 6:05am
5
Oh, forgot to tell how to verify it
└─$ dpkg -l | grep nvidia-kernel
ic nvidia-kernel-common 20240109+1 amd64 NVIDIA binary kernel module support files
ii nvidia-kernel-open-dkms 590.44.01-1 amd64 NVIDIA binary kernel module DKMS source open flavor
ii nvidia-kernel-support 590.44.01-1 amd64 NVIDIA binary kernel module support files
└─$ modinfo nvidia | grep version
version: 590.44.01
srcversion: 5E16B1FC70F7A43C0111BFE
vermagic: 6.17.10+kali-amd64 SMP preempt mod_unload modversions
└─$ lsmod | grep nvidia
nvidia_uvm 2248704 4
nvidia_drm 151552 2
nvidia_modeset 2097152 2 nvidia_drm
nvidia 16293888 169 nvidia_uvm,nvidia_modeset
drm_ttm_helper 16384 3 vmwgfx,nvidia_drm,xe
drm_client_lib 12288 4 vmwgfx,nvidia_drm,xe,i915
drm_kms_helper 258048 8 vmwgfx,drm_shmem_helper,drm_display_helper,drm_ttm_helper,nvidia_drm,drm_client_lib,xe,i915
drm 843776 30 vmwgfx,gpu_sched,intel_vpu,i2c_hid,drm_kms_helper,drm_exec,drm_gpuvm,drm_suballoc_helper,drm_shmem_helper,drm_display_helper,nvidia,drm_buddy,drm_ttm_helper,nvidia_drm,drm_client_lib,xe,i915,ttm
video 81920 4 msi_wmi,xe,i915,nvidia_modeset
Glad that you’ve made it work :)
tj777:
Apologize for the search
No worries: I pointed it out for you not to waste your time waiting for replies from others when all the answers are just a few clicks away ;-)
tj777
December 21, 2025, 9:00am
7
Appreciate the guide, will do that for the next future updates :)