The same machine can be compatible with multiple versions of the CUDA, these two days will be so back and forth, slightly trouble.
1. View the current Cuda version;
NVCC--version
From this we can see that the current is Cuda 8.0.
2. Modify the. bashrc file.
Export path= $PATH:/usr/local/cuda-8.0/bin
export ld_library_path= $LD _library_path:/usr/local/cuda-8.0/lib64
Export library_path= $LIBRARY _path:/usr/local/cuda-8.0/lib64
Change the way you add these variables to the following:
Export path= $PATH:/usr/local/cuda/bin
export ld_library_path= $LD _library_path:/usr/local/cuda/lib64
Export Library_path= $LIBRARY _path:/usr/local/cuda/lib64
After you modify it, you need to refresh it:
source. BASHRC
Then switch to Cuda version 9.0 below.
2. Download CUDA 9.0 's Run file from the official website, during the installation process, choose not to establish a soft connection.
3. Switch Cuda 9.0 and use the command below.
sudo rm-rf/usr/local/cuda
sudo ln-s/usr/local/cuda-9.0/usr/local/cuda
NVCC--version
You can see that the current Cuda version becomes 9.0.