wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run
sudo sh cuda_11.6.0_510.39.01_linux.run
- 选择continue
- 输入accept
- 按空格取消第一个对driver的勾选(看别人也是这么做得)
- 覆盖symlink,先选择yes,以后再了解
- 然后给你一个summary
- 配置环境变量,实际安装在/usr/local/cuda-11.6但是会在/usr/local/cuda/建立软链接(应该是叫这个)所以cuda后不带数字后缀也是可以的
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
- 检测是否安装成功 nvcc -V
- 如何卸载cuda,使用/usr/local/cuda-11.6/bin/cuda-uninstaller卸载得干干净净
cd /usr/local/cuda-11.6/bin
sudo ./cuda-uninstaller