-
Install NVIDIA drivers
-
Find NVIDIA driver download link for your system at http://www.nvidia.com/Download/index.aspx?lang=en-us
-
wget -P ~/Downloads/ http://us.download.nvidia.com/tesla/390.46/NVIDIA-Linux-x86_64-390.46.run
-
sudo rm /etc/X11/xorg.conf # It's ok if this doesn't exist
-
NVIDIA will clash with the nouveau driver so deactivate it:
$ sudo vim /etc/modprobe.d/blacklist-nouveau.conf
Type
i
to insert the following lines and save by doingEsc
then:wq
blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off
After saving the file, run
$ sudo update-initramfs -u $ sudo reboot # reboot will take a few minutes. After that, you can ssh back in
-
Install NVIDIA drivers. Note: The no-opengl-files option is important.
$ chmod +x ~/Downloads/NVIDIA-Linux-x86_64-390.46.run $ sudo sh ~/Downloads/NVIDIA-Linux-x86_64-390.46.run --no-opengl-files $ sudo reboot # reboot will take a few minutes $ sudo modprobe nvidia
-
-
Install CUDA
-
Find CUDA download link from https://developer.nvidia.com/cuda-downloads
-
Download & Install CUDA (and, optionally, any patches)
$ wget -P ~/Downloads/ https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux $ chmod +X ~/Downloads/cuda_9.1.85_387.26_linux $ sudo sh ~/Downloads/cuda_9.1.85_387.26_linux --override --no-opengl-libs
-
For recent versions of cuda (>10?):
[X] Driver [X] Toolkit [X] Samples [ ] Everything else
Yes to question about updating symbolic link at /usr/local/bin/cuda.
-
For older versions of cuda (9?):
- Hit q to go the bottom of the agreement.
- Type accept to accept the EULA
- Type n to NOT Install NVIDIA Accelerated Graphics Driver for Linux-x86_64
- Type y to Install the CUDA 8.0 Toolkit
- Enter toolkit location to be (default): /usr/local/cuda-8.0
- Yes to install a symbolic link at /usr/local/cuda
- Yes to install the CUDA 8.0 Samples
- Default location for CUDA Samples location: ~/Downloads
-
-
As recommended by the CUDA installer, update PATH and LD_LIBRARY_PATH in your
~/.bashrc
Note: Doesn't seem like
.bashrc
or.bash_profile
are loaded byscreen
.... is there a workaround? Otherwise you need to remember to runsource ~/.bashrc
whenever you open ascreen
.$ vim ~/.bashrc
Add the following environment variables and save:
export PATH=/usr/local/cuda-8.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH export CUDA_HOME=/usr/local/cuda
Now save the file and run:
$ source ~/.bashrc
-
-
Install cuDNN
-
Find Download link at https://developer.nvidia.com/cudnn
-
Download locally, then upload to your EC2 instance (using
scp
...) -
Then on your EC2 instance:
$ cd ~/Downloads $ tar -xzvf cudnn-8.0-linux-x64-v5.1.tgz $ sudo cp cuda/lib64/* /usr/local/cuda/lib64/ $ sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
-
Last active
May 28, 2019 22:36
-
-
Save colllin/d5c016fb0c7d482aca9d4b5204e01abb to your computer and use it in GitHub Desktop.
Install NVIDIA drivers & CUDA
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment