Last active
August 22, 2023 19:18
-
-
Save fo40225/84f1ae3238692037b7b9381b91a845a6 to your computer and use it in GitHub Desktop.
install cuda 10 on ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf > /dev/null | |
# echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf > /dev/null | |
# sudo update-initramfs -u | |
sudo apt update | |
sudo apt -y install build-essential | |
sudo apt update | |
sudo apt -y install linux-headers-$(uname -r) | |
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64 | |
sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64 | |
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub | |
sudo apt update | |
sudo apt -y install cuda-10-0 | |
echo "export PATH=\"/usr/local/cuda-10.0/bin:\$PATH\"" >> ~/.bashrc | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7_7.6.0.64-1+cuda10.0_amd64.deb | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7-dev_7.6.0.64-1+cuda10.0_amd64.deb | |
sudo dpkg -i libcudnn7_7.6.0.64-1+cuda10.0_amd64.deb | |
sudo dpkg -i libcudnn7-dev_7.6.0.64-1+cuda10.0_amd64.deb | |
sudo apt update | |
sudo apt -y install libcudnn7=7.6.0.64-1+cuda10.0 libcudnn7-dev=7.6.0.64-1+cuda10.0 | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libnccl2_2.4.7-1+cuda10.0_amd64.deb | |
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libnccl-dev_2.4.7-1+cuda10.0_amd64.deb | |
sudo dpkg -i libnccl2_2.4.7-1+cuda10.0_amd64.deb | |
sudo dpkg -i libnccl-dev_2.4.7-1+cuda10.0_amd64.deb | |
sudo apt update | |
sudo apt -y install libnccl2=2.4.7-1+cuda10.0 libnccl-dev=2.4.7-1+cuda10.0 | |
# https://developer.nvidia.com/rdp/cudnn-download | |
tar axvf cudnn-10.0-linux-x64-v7.6.0.64.tgz | |
sudo mv cuda/include/cudnn.h /usr/local/cuda/include | |
sudo mv cuda/lib64/libcudnn* /usr/local/cuda/lib64 | |
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* | |
rm -rf cuda | |
# https://developer.nvidia.com/nccl/nccl-download | |
tar axvf nccl_2.4.7-1+cuda10.0_x86_64.txz | |
sudo mkdir /usr/local/cuda/lib | |
sudo mv nccl_2.4.7-1+cuda10.0_x86_64/include/nccl.h /usr/local/cuda/include | |
sudo mv nccl_2.4.7-1+cuda10.0_x86_64/lib/libnccl* /usr/local/cuda/lib | |
sudo chmod a+r /usr/local/cuda/include/nccl.h /usr/local/cuda/lib/libnccl* | |
rm -rf nccl_2.4.7-1+cuda10.0_x86_64 | |
sudo ldconfig | |
## if keyboard or mouse loses function after executing this script | |
## boot into emergency mode and | |
## sudo apt install -y xserver-xorg-input-all | |
## update driver only (for newer kernel) use a enough driver version to install | |
## sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb | |
## sudo apt install -y cuda-drivers | |
## online? | |
## wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin | |
## sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 | |
## sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
## sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" | |
## sudo apt-get update | |
## sudo apt-get -y install cuda-drivers cuda-10-0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment