- 搜索cuda 11.6 nvidia,进入官网https://developer.nvidia.com/cuda-11-6-0-download-archive
- 选择linux --> runfile 用安装包安装
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
Please make sure that
- PATH includes /usr/local/cuda-11.6/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-11.6/lib64, or, add /usr/local/cuda-11.6/lib64 to /etc/ld.so.conf and run ldconfig as root
- 配置环境变量,实际安装在/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