进:CUDA Toolkit 12.2 Downloads | NVIDIA Developer
wget https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run
sudo sh ./cuda_12.2.0_535.54.03_linux.run --toolkit --silent --override
修改环境变量:
vim ~/.bashrc
source ~/.bashrc
export PATH=/usr/local/cuda-12.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64:$LD_LIBRARY_PATH
nvcc -V
参考:https://blog.csdn.net/weixin_38705903/article/details/101850116