Unable to install Ubuntu Driver for GeForce GTX1050 because of very specific gcc version requirement

I am Running Ubuntu 20.04

I installed a new GeForce GTX1050TI-4G graphics card.

Problem: my display provides only one display option now, even though I have two displays. The one display it does show provides only one resolution. And with that resolution everything is very grainy and virtually unusable.

I tried to update the driver and have failed.

I downloaded the following file from your site: NVIDIA-Linux-x86_64-510.54.run

In trying to use this file I ran across a whole host of issues, a few of which I think I resolved. Not sure. Anyway, the one I could not resolve was this: a complaint saying that my “gcc compiler version was 9.4.8, yet the kernel was compiled with gcc 9.3.0, do I wish to continue anyway?”. That sounded bad. I tried looking and looking for a way to get gcc version 9.3.0 installed on my machine. It eventually became so hard to do I gave up. Do you know how I can find and install a very specific gcc version like that? I could not locate any help on that. I could get help install “gcc-8” vs “gcc-9”, But nothing like “gcc 9.3.0 vs gcc 9.4.8”

Anyway, because I couldn’t do it, I went ahead and said “Yes” continue to try anyway.

Eventually it failed. It said: “ERROR: Unable to load the kernel module ‘nvidia-uvm.ko’. This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the kernel.” Yup shucks. Attached is the log file.

So the first thing I need help on is how to get that specific version.

But once I get it I will have another problem. I can no longer get the error message from the script complaining about gcc 9.3.0 vs 9.4.8. It just seems to skip that part and immediately try to compile. In fact what I am telling you about that warning is from memory, because I was unable to re-run the script and see that message afresh.

So any help as to how to proceed from here?


nvidia-installer.log (36.5 KB)

You shouldn’t use the runfile installer but the packaged driver. Please uninstall it by running it again with --uninstall option, the use Software&Updates application to install the driver.

Regarding the gcc mismatch, it’s a minor version mismatch which can be safely ignored/skipped.

Thanks. It finally started working.

I followed the instructions here:

Then after rebooting, and mysteriously waiting doing nothing for at least 5 minutes, the displays suddenly reset and everything worked.