GoogleCloudPlatform / compute-gpu-installation

Apache License 2.0
77 stars 35 forks source link

fail on ubuntu 22.04 #15

Closed brandus1 closed 1 year ago

brandus1 commented 2 years ago

Failed CC version check. Bailing out! simple running of the script throws:

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
  You are using:           cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

Compiler version check failed:

The major and minor number of the compiler used to
compile the kernel:

gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38

does not match the compiler used here:

cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It is recommended to set the CC environment variable
to the compiler that was used to compile the kernel.

The compiler version check can be disabled by setting
the IGNORE_CC_MISMATCH environment variable to "1".
However, mixing compiler versions between the kernel
and kernel modules can result in subtle bugs that are
difficult to diagnose.

*** Failed CC version check. Bailing out! ***

make[2]: *** [/var/lib/dkms/nvidia/495.46/build/Kbuild:194: cc_version_check] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1900: /var/lib/dkms/nvidia/495.46/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-1021-gcp'
make: *** [Makefile:80: modules] Error 2

Environment

To Reproduce just create an ubuntu 22.04 machine and run the official recommended installation using this script

Solution modified the script by adding --no-cc-version-check flag after sh NVIDIA-Linux-x86_64-470.103.01.run -s --dkms

tpdownes commented 2 years ago

An option here is to determine which gcc to intall based upon

$ cat /proc/version
Linux version 5.15.0-1021-gcp (buildd@lcy02-amd64-108) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #28-Ubuntu SMP Fri Oct 14 15:46:06 UTC 2022
$ apt install gcc-11-base=11.2.0-19ubuntu1 
...

the last command forces a downgrade if you have already installed 11.3

m-strzelczyk commented 2 years ago

@tpdownes Do you have any experience with this? Do you know if ignoring the version difference or forcing downgrade installation can cause the driver to malfunction?

@brandus1 Thank you for reporting this!

tpdownes commented 2 years ago

I would not rely on ignoring a compiler mismatch in general. I would either make sure the right kernel is installed (if available) or deliberately install an earlier gcc (presumably still available)

That said you could probably try to get away with ignoring the compiler mismatch in this case if you need progress now.