0

I am trying to install cuda 9.0 instead of cuda 9.2 as the tensorflow is not compatible with it. I tried the following:

aims@aims:~/Downloads$ sudo dpkg -i "cuda-repo-ubuntu1604_9.0.176-1_amd64(1).deb"
(Reading database ... 212533 files and directories currently installed.)
Preparing to unpack cuda-repo-ubuntu1604_9.0.176-1_amd64(1).deb ...
Unpacking cuda-repo-ubuntu1604 (9.0.176-1) over (9.0.176-1) ...
Setting up cuda-repo-ubuntu1604 (9.0.176-1) ...
aims@aims:~/Downloads$ sudo apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Ign:2 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  InRelease                                                                                                                                           
Hit:3 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial InRelease                                                                                                                                                          
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease                                                                                                                           
Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                                                                                     
Hit:6 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Release                                                                             
Hit:8 http://dl.google.com/linux/chrome/deb stable Release                                                                                     
Hit:9 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                                                      
Hit:11 http://archive.canonical.com xenial InRelease                                           
Hit:12 http://ppa.launchpad.net/nemh/systemback/ubuntu xenial InRelease 
Reading package lists... Done 
aims@aims:~/Downloads$ sudo apt-get install cuda
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cuda-9-2 cuda-command-line-tools-9-2 cuda-compiler-9-2 cuda-cublas-9-2 cuda-cublas-dev-9-2 cuda-cudart-9-2 cuda-cudart-dev-9-2 cuda-cufft-9-2 cuda-cufft-dev-9-2 cuda-cuobjdump-9-2 cuda-cupti-9-2 cuda-curand-9-2 cuda-curand-dev-9-2 cuda-cusolver-9-2 cuda-cusolver-dev-9-2
  cuda-cusparse-9-2 cuda-cusparse-dev-9-2 cuda-demo-suite-9-2 cuda-documentation-9-2 cuda-driver-dev-9-2 cuda-drivers cuda-gdb-9-2 cuda-gpu-library-advisor-9-2 cuda-libraries-9-2 cuda-libraries-dev-9-2 cuda-license-9-2 cuda-memcheck-9-2 cuda-misc-headers-9-2 cuda-npp-9-2
  cuda-npp-dev-9-2 cuda-nsight-9-2 cuda-nvcc-9-2 cuda-nvdisasm-9-2 cuda-nvgraph-9-2 cuda-nvgraph-dev-9-2 cuda-nvml-dev-9-2 cuda-nvprof-9-2 cuda-nvprune-9-2 cuda-nvrtc-9-2 cuda-nvrtc-dev-9-2 cuda-nvtx-9-2 cuda-nvvp-9-2 cuda-runtime-9-2 cuda-samples-9-2 cuda-toolkit-9-2
  cuda-tools-9-2 cuda-visual-tools-9-2
The following NEW packages will be installed:
  cuda cuda-9-2 cuda-command-line-tools-9-2 cuda-compiler-9-2 cuda-cublas-9-2 cuda-cublas-dev-9-2 cuda-cudart-9-2 cuda-cudart-dev-9-2 cuda-cufft-9-2 cuda-cufft-dev-9-2 cuda-cuobjdump-9-2 cuda-cupti-9-2 cuda-curand-9-2 cuda-curand-dev-9-2 cuda-cusolver-9-2
  cuda-cusolver-dev-9-2 cuda-cusparse-9-2 cuda-cusparse-dev-9-2 cuda-demo-suite-9-2 cuda-documentation-9-2 cuda-driver-dev-9-2 cuda-drivers cuda-gdb-9-2 cuda-gpu-library-advisor-9-2 cuda-libraries-9-2 cuda-libraries-dev-9-2 cuda-license-9-2 cuda-memcheck-9-2
  cuda-misc-headers-9-2 cuda-npp-9-2 cuda-npp-dev-9-2 cuda-nsight-9-2 cuda-nvcc-9-2 cuda-nvdisasm-9-2 cuda-nvgraph-9-2 cuda-nvgraph-dev-9-2 cuda-nvml-dev-9-2 cuda-nvprof-9-2 cuda-nvprune-9-2 cuda-nvrtc-9-2 cuda-nvrtc-dev-9-2 cuda-nvtx-9-2 cuda-nvvp-9-2 cuda-runtime-9-2
  cuda-samples-9-2 cuda-toolkit-9-2 cuda-tools-9-2 cuda-visual-tools-9-2
0 upgraded, 48 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/1,145 MB of archives.
After this operation, 2,642 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

As you can see that the Cuda 9.2 is getting reflected everywhere, even though I haven't added it. Previously I added but before going for 9.0 I have purged the cuda 9.2. But getting issues in installation. Kindly, help me.

2 Answers2

1

The repo http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/ contains 9.0, 9.1 and 9.2.

When you run sudo apt install cuda it will automatically pick the newest version. Instead, you should specify the version during the installation:

sudo apt install cuda-9-0

then put a hold on it after it is installed so that it doesn't try to upgrade it to the newest version in that repository when you run sudo apt upgrade in the future:

sudo apt hold cuda-9-0

I have thrown together an answer for installing all 3 versions of CUDA in 16.04 at https://askubuntu.com/a/1025949/231142

Terrance
  • 41,612
  • 7
  • 124
  • 183
0

When you installed cuda-repo-ubuntu1604_9.0.176-1_amd64(1).deb file then it added it's repository into /etc/apt/sources.list.d directory. Go to sources.list.d directory and delete them.

sudo rm /etc/apt/sources.list.d/cuda*
sudo apt update

Now it will not update to v9.2

  • Let me try it out – Jaffer Wilson Jul 12 '18 at 13:37
  • root@aims:/home/aims/Downloads# sudo apt-get install cudaReading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package cuda Getting this error what to do? – Jaffer Wilson Jul 12 '18 at 13:42
  • What do you want to do ?

    First install your cuda_9.0.deb file Then delete repository files from /etc/apt/sources.list.d/ Then sudo apt update That's all . Why are you trying sudo apt install cuda again. You have already installed. It will prevent the cuda from upgrading while running sudo apt upgrade.

    – Sanjay Prajapat Jul 12 '18 at 13:48
  • I haven't install it dear can't you see in my question. I am trying to install 9.0 not 9.2. the version 9.2 was already installed and I removed it then tried installing 9.0 – Jaffer Wilson Jul 12 '18 at 13:51