Install NVIDIA Graphics Card + Cuda 8.0/9.1 on Ubuntu

[ Install NVidia Graphics Card on Ubuntu ]

Install Proprietary Nvidia GPU Drivers on Ubuntu 16.04 / 17.10 / 18.04

  • sudo add-apt-repository ppa:graphics-drivers/ppa
  • sudo apt update
  • sudo apt install nvidia-390

[ Install Cuda 9.1 ]

https://developer.nvidia.com/cuda-91-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704&target_type=deblocal

  1. `sudo dpkg -i cuda-repo-ubuntu1704-9-1-local_9.1.85-1_amd64.deb`
  2. `sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub`
  3. `sudo apt-get update`
  4. `sudo apt-get install cuda`

install by .run

  1. Run `sudo sh cuda_9.1.85_387.26_linux.run`
  2. Follow the command-line prompts

[Error #1] No OpenGL Lib

Missing recommended library: libGLU.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so

Solution: apt-get install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev

[Error #2] Gcc : cuda 9.1 supports lower version of gcc (6)

Error: unsupported compiler: 7.3.0. Use –override to override this check.
Error: cannot find Toolkit in /usr/local/cuda-9.1

https://stackoverflow.com/questions/34670989/cuda-7-5-installation-unsupported-compiler-error

For gcc 6 do:

sudo apt-get install gcc-6
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10

For g++ 6 do:

sudo apt-get install g++-6
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10

[Set Path]

Please make sure that
– PATH includes /usr/local/cuda-9.1/bin
– LD_LIBRARY_PATH includes /usr/local/cuda-9.1/lib64, or, add /usr/local/cuda-9.1/lib64 to /etc/ld.so.conf and run ldconfig as root

[Additional Path]

add path /usr/local/cuda-9.1/bin to environmental variables $PATH

sudo vi /etc/sudoers

sudo vi/etc/environment

 

 

 

 

 

 

[Text Below Here is not Reliable]

[ Install Cuda 9.2 ]

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1710&target_type=deblocal

  1. `sudo dpkg -i cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64.deb`
  2. `sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub`
  3. `sudo apt-get update`
  4. `sudo apt-get install cuda`

When I couldn’t install cuda 9.2 with the above commands, I could re-run the commands after this

https://devtalk.nvidia.com/default/topic/1032886/unable-to-properly-install-uninstall-cuda-on-ubuntu-18-04/

  1. sudo dpkg i forceoverwrite /var/cudarepo92local/nvidia396_396.370ubuntu1_amd64.deb

 

 

[ NVCC is missing ]

/bin/sh: 1: nvcc: not found

.bashrc

add

export PATH=$PATH:/usr/local/cuda/bin/

 

[ Install Cuda 8.0 ]

https://developer.nvidia.com/cuda-80-ga2-download-archive

Installation Instructions:
  1. `sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb`
  2. `sudo apt-get update`
  3. `sudo apt-get install cuda`
  4. `sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8.0.61-1_amd64′

 

 

[ Nsight does not work ]

https://stackoverflow.com/questions/41068508/cannot-launch-nvidia-nsight

sudo apt install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-installer

Leave a Reply