3

When trying to install cuda-10-2 which includes the 460 nivida driver, the following error appears.

INFO:Enable nvidia DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/dell_latitude DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here Loading
new nvidia-460.32.03 DKMS files... Building for 5.4.0-64-generic
Building for architecture x86_64 Building initial module for
5.4.0-64-generic Error! Bad return status for module build on kernel: 5.4.0-64-generic (x86_64) Consult /var/lib/dkms/nvidia/460.32.03/build/make.log for more information.
Setting up nvidia-driver-460 (460.32.03-0ubuntu1) ...

It seems that the driver is incompatible with the kernel.

Hannu
  • 5,374
  • 1
  • 23
  • 40
  • There are working instructions here for installing CUDA, after getting the Nvidia drivers from the standard repositories (460.32.03 to date). Use the ...run file and skip the Nvidia drivers it supplies. – ubfan1 Jan 26 '21 at 05:07
  • Using update-alternatives to change the gcc version is a terrible idea, because when the system tries to use the wrong version gcc to update a video driver (or any other driver needing the 9.3 version gcc), no surprise that it fails. Keep the 9.3 the default, install the 8.4, but put links in your cuda/bin/gcc to use the gcc-8 (and ...cuda/bin is first in your PATH as recommended). – ubfan1 Jan 27 '21 at 06:05
  • Same but withi 20.04 there is some nvidia-settings conflict possibly – mathtick Feb 21 '21 at 12:53

1 Answers1

0

I could solve my problem doing this - removing all nvidia drivers, installing gcc-8 using this sequence of commands:

sudo apt-get autoremove --purge nvidia-*
sudo apt-get autoremove --purge nvidia-driver-*
sudo apt install gcc-8
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-8 10
sudo apt-get install --reinstall linux-headers-$(uname -r)
sudo apt-get install nvidia-driver-460
reboot