Difference between revisions of "Nvidia Drivers and CUDA"

From Interaction Station Wiki
Jump to navigation Jump to search
(Created page with "==Installing CUDA 10.0 on Ubuntu 16.04== check nvidia drivers and cuda version: nvidia-smi Download the latest version of CUDA which is compatible with your version of driv...")
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
==Installing NVIDIA Driver (Ubuntu 16.04) ==
 +
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/410.57/NVIDIA-Linux-x86_64-410.57.run
 +
chmod +x NVIDIA-Linux-x86_64–410.57.run
 +
sudo ./NVIDIA-Linux-x86_64–410.57.run --no-x-check
 +
 +
 
==Installing CUDA 10.0 on Ubuntu 16.04==
 
==Installing CUDA 10.0 on Ubuntu 16.04==
 +
'''General Info'''
  
 
check nvidia drivers and cuda version:
 
check nvidia drivers and cuda version:
 +
nvcc --version
 
  nvidia-smi
 
  nvidia-smi
 +
*nvidia-settings
 +
  
 
Download the latest version of CUDA which is compatible with your version of drivers installed. For example, if you have installed a driver of 410 version, CUDA 10 can be installed, for 375 CUDA 8 should be installed.
 
Download the latest version of CUDA which is compatible with your version of drivers installed. For example, if you have installed a driver of 410 version, CUDA 10 can be installed, for 375 CUDA 8 should be installed.
 
CUDA 10.0 (10.0.130)                              >= 410.48 driver
 
CUDA 10.0 (10.0.130)                              >= 410.48 driver
  
Avoid CUDA 10.1, it conflicts with tensorflow-gpu
+
*Avoid CUDA 10.1!!!  It conflicts with tensorflow-gpu
  
Installing CUDA 10.0
 
  
First uninstall  previous versions of CUDA:
+
'''Steps:'''
    sudo apt-get --purge remove cuda-10.1
 
    sudo apt-get remove nvidia-cuda-toolkit
 
  
Then
+
'''1. Uninstall  previous versions of CUDA'''
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
+
sudo apt-get --purge remove cuda-10.1
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
+
sudo apt-get remove nvidia-cuda-toolkit
sudo apt-get update
 
sudo apt-get install cuda-10-0
 
  
 +
'''2. Then install:'''
 +
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
 +
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
 +
sudo apt-get update
 +
sudo apt-get install cuda-10-0
  
Steps here and installation file downloaded from here:
 
    https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
 
  
 +
Steps and installation file downloaded from here:
 +
https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
  
To verify Cuda installation:
+
'''3. Specify your cuda path (cuda 10.0 example)'''
nvcc --version
 
nvidia-smi
 
  
 +
sudo nano /home/interactionstation/.bashrc
  
Specify your cuda path (cuda 10.0 example)
+
locate the two lines regarding cuda9 (in case it was previously installed), comment them out and include instead:
export PATH=/usr/local/cuda-10.0/bin:$PATH
+
export PATH=/usr/local/cuda-10.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
+
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
  
Restart your computer.
+
'''4. Save the file'''
  
https://medium.com/@muskulpesent/install-cuda-on-ubuntu-16-04-67ec087f8561
 
  
 +
'''5. Restart the computer'''
  
sudo nano /home/interactionstation/.bashrc
 
  
locate the two lines regarding cuda9, comment them out and include instead
+
*Other methods:
export PATH=/usr/local/cuda-10.0/bin:$PATH
+
*https://medium.com/better-programming/how-to-install-nvidia-drivers-and-cuda-10-0-for-rtx-2080-ti-gpu-on-ubuntu-16-04-18-04-ce32e4edf1c0
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
 
  
Save the file
+
== Installing cuDNN (for ubuntu 16.04, cuda 10-0) ==
  
 +
'''1.Download the following:'''
  
 +
- runtime:
  
These instructions:
+
https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7-dev_7.6.4.38-1%2Bcuda10.0_amd64.deb
    https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
 
   
 
   
 
  
== Installing cuDNN (for ubuntu 16.04, cuda 10-0) ==
+
- developer
  
        Download the:
 
            - runtime
 
            https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7-dev_7.6.4.38-1%2Bcuda10.0_amd64.deb
 
    - developer
 
 
https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7_7.6.4.38-1%2Bcuda10.0_amd64.deb
 
https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7_7.6.4.38-1%2Bcuda10.0_amd64.deb
    - samples
+
 
 +
- samples
 +
 
 
https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7-doc_7.6.4.38-1%2Bcuda10.0_amd64.deb
 
https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7-doc_7.6.4.38-1%2Bcuda10.0_amd64.deb
and then:
+
 
   
+
'''2. and then, navigate to your <cudnnpath> directory containing cuDNN Debian file.'''
Navigate to your <cudnnpath> directory containing cuDNN Debian file.
+
 
Install the runtime library, for example:
+
'''3. Install the runtime library, for example:'''
sudo dpkg -i runtimefile.deb
+
sudo dpkg -i runtimefile.deb
Install the developer library, for example:
+
 
sudo dpkg -i devlib.deb
+
'''4. Install the developer library, for example:'''
Install the code samples and the cuDNN Library User Guide, for example:
+
sudo dpkg -i devlib.deb
sudo dpkg -i codesamples.deb
+
 
 +
