切换CUDA版本步骤

在usr/local/下有8.0和10.0两个版本。

假设现在使用8.0,要切换10.0

1. 删除软链接
 

cd /usr/local/
sudo rm -rf cuda
sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda

 

2. 在home/下修改.bashrc的注释,即环境变量

# for CUDA 8.0
#export PATH=/usr/local/cuda-8.0/bin:$PATH 
#export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64$LD_LIBRARY_PATH

#export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64”
#export CUDA_HOME=/usr/local/cuda

# added by cuda 10.0 installer
export PATH="/usr/local/cuda-10.0/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH"
export CUDA_HOME=/usr/local/cuda

将8.0的注释掉,10.0版本的export前面的#去掉即可

 

然后 source .bashrc

 

3. 查看CUDA和CUDNN版本

cat /usr/local/cuda/version.txt
 cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

 

你可能感兴趣的:(小问题,CUDA切换)