There was an update in my Ubuntu 22.04.03 LTS OS last week, and my nvidia-515 with cuda 11.7 broke. On reinstalling, it fails. I'm stuck, tried to debug and inspect logs - which points to version mismatch, but the versions are indeed the same 11.4.0.
Is it the name that needs some change. Forcing alias of cc and gcc to x86_64 also hasn't change anything. Tried multiple iterations with reboots after each attempt, to no avail. Sadly using "apt install nvidia-driver-515" is not an option because it install 525 due to its transition. Have a hard need for driver-515 with cuda 11.7.
$ sudo ./cuda_11.7.0_515.43.04_linux.run
[Error - listed in nvidia-installer.log below]
$ vim /var/log/nvidia-installer.log
...
The kernel was built by: x86_64-linux-gnu-gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
You are using: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
$ ll /usr/bin/gcc
lrwxrwxrwx 1 root root 32 Aug 20 09:53 /usr/bin/gcc -> /usr/bin/x86_64-linux-gnu-gcc-11*
$ ll /usr/bin/cc
lrwxrwxrwx 1 root root 20 Aug 20 09:16 /usr/bin/cc -> /etc/alternatives/cc*
$ ll /etc/alternatives/cc
lrwxrwxrwx 1 root root 12 Aug 20 09:16 /etc/alternatives/cc -> /usr/bin/gcc*
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
$ x86_64-linux-gnu-gcc-11 --version
x86_64-linux-gnu-gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy