CUDA & CuDNN - gkgkgk1215/else GitHub Wiki
CUDA install
-
Check compatibility: https://docs.nvidia.com/deploy/cuda-compatibility/#minor-version-compatibility
-
Select CUDA Version that fits your graphics driver and download it.
-
Use binary install as .deb automatically install the new graphics driver which we do not want to.
-
For both the SRI desktop and laptop (ASUS ROG GU603ZX with NVIDIA Geforce 3080 Ti), Cuda 11.0 is compatible: https://developer.nvidia.com/cuda-11.0-download-archive
-
PyTorch is not officially compatible with Cuda 12.2
-
Stop lightdm (GUI) and login to console (Ctrl+Alt+F1)
sudo service lightdm stop
- Remove previous CUDA before installation
sudo apt-get --purge remove 'cuda*'
sudo apt-get autoremove --purge 'cuda*'
- Go to the download path and run.
chmod +x cuda_11.8.0_520.61.05_linux.run
sudo ./cuda_11.8.0_520.61.05_linux.run
-
Follow guidelines of CUDA installer
-
Select 'No' when asked to install the graphics driver.
-
Edit .bashrc
export PATH=$PATH:/usr/local/cuda-11.0
export PATH=$PATH:/usr/local/cuda-11.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.0/lib64
Verify CUDA
git clone https://github.com/NVIDIA/cuda-samples
cd ~/cuda-samples/Samples/0_Introduction/asyncAPI/
make
./asyncAPI
- Successfully installed if you can see the below messages.
[./asyncAPI] - Starting...
GPU Device 0: "Ampere" with compute capability 8.6
CUDA device [NVIDIA GeForce RTX 3080 Ti Laptop GPU]
time spent executing by the GPU: 11.00
time spent by CPU in CUDA calls: 5.32
CPU executed 90042 iterations while waiting for GPU to finish
-
or just type
nvcc --version' or
nvidia-smi` -
Change configuration of "Software & Updates"
cuDNN Install (Find version that matches with the installed CUDA)
- cuDNN 9.2.1 is compatible for my laptop.
https://docs.nvidia.com/deeplearning/cudnn/latest/reference/support-matrix.html
Bug report
- If you are using RTX graphics driver, possibly you encounter "CUDNN_STATUS_INTERNAL_ERROR" or cudnn initialize error. Putting the following in the .bash file would resolve the problem.
export TF_FORCE_GPU_ALLOW_GROWTH=true