clear cuda old driver
shell
sudo apt-get purge nvidia-*
sudo apt-get purge cuda*
sudo apt autoremoveinstall cuda
go to: https://developer.nvidia.com/cuda-toolkit-archive choose your version, such as install 11.7:
shell
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring*.deb
sudo apt-get update
sudo apt-get -y install cudashow cuda version
shell
nvcc --versionshow cuda status
shell
nvidia-smi -l 1install cunn
go to: https://developer.nvidia.com/rdp/cudnn-download choose cudnn version which mathed cuda version, such as 11.x:
shell
wget https://developer.nvidia.com/downloads/c118-cudnn-local-repo-ubuntu2204-8708410-1amd64deb
sudo cp /var/cudnn-local-repo-*/cudnn-local-*-keyring.gpg /usr/share/keyrings/
sudo apt-get install libcudnn8 libcudnn8-dev libcudnn8-samplesinstall pytoch
go to: https://pytorch.org/get-started/locally/ choose pytorch version which mathed cuda version, such as 1.13:
shell
wget https://download.pytorch.org/libtorch/cu117/libtorch-cxx11-abi-shared-with-deps-1.13.0%2Bcu117.zipreboot
shell
sudo reboot