Prasyarat

  • Akun NVIDIA Developer

Panduan

  1. Unduh cuda disini dan cudnn disini
# Create directory
mkdir /root/nvidia; cd /root/nvidia/

# cuda
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda-repo-ubuntu1804-11-4-local_11.4.2-470.57.02-1_amd64.deb

# cudnn
wget -O cudnn-11.4-linux-x64-v8.2.4.15.tgz \
    https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.4/11.4_20210831/cudnn-11.4-linux-x64-v8.2.4.15.tgz?<download_token>
wget -O libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb \
    https://developer.download.nvidia.com/compute/machine-learning/cudnn/secure/8.2.4/11.4_20210831/cudnn-11.4-linux-x64-v8.2.4.15.tgz?<download_token>
wget -O libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb \
    https://developer.download.nvidia.com/compute/machine-learning/cudnn/secure/8.2.4/11.4_20210831/Ubuntu18_04-x64/libcudnn8-dev_8.2.4.15-1%2Bcuda11.4_amd64.deb?<download_token>
wget -O libcudnn8-samples_8.2.4.15-1+cuda11.4_amd64.deb \
    https://developer.download.nvidia.com/compute/machine-learning/cudnn/secure/8.2.4/11.4_20210831/Ubuntu18_04-x64/libcudnn8-samples_8.2.4.15-1%2Bcuda11.4_amd64.deb?<download_token>
  1. Pasang cuda
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
dpkg -i cuda-repo-ubuntu1804-11-4-local_11.4.2-470.57.02-1_amd64.deb
apt-key add /var/cuda-repo-ubuntu1804-11-4-local/7fa2af80.pub
apt-get update
apt-get -y install cuda
  1. Pasang cudnn library
# pasang cudnn library file
tar -xzvf cudnn-11.4-linux-x64-v8.2.4.15.tgz
cp cuda/include/cudnn*.h /usr/local/cuda/include 
cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64 
chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*

# pasang cudnn deb package
dpkg -i libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb
dpkg -i libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb
dpkg -i libcudnn8-samples_8.2.4.15-1+cuda11.4_amd64.deb
  1. Verifikasi driver NVIDIA
nvidia-smi

Referensi