Skip to content

Instantly share code, notes, and snippets.

@lucwj
Forked from knzm/cuda.env
Created June 30, 2017 06:39
Show Gist options
  • Save lucwj/371ce4979aa5d5c8232a729b6285ba68 to your computer and use it in GitHub Desktop.
Save lucwj/371ce4979aa5d5c8232a729b6285ba68 to your computer and use it in GitHub Desktop.
install CUDA 7.0 and cuDNN 6.5 v2 on CentOS 7.0
export CUDA_HOME=/usr/local/cuda
export NVIDIA_HOME=/usr/local/nvidia
export PATH=${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
[cuda]
name=cuda
baseurl=http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA
#!/bin/sh -e
### runtime
NVIDIA_GPGKEY_SUM=bd841d59a27a406e513db7d405550894188a4c1cd96bf8aa4f82f1b39e0b5c1c
curl -fsSL http://developer.download.nvidia.com/compute/cuda/repos/GPGKEY \
| sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA
echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict -
cp cuda.repo /etc/yum.repos.d/cuda.repo
CUDA_VERSION=7.0
CUDA_PKG_VERSION=7-0-7.0-28
yum install -y \
cuda-nvrtc-$CUDA_PKG_VERSION \
cuda-cusolver-$CUDA_PKG_VERSION \
cuda-cublas-$CUDA_PKG_VERSION \
cuda-cufft-$CUDA_PKG_VERSION \
cuda-curand-$CUDA_PKG_VERSION \
cuda-cusparse-$CUDA_PKG_VERSION \
cuda-npp-$CUDA_PKG_VERSION \
cuda-cudart-$CUDA_PKG_VERSION
ln -s cuda-$CUDA_VERSION /usr/local/cuda
echo "/usr/local/cuda/lib" >> /etc/ld.so.conf.d/cuda.conf
echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf.d/cuda.conf
ldconfig
cp cuda.env /etc/profile.d/cuda.sh
. /etc/profile.d/cuda.sh
### devel
yum install -y \
cuda-core-$CUDA_PKG_VERSION \
cuda-misc-headers-$CUDA_PKG_VERSION \
cuda-command-line-tools-$CUDA_PKG_VERSION \
cuda-license-$CUDA_PKG_VERSION \
cuda-cublas-dev-$CUDA_PKG_VERSION \
cuda-cufft-dev-$CUDA_PKG_VERSION \
cuda-curand-dev-$CUDA_PKG_VERSION \
cuda-cusparse-dev-$CUDA_PKG_VERSION \
cuda-npp-dev-$CUDA_PKG_VERSION \
cuda-cudart-dev-$CUDA_PKG_VERSION \
cuda-driver-dev-$CUDA_PKG_VERSION
### cuDNN
CUDNN_VERSION=2
CUDNN_DOWNLOAD_SUM=4b02cb6bf9dfa57f63bfff33e532f53e2c5a12f9f1a1b46e980e626a55f380aa
curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v2/cudnn-6.5-linux-x64-v2.tgz -O
echo "$CUDNN_DOWNLOAD_SUM cudnn-6.5-linux-x64-v2.tgz" | sha256sum -c --strict -
tar -xzf cudnn-6.5-linux-x64-v2.tgz
cp -a cudnn-6.5-linux-x64-v2/cudnn.h /usr/local/cuda/include/
cp -a cudnn-6.5-linux-x64-v2/libcudnn* /usr/local/cuda/lib64/
rm -rf cudnn-6.5-linux-x64-v2*
ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment