CUDA 10.1 Update 2 is compatible to gcc 7.3.0, mine is 7.4.0, is this the cause the installation failed?

I downloaded the cuda installer from here.

I ran the installer on Ubuntu 18.04 LTS (Bionic Beaver) with gcc 7.4.0.

and I got this error.

[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

[INFO]: Initializing menu
[INFO]: Setup complete
[INFO]: Components to install:
[INFO]: Driver
[INFO]: 418.87.00
[INFO]: Executing NVIDIA-Linux-x86_64-418.87.00.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-ver$
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed.
[ERROR]: Install of 418.87.00 failed, quitting

This table indicates the compatible gcc is 7.3.0, is this the reason causes installation failed? Do I need to reinstall or downgrade gcc?


Solution 1:

Open a new terminal environment with Ctrl+Alt+F2 and login as root. Stop the display manager in order to stop the X server and install the drivers successfully.

For me:

service gdm3 stop

To find out your display manager, you can try running

pgrep -l dm

Follow these steps for cleaning:

apt-get --purge -y remove 'cuda*'

apt-get --purge -y remove 'nvidia*'

apt autoremove -y

apt-get clean

reboot

Go to the CUDA download site. Click on Linux -> x86_64 -> Ubuntu -> 18.04 -> Deb (local) And follow the Installation Instructions.