1 更改CUDA环境变量
再次确认环境变量已经配置
vim ~/.bashrc
# CUDA-11.1
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda
2 更改软连接
rm -rf /usr/local/cuda#删除之前创建的软链接
# /usr/local/cuda-11/是安装的CUDA的路径,/usr/local/cuda/是软链接的路径
sudo ln -s /usr/local/cuda-11/ /usr/local/cuda
nvcc -V #查看当前 cuda 版本