After the last update to my Ubuntu 18.04 LTS system (which included a new Kernel build, and the regeneration of Initramfs), my NVIDIA Drivers resulted to be “broken”. This is a situation that, at least to me, occurred quite often in the past after updating. Usually my solution to this was to completely reinstall the Drivers, and everything went ok after that
This time, when trying to launch the usual ./NVIDIA-Linux-x86_64-418.56.run an error popped up:
The kernel was built with gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3), but the current compiler version is cc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
Apparently, the new Kernel is built using gcc 7.3, but the default Compiler on my machine remain 7.4, therefore the issue. To get past this, I had to manually specify the Compiler version to use:
CC=gcc-7.3.0 ./NVIDIA-Linux-x86_64-418.56.run
But having done this, I later got another exception:
ERROR: Unable to determine the version of the kernel sources located in ‘/lib/modules/4.15.0-48-generic/build’. Please make sure you have installed the kernel source files for your kernel and that they are properly configured […] you may specify the kernel source path with the ‘–kernel-source-path’ command line option
At this point, given that I know where the Kernel Source is located and that I know that the Kernel Headers are installed, I wanted to try the following as well:
CC=gcc-7.3.0 ./NVIDIA-Linux-x86_64-418.56.run --kernel-source-path=/usr/src/linux-headers-4.15.0-48-generic
But doing this resulted in the same exact error as just above. So I wanted to try playing around slightly modifying the Path to include, in the attempt to include the “kernel.h” file. I ended up with this version of the last command:
CC=gcc-7.3.0 ./NVIDIA-Linux-x86_64-418.56.run --kernel-source-path=/usr/src/linux-headers-4.15.0-48-generic/include
which resulted in a different exception again, this time maybe more explicit:
ERROR: The kernel header file ‘/usr/src/linux-headers-4.15.0-48-generic/include/include/linux/kernel.h’ does not exist. The most likely reason for this is that the kernel source path ‘/usr/src/linux-headers-4.15.0-48-generic/include/include’ is incorrect. […]
The problem is that after this last try I wasn’t able to make any progress. My system is unusable, and I’m completely out of ideas. Any help/inspiration/support from anybody who got past this would be greatly appreciated.
Thanks in advance!