Error compile drive Slackware64 14.2 kernel 5.0

Hi !

I’m trying to compile nvidia drive in slackware 14.2 kernel 5.0 but an error occurs:

/tmp/nvidia-4568/nv-drm.c: In function ‘nv_alloc_os_descriptor_handle’:
/tmp/nvidia-4568/nv-drm.c:255:5: error: implicit declaration of function ‘drm_gem_object_unreference_unlocked’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
/usr/src/linux-5.0.9/scripts/ recipe for target ‘/tmp/nvidia-4568/nv-drm.o’ failed
make[3]: *** [/tmp/nvidia-4568/nv-drm.o] Error 1
/usr/src/linux-5.0.9/Makefile:1576: recipe for target ‘module/tmp/nvidia-4568’ failed
make[2]: *** [module/tmp/nvidia-4568] Error 2
make[2]: Leaving directory ‘/usr/src/linux-5.0.9’
Makefile:171: recipe for target ‘sub-make’ failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory ‘/usr/src/linux-5.0.9’
nvidia.ko failed to build!
Makefile:192: recipe for target ‘nvidia.ko’ failed
make: *** [nvidia.ko] Error 1
-> Error.
ERROR: Unable to build the NVIDIA kernel module interface.
ERROR: Unable to add a precompiled kernel interface for the running kernel.

Any suggestions to solve?

nvidia-installer.log (150 KB)


I am not an expert, but this thread might shed some light on your issue:


Devtalk Community Manager

Like TomK mentioned, the 340 driver has not yet been adjusted by Nvidia to compile against the 5.0 kernel. So you can either downgrade the kernel or use a patch e.g. from Arch
using the --apply-patch option of the installer.