Problem while installing cuda toolkit in ubuntu 18.04

After following all the instructions in CUDA Toolkit 11.1 Downloads, the last instruction

sudo apt-get -y install cuda

doesn't work for me.

Terminal shows this message:

The following packages have unmet dependencies: cuda : Depends: cuda-11-1 (>= 11.1.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

PS: I have an NVIDIA GTX 1660TI card in my computer.

Any solution please?

3

5 Answers

I just ran into this issue and solved it by running the following commands:

sudo apt clean
sudo apt update
sudo apt purge nvidia-*
sudo apt autoremove
sudo apt install -y cuda

Major thanks to this post on the Nvidia forums.

3

I think the issue is the CUDA driver version. It looks like the installer tries to install the newest version 455.23.05 and the installation actually fails there.

I've solved it by first downloading the local installer and unselecting the CUDA driver installation, so it just installs the toolkit.

wget
chmod +x cuda_11.1.0_455.23.05_linux.run
sudo ./cuda_11.1.0_455.23.05_linux.run 

In the menu unselect the driver installation:enter image description hereIf not already done, add the nvidia repo as per instructions from the official website before installing the driver:

wget
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys
sudo add-apt-repository "deb /"
sudo apt-get update

Install the CUDA driver 450 manually:

sudo apt-get install cuda-drivers-450

Test by runningnvcc -VIn case nvcc is not found, don't forget to add it to your PATH:PATH=$PATH:/usr/local/cuda/bin

3

You have to uninstall any nvidia driver before running sudo apt install -y cuda
To do so, got to "Software & Updates" -> "Additional drivers" -> Using X.Org X (nouveou)

1

As in the previous post, I run this for Ubuntu 20.04 Nvidia Quadro P520:

sudo apt clean
sudo apt update
sudo apt purge nvidia-*
sudo apt autoremove

Reboot your PC and run this:

sudo apt install -y cuda
2

What helped me in resolving this issue is that I installed up to dated version of the nvidia driver with command "sudo apt install nvidia-driver-NNN" and then pointed on it to be used from the Software & Updates - Additional Drivers

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like