- 下载cuda版本
进: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.runsudo sh ./cuda_12.2.0_535.54.03_linux.run --toolkit --silent --override
修改环境变量:
vim ~/.bashrcsource ~/.bashrcexport PATH=/usr/local/cuda-12.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64:$LD_LIBRARY_PATHnvcc -V
- 切换版本:
参考:https://blog.csdn.net/weixin_38705903/article/details/101850116