Unable to load the kernel module 'nvidia.ko'--Problem installing Nvidia 470.86 driver on Ubuntu 18.04

nvidia-installer.log (32.7 KB)

The error log says,
“The kernel was built with gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35.1, but the current compiler version is cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.”

but actually I have updated the gcc to 10.2.0. After running ‘gcc --version’ , it also said gcc (GCC) 10.2.0.

Also after balcklisting noveu lsmod | grep nouveau returns nothing. so it seems to be disabled.

I really can’t understand why the installation failed.

My laptop is MSI GF65 Thin Intel i7 10750H. The GPU is Nvidia rtx 3060. I’m not sure if it is due to dual graphics cards.

Any help is greatly appreciated.

You also need to switch to 10.2.0 regarding the cc symbolic link. Please check “update-alternatives”