Last active
December 30, 2022 10:12
-
-
Save ziyan0302/7bf51ab7eff944198b2b90ee974f1f38 to your computer and use it in GitHub Desktop.
cuda11.7, nvidia510, tf2.11, pytorch1.13
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
#!/bin/bash | |
## check nvidia driver version | |
nvidia-smi | |
# 510 | |
## to uninstall cuda | |
# sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*" | |
# sudo apt-get --purge remove "*nvidia*" | |
# or | |
# /usr/local/cuda-11.7/bin/cuda-uninstaller | |
## cuda 11.7 | |
## head to link: | |
## https://developer.nvidia.com/cuda-11-7-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=runfile_local | |
wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run | |
sudo sh cuda_11.7.0_515.43.04_linux.run | |
# accept -> no driver | |
echo 'export PATH=/usr/local/cuda-11.7/bin:$PATH' >> ~/.bashrc | |
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc | |
source ~/.bashrc | |
sudo ldconfig | |
## cudnn_ubuntu20.04 | |
## for deb install: | |
sudo dpkg -i cudnn-local-repo-ubuntu2004-8.5.0.96_1.0-1_amd64.deb | |
sudo cp /var/cudnn-local-repo-ubuntu2004-8.5.0.96/cudnn-local-0579404E-keyring.gpg /usr/share/keyrings/ | |
sudo apt-get update | |
sudo apt-get install libcudnn8=8.5.0.96-1+cuda11.7 | |
sudo apt-get install libcudnn8-dev=8.5.0.96-1+cuda11.7 | |
sudo apt-get install libcudnn8-samples=8.5.0.96-1+cuda11.7 | |
# Finally, to verify the installation, check | |
nvidia-smi | |
nvcc -V | |
# install tnesorflow(2.11.0) | |
# tensorflow list: https://www.tensorflow.org/install/source#linux | |
pip3 install tensorflow | |
## check if tf can read GPU: tf.config.list_physical_devices("GPU") | |
# install Pytorch (an open source machine learning framework) | |
# I choose version 1.13.1 because it is stable and compatible with CUDA 11.7 Toolkit and cuDNN 8.1 | |
pip3 install torch torchvision torchaudio | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment