How to solve "gcc version check failed" during NVidia driver - 04/11/2007, 13:51

installation in GNU/Linux
If you're seeing a message such as the one down here:

The CC version check failed:

The compiler used to compile the kernel (gcc 4.1) does not exactly match the
current compiler (gcc 4.2). 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.

Here's what's going on:

When the kernel was built (either by you or by your distribution), a previous version of GCC was the "current" one. The GNU/Linux kernel rejects modules that aren't compiled with the same version to avoid compatibility issues (AFAIK, correct me if I'm wrong), so if you recompile the NVidia kernel module with a different version of GCC (in the screenshot it's gcc 4.2 vs 4.1) it will be rejected. So? What can you do? Well, if you've still got installed the gcc version the module is asking for, it's as simple as aborting the instalation there, then setting the CC environment variable with the gcc the module is asking for, and running the installation again.

If you're using bash as your shell (the default in most GNU/Linux distros), simply type

gcc and press TAB to see the available gcc's in your system. You should be able to see the one the module is asking for (in this case, gcc-4.1).

Press CTRL+C to abort that command, since we don't want to run gcc.

Now simply type
export CC=gcc-VersionRequestedByNVidiaInstaller and press
ENTER (in this example, export CC=gcc-4.1 ).

And run the installation program again. Good luck!

(If you deinstalled the GCC version the module is asking for, don't worry. Just reinstall it again using your distro's packaging software, i.e. apt-get for debian/ubuntu, yum for red hat or yast for Suse, portage/ebuild/etc for gentoo.)

< Back to blog

This site doesn't use cookies, does not log IPs and does not track you in any way.