Nvidia dkms module and kernel 6.8.9: gcc version mismatch
updating my system DKMS hooks fail because: The compiler used to compile the kernel was gcc 13.2; the current compiler is gcc 14.1.
/var/log/pacman.log
...
[2024-05-09T04:42:36+0100] [ALPM-SCRIPTLET] ==> dkms install --no-depmod nvidia/340.108 -k 6.8.9-artix1-2
[2024-05-09T04:42:44+0100] [ALPM-SCRIPTLET] Error! Bad return status for module build on kernel: 6.8.9-artix1-2 (x86_64)
[2024-05-09T04:42:44+0100] [ALPM-SCRIPTLET] Consult /var/lib/dkms/nvidia/340.108/build/make.log for more information.
[2024-05-09T04:42:44+0100] [ALPM-SCRIPTLET] ==> WARNING: `dkms install --no-depmod nvidia/340.108 -k 6.8.9-artix1-2' exited 10
...
from /var/lib/dkms/nvidia/340.108/build/make.log
DKMS make.log for nvidia-340.108 for kernel 6.8.9-artix1-2 (x86_64)
Thu May 9 04:42:37 AM CET 2024
gcc-version-check failed:
You appear to be compiling the NVIDIA kernel module
with a different compiler than the one that was
used to compile the running kernel. The Linux 2.6
kernel module loader rejects kernel modules built
with a version of gcc that does not exactly match
that of the compiler used to build the running
kernel. The compiler used to compile the kernel
was gcc 13.2; the current compiler is gcc 14.1.
If you know what you are doing and want to override
the gcc version check, you can do so by setting the
IGNORE_CC_MISMATCH environment variable to "1".
In any other case, set the CC environment variable
to the name of the compiler that was used to compile
the kernel.
*** Failed CC version check. Bailing out! ***
make: *** [nvidia-modules-common.mk:201: build-sanity-checks] Error 1
make: Entering directory '/var/lib/dkms/nvidia/340.108/build/uvm'
cd ./..; make module SYSSRC=/lib/modules/6.8.9-artix1-2/build SYSOUT=/lib/modules/6.8.9-artix1-2/build KBUILD_EXTMOD=./..
make[1]: Entering directory '/var/lib/dkms/nvidia/340.108/build'
NVIDIA: calling KBUILD...
make[2]: Entering directory '/usr/lib/modules/6.8.9-artix1-2/build'
make --no-print-directory -C /usr/lib/modules/6.8.9-artix1-2/build \
-f /usr/lib/modules/6.8.9-artix1-2/build/Makefile modules
make -f ./scripts/Makefile.build obj=.. need-builtin=1 need-modorder=1
scripts/Makefile.build:41: ../Makefile: No such file or directory
make[4]: *** No rule to make target '../Makefile'. Stop.
make[3]: *** [/usr/lib/modules/6.8.9-artix1-2/build/Makefile:1921: ..] Error 2
make[2]: *** [Makefile:240: __sub-make] Error 2
make[2]: Leaving directory '/usr/lib/modules/6.8.9-artix1-2/build'
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [Makefile:202: nvidia.ko] Error 1
make[1]: Leaving directory '/var/lib/dkms/nvidia/340.108/build'
make: *** [Makefile:222: ../Module.symvers] Error 2
make: Leaving directory '/var/lib/dkms/nvidia/340.108/build/uvm'
latest linux kernel: 6.8.9-artix1-2
latest installed gcc: 14.1.1+r1+g43b730b9134a-1