'''5. Install the code samples and the cuDNN Library User Guide, for example:'''
 +
sudo dpkg -i codesamples.deb
 +
 
 +
 
 +
 
 +
More info:
 +
https://medium.com/@muskulpesent/install-cuda-on-ubuntu-16-04-67ec087f8561
 +
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
 +
 
 +
==Installing CUDA 9.0 on Ubuntu 16.04 (Old! Using 10.0, Nov 2019) ==
 +
 
 +
*wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
 +
*wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
 +
*wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
 +
*wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb
 +
*wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl-dev_2.1.4-1+cuda9.0_amd64.deb
 +
*sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
 +
*sudo dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
 +
*sudo dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
 +
*sudo dpkg -i libnccl2_2.1.4-1+cuda9.0_amd64.deb
 +
*sudo dpkg -i libnccl-dev_2.1.4-1+cuda9.0_amd64.deb
 +
*sudo apt-get update
 +
*sudo apt-get install cuda=9.0.176-1
 +
*sudo apt-get install libcudnn7-dev
 +
*sudo apt-get install libnccl-dev
 +
*sudo reboot now
 +
*export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
 +
*export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
 +
*sudo nano .bashrc
 +
*Add the two last export lines at the end of the file. Save and reboot.
 +
 
 +
'''Resources used:'''
 +
*https://askubuntu.com/questions/61396/how-do-i-install-the-nvidia-drivers
 +
*https://medium.com/@bbloks/a-machine-learning-environment-with-ubuntu-and-gpu-acceleration-in-5-steps-765608325356
 +
*https://yangcha.github.io/CUDA90/
 +
 
 +
*==Installing nvidia drivers on Ubuntu 16.04 (deprecated!) ==
 +
*Set Ubuntu to boot on console mode. Type:
 +
*sudo apt-get install systemd
 +
*sudo systemctl set-default multi-user.target
 +
*sudo reboot now
 +
*Login and in console mode, type:
 +
*sudo add-apt-repository ppa:graphics-drivers/ppa
 +
*sudo apt update
 +
*sudo apt upgrade
 +
*For GeForce 1070Ti (07/2018), type:
 +
*sudo apt-get install nvidia-390
 +
*Re-set Ubuntu to boot on graphical mode. Type:
 +
*sudo systemctl set-default graphical.target
 +
*sudo reboot now

Revision as of 22:49, 27 November 2019

Installing NVIDIA Driver (Ubuntu 16.04)

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/410.57/NVIDIA-Linux-x86_64-410.57.run
chmod +x NVIDIA-Linux-x86_64–410.57.run
sudo ./NVIDIA-Linux-x86_64–410.57.run --no-x-check


Installing CUDA 10.0 on Ubuntu 16.04

General Info

check nvidia drivers and cuda version:

nvcc --version 
nvidia-smi
  • nvidia-settings


Download the latest version of CUDA which is compatible with your version of drivers installed. For example, if you have installed a driver of 410 version, CUDA 10 can be installed, for 375 CUDA 8 should be installed. CUDA 10.0 (10.0.130) >= 410.48 driver

  • Avoid CUDA 10.1!!! It conflicts with tensorflow-gpu


Steps:

1. Uninstall previous versions of CUDA

sudo apt-get --purge remove cuda-10.1
sudo apt-get remove nvidia-cuda-toolkit

2. Then install:

sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda-10-0


Steps and installation file downloaded from here: https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal

3. Specify your cuda path (cuda 10.0 example)

sudo nano /home/interactionstation/.bashrc

locate the two lines regarding cuda9 (in case it was previously installed), comment them out and include instead:

export PATH=/usr/local/cuda-10.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH

4. Save the file


5. Restart the computer


Installing cuDNN (for ubuntu 16.04, cuda 10-0)

1.Download the following:

- runtime:

https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7-dev_7.6.4.38-1%2Bcuda10.0_amd64.deb

- developer

https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7_7.6.4.38-1%2Bcuda10.0_amd64.deb

- samples

https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.4.38/Production/10.0_20190923/Ubuntu16_04-x64/libcudnn7-doc_7.6.4.38-1%2Bcuda10.0_amd64.deb

2. and then, navigate to your <cudnnpath> directory containing cuDNN Debian file.

3. Install the runtime library, for example:

sudo dpkg -i runtimefile.deb

4. Install the developer library, for example:

sudo dpkg -i devlib.deb

5. Install the code samples and the cuDNN Library User Guide, for example:

sudo dpkg -i codesamples.deb


More info: https://medium.com/@muskulpesent/install-cuda-on-ubuntu-16-04-67ec087f8561 https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal

Installing CUDA 9.0 on Ubuntu 16.04 (Old! Using 10.0, Nov 2019)

Resources used:

  • ==Installing nvidia drivers on Ubuntu 16.04 (deprecated!) ==
  • Set Ubuntu to boot on console mode. Type:
  • sudo apt-get install systemd
  • sudo systemctl set-default multi-user.target
  • sudo reboot now
  • Login and in console mode, type:
  • sudo add-apt-repository ppa:graphics-drivers/ppa
  • sudo apt update
  • sudo apt upgrade
  • For GeForce 1070Ti (07/2018), type:
  • sudo apt-get install nvidia-390
  • Re-set Ubuntu to boot on graphical mode. Type:
  • sudo systemctl set-default graphical.target
  • sudo reboot now