Return to Level1Techs.com

Watch out, there's a GCC version mismatch on 18.04.2 Bionic

#1

Seems like the current HWE and LTS kernels have NOT been updated to the version of GCC that Bionic Updates is now pushing which is 7.4.0-1ubuntu1~18.04. This is a nightmare for manual Nvidia driver installation because the GCC versions have to match exactly.

No word on if new kernels will be built on the new version from bionic-updates to correct this issue, so if you’re still on 7.3.0-16ubuntu3, DO NOT UPDATE if you run Nvidia at all. Hold gcc, cpp, g++, gcc-7, cpp-7, and g++-7.

If it’s too late, run your Nvidia installer with -A to list arguments you can run the installer with. Most likely the one you want is --no-cc-version-check

If you’re running KDE or Kubuntu, let gcc-8 update, because what you care about is gcc --version being 7.3.0. Holding gcc-8 will break all KDE components, and on Kubuntu, break apt, so DO NOT HOLD gcc-8 if you run Kubuntu 18.04.

5 Likes

#2

Can’t believe something this big was overlooked…

0 Likes

#3

So far the only thing anal about GCC versions matching is the Nvidia driver if installed manually and not from a PPA.

0 Likes

#4

We faced same issue. The solution is to install latest kernel from mainline archive:

# ubuntu-mainline-kernel.sh -i v5.1.2

Then download latest nvidia driver:

NVIDIA-Linux-x86_64-430.14.run

Install gcc-8.

Update alternatives:

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 40

Tries to install (also in dkms), may be it is neccessary to start with a newer kernel:

./NVIDIA-Linux-x86_64-430.14.run
dkms build nvidia/430.14 -k 5.1.2-050102-generic
dkms install nvidia/430.14 -k 5.1.2-050102-generic
0 Likes

#5

New HWE kernel just got pushed out. Guess what /proc/version says?

Linux version 4.18.0-20-generic ([email protected]) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019

Nope. They’re not getting the memo that the bionic-updates GCC version mismatches their OOTB kernel.

I’m personally having to use the Vulkan Beta drivers and those ALWAYS work when the GCC version is the same.

0 Likes

#6

There is an another solution: ignore cc compiler version with:

--no-cc-version-check
# or
IGNORE_CC_MISMATCH=1

Nvidia driver says that it is better not to use it. I didn’t never tried to use unstable module (with ignoring cc mistmatch.

0 Likes

#7

The environment variable doesn’t get passed over to the dkms build instance in my case so only --no-cc-version-check works. Minor GCC version changes like from 7.3.0 to 7.4.0 are fine, but not 8.x.x vs 7.x.x.

0 Likes

#8

@FurryJackman Thank you for your update about “Minor GCC version changes” but it’s easier for me to install a more recent version of the GCC (kernel, driver) than to roll back to 7.3. At least I don’t want to downgrade. Now everything is working on Linux-5.1.2

It seems to me that linux-image-4.15.0-51-generic should be compiled gcc 7.4. But Canonical is not predictable.

0 Likes

#9

Okay, looks like a recent D9VK change let the cat out of the bag for “minor” GCC version changes. (I think???)

I brute force downgraded these packages via the Ubuntu Packages site and dpkg -i *.deb and DKMS built properly again:

cpp_7.3.0-3ubuntu2_amd64.deb
cpp-7_7.3.0-16ubuntu3_amd64.deb
g++_7.3.0-3ubuntu2_amd64.deb
g++-7_7.3.0-16ubuntu3_amd64.deb
gcc_7.3.0-3ubuntu2_amd64.deb
gcc-7_7.3.0-16ubuntu3_amd64.deb
gcc-7-base_7.3.0-16ubuntu3_amd64.deb
libasan4_7.3.0-16ubuntu3_amd64.deb
libcilkrts5_7.3.0-16ubuntu3_amd64.deb
libgcc-7-dev_7.3.0-16ubuntu3_amd64.deb
libgfortran4_7.3.0-16ubuntu3_amd64.deb
libstdc++-7-dev_7.3.0-16ubuntu3_amd64.deb
libubsan0_7.3.0-16ubuntu3_amd64.deb

Don’t do this if you’re uncomfortable doing so. There is an extremely high risk of breakage. Remember to hold your packages afterwards.

0 Likes