Skip to main content
Topic: Nvidia dkms module and kernel 6.8.9: gcc version mismatch (Read 798 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

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
Code: [Select]
...
[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

Code: [Select]
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
 
Keep it Simple. Simple is Secure, Simple is Beautiful.

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #1
yah,  gcc should be updated on the build server before the kernels are built.. at least when there's a major version bump..
if it's any consolation, arch have done the same: https://aur.archlinux.org/pkgbase/nvidia-470xx-utils?
short term solution is to downgrade gcc and gcc-libs and reinstall nvidia-*-xxx-dkms


Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #3
ok, but shouldn't that chroot have had it's gcc updated before the kernels were built?
presumably, it's just that kernel updates went through before the gcc one..
i mean, i get that it's not a huge priority, it only affects a couple of nvidia dkms packages..

EDIT: ah, looks like these nvidia drivers might need patching for gcc 14 anyways

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #4
for the moment I downgrade linux, linux-headers, gcc, gcc-libs, and put them to IgnorePkg in pacman.conf
Keep it Simple. Simple is Secure, Simple is Beautiful.

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #5
for the moment I downgrade linux, linux-headers, gcc, gcc-libs, and put them to IgnorePkg in pacman.conf
the 340 AUR build, which i presume you're using, has now been updated with a patch for gcc 14
there's also GCC-14 patches for 470 and 390 in their AUR comments, if artix packagers see this.
i can confirm the 470 patch works for me.


Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #7
kernel+linux-lts-headers 6.6.30-2
Code: [Select]
linux-lts 6.6.30-2
linux-lts-headers 6.6.30-2
gcc gcc-libs lib32-gcc-libs  13.2.1
Code: [Select]
home:[freeartist-artix]:~$ pacman -Ss gcc gcc-libs lib32-gcc-libs
system/lib32-gcc-libs 14.1.1+r1+g43b730b9134a-1 [installed: 13.2.1-6]
    32-bit runtime libraries shipped by GCC
home:[freeartist-artix]:~$ yay -Ss gcc gcc-libs lib32-gcc-libs
aur/lib32-gcc-libs-snapshot 15.0.1.snapshot20240505-1 (+0 0.00)
    32-bit runtime libraries shipped by GCC (snapshot)
aur/lib32-gcc-libs-git 13.0.0_r197401.g33be3ee36a7-1 (+15 0.00)
    32-bit runtime libraries shipped by GCC (git version)
system/lib32-gcc-libs 14.1.1+r1+g43b730b9134a-1 (31.4 MiB 113.0 MiB) (Installed: 13.2.1-6)
    32-bit runtime libraries shipped by GCC
home:[freeartist-artix]:~$
340.108 driver from AUR
Code: [Select]
yay -S nvidia-340xx-dkms or yay -S nvidia-340xx
yay -S nvidia-340xx-utils
yay -S lib32-nvidia-340xx-utils

i do not understand how and why buy 340.108 from AUR now working for me now
-=linux its buggy crap that have no antifool protection (c)=- :)
*linux is free software, and comes with ABSOLUTELY NO WARRANTY* :)
+ALL YOURS ACTIONS at Linux YOU DO at YOUR OWN RISK!+ :)

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #8
i do not understand how and why buy 340.108 from AUR now working for me now

Because the maintainer of AUR has already added the GCC 14 patch. If you still have 13.2.1 version then what exactly are you surprised at?

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #9
for the moment I downgrade linux, linux-headers, gcc, gcc-libs, and put them to IgnorePkg in pacman.conf
the 340 AUR build, which i presume you're using, has now been updated with a patch for gcc 14
there's also GCC-14 patches for 470 and 390 in their AUR comments, if artix packagers see this.
i can confirm the 470 patch works for me.

Still there is a GCC version mismatch. Nvidia-340xx-dkms driver build successfully with gcc 14.1 , but the linux kernel on artix repo is built with gcc 13.2. DKMS:
Code: [Select]
gcc-version-check failed:
Keep it Simple. Simple is Secure, Simple is Beautiful.

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #10

 but the linux kernel on artix repo is built with gcc 13.2. DKMS:[/code]

No its not.


.BUILDINFO of linux package:
Code: [Select]
installed = gcc-14.1.1+r1+g43b730b9134a-1-x86_64
installed = gcc-libs-14.1.1+r1+g43b730b9134a-1-x86_64

If you happen to have any kernel module from arch repos, thats your problem, since arch have a borked pkgver for the current gcc version.

Code: [Select]
artix: gcc-14.1.1+r1+g43b730b9134a-1      
arch: gcc-14.1.1+r1+g43b730b9134-1
                   


Our build system is way less error tolerant than arch build system.

 

Re: Nvidia dkms module and kernel 6.8.9: gcc version mismatch

Reply #11

the 340 AUR build, which i presume you're using, has now been updated with a patch for gcc 14
there's also GCC-14 patches for 470 and 390 in their AUR comments, if artix packagers see this.
i can confirm the 470 patch works for me.

Still there is a GCC version mismatch. Nvidia-340xx-dkms driver build successfully with gcc 14.1 , but the linux kernel on artix repo is built with gcc 13.2. DKMS:
Code: [Select]
gcc-version-check failed:
Try
install linux-lts kernel
Code: [Select]
pacman  -S linux-lts linux-lts-headers
updade grub and boot from lts kernel

gcc 13.2.1
Code: [Select]
downgrade gcc gcc-libs lib32-gcc-libs
340.108 deriver
Code: [Select]
yay -S nvidia-340xx-dkms
or
yay -S nvidia-340xx
yay -S nvidia-340xx-utils
yay -S lib32-nvidia-340xx-utils
yay -S opencl-nvidia-340xx
-=linux its buggy crap that have no antifool protection (c)=- :)
*linux is free software, and comes with ABSOLUTELY NO WARRANTY* :)
+ALL YOURS ACTIONS at Linux YOU DO at YOUR OWN RISK!+ :)