Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wongjingping/35f9bb79f2bd6fa68f1f to your computer and use it in GitHub Desktop.
Save wongjingping/35f9bb79f2bd6fa68f1f to your computer and use it in GitHub Desktop.
Instructions for setting up CUDA and NVIDIA drivers for using GPU on CentOS
# rmb to export http_proxy, https_proxy before anything, and su - root
export http_proxy=...
export https_proxy=...
# update yum and install packages
yum update
yum install kernel-devel kernel-headers dkms
# disable Nouveau, by adding the following line to /etc/modprobe.d/blacklist.conf
blacklist nouveau
# reboot then set run-level to 3 (no GUI) for us to install NVIDIA driver
reboot
init 3
# download latest nvidia drivers from http://www.nvidia.com/Download/Find.aspx
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/352.79/NVIDIA-Linux-x86_64-352.79.run
sh NVIDIA-Linux-x86_64-352.79.run
# download and install latest cuda toolkit from https://developer.nvidia.com/cuda-downloads
wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-rhel7-7-5-local-7.5-18.x86_64.rpm
rpm -ivh cuda-repo-rhel7-7-5-local-7.5-18.x86_64.rpm
# add lines to update PATH and LD_LIBRARY_PATH in .bashrc (edit version numbers as appropriate)
export PATH=/usr/local/cuda-7.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
# test out installation
nvidia-smi # NVIDIA driver
nvcc -V # CUDA Toolkit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment