CUDA 10 installation problems on Ubuntu 18.04

I am new to Cuda and Ubunt and Nividai. I was using the PC ubunt 18.6 with Cuda 9 and nvidia-smi was working. I have tried to install cuda 10 . i found a script ti install it , the following is the script in

#!/bin/bash

Install CUDA Toolkit 10

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && sudo apt update
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb

sudo apt update
sudo apt install -y cuda

Install CuDNN 7 and NCCL 2

wget https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo dpkg -i nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb

sudo apt update
sudo apt install -y libcudnn7 libcudnn7-dev libnccl2 libc-ares-dev

sudo apt autoremove
sudo apt upgrade

Link libraries to standard locations

sudo mkdir -p /usr/local/cuda-10.0/nccl/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libnccl.so.2 /usr/local/cuda/nccl/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.7 /usr/local/cuda-10.0/lib64/

echo ‘If everything worked fine, reboot now.’

after i reboot , then i have tried o run my code it says no NVIDIA GPU device is present: /dev/nvidia0 does not exist.

nvidia-smi is not working any more , it says Failed to initialize NVML: Driver/library version mismatch.

I have an error form the system , in the following

Check if you are using third party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f
Transaction failed: The package system is broken
The following packages have unmet dependencies:

cuda-libraries-dev-10-1: Depends: libcublas-dev (>= 10.2.0.168) but it is not installed
cuda-samples-10-1: Depends: libcublas-dev (>= 10.2.0.168) but it is not installed
cuda-visual-tools-10-1: Depends: libcublas-dev (>= 10.2.0.168) but it is not installed

And this is my cuda version rifht now when i use the command nvcc --version i Got nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA Corporation Built on Fri_Nov__3_21:07:56_CDT_2017 Cuda compilation tools, release 9.1, V9.1.85

I hope any one can help me to get my old cuda version that was before and nvidia-smi to be working. Please also write for me the commands so i can use easily . I do not expereince in that stuff before . Thanks a lot

1 Like

you may have mixed runfile and package manager install methods

You might want to familiarize yourself with the contents of the linux install guide:

Why do not provide a secure installer for linux, i had never see that situation for windown. For windows the installation is in minutes, for linux days weeks years
wath is happening nvidia.

I just want to know too.

First of all, Ubuntu 18 LTS Desktop installation with 3rd party packages option installs the Nvidia graphic driver automatically. On bootup, Nvidia-smi nicely displays driver version 450 and CUDA 11.0 but I can not see CUDA at /usr/local. Official CUDA toolkit documentation is hell to follow. The document says about backward compatibility. However, in reality, the user suffers from two different installation methods. Why can we have a nice installation CLI like “sudo apt-install Nvidia-all-packages” which automatically removes conflicting previous installations and install the matching pairs of driver and CUDA together?

1 Like