ubuntu22.04 install cuda cudnn
https://blog.csdn.net/qq_49323609/article/details/130310522
is very good
1,first check driver
nvidia-smi
if no content ,show install driver first
two ways:
one is :
use apt-get like : https://blog.csdn.net/zxdd2018/article/details/127705627
ubuntu-drivers devices
sudo apt install nvidia-driver-515
another is : like https://blog.csdn.net/qq_49323609/article/details/130310522
从NVIDIA官网下载相应驱动
now i use the second method
--------------------------------------------------------------------------
check cuda
https://developer.nvidia.com/cuda-toolkit-archive
in the website shows offical ways to install cuda
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda'
----------------------------------------------------
install cudnn like :https://blog.csdn.net/qq_49323609/article/details/130310522
----------------------------------------------------------------
install conda
and install pytorch
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
----------------------------------------------------------------
install docker
https://zhuanlan.zhihu.com/p/373493938
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker
test use:
sudo docker run --rm --gpus all nvidia/cuda:12.1.1-base-ubuntu22.04 nvidia-sm
docker tags:
https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md