Reputation: 24111
On Ubuntu, I previously had an installation of CUDA 6.5, and wanted to upgrade to CUDA 7.0. So, I deleted the directory at /usr/local/cuda-6.5, and installed CUDA 7.0 into /usr/local/cuda-7.0. I then changed the symbolic link at /usr/local/cuda to point to /usr/local/cuda-7.0. In my bash.rc file, I also updated the environment variables accordingly:
export CUDA_HOME=/usr/local/cuda-7.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64
export PATH=${CUDA_HOME}/bin:${PATH}
If I type in "nvcc --version", then I get the following as expected:
Cuda compilation tools, release 7.0, V7.0.27
However, I am now compiling some code (the Caffe deep learning library, to be precise) which uses CUDA, and I am getting the following error message:
error while loading shared libraries: libcudart.so.6.5: cannot open shared object file: No such file or directory
So for some reason, it is still looking for the CUDA 6.5 libraries, rather than the CUDA 7.0 libraries. Why is this? How do I tell the compiler to look for the 7.0 libraries? I cannot find any reference to libcudart.so.6.5 in the source code I am compiling, so the CUDA compiler itself is looking for the wrong version.
Upvotes: 1
Views: 1996
Reputation: 188
Obviously, you didn't follow the right uninstallation method; please note that if you are installing different toolkit versions there won't be any conflict between them and you can keep both of them. You will be asked during the installation process to link your /usr/local/cuda-x.y to /usr/local/cuda. Check Section 2.6 of CUDA 7.0 GETTING STARTED ON LINUX.
The proper way to uninstall as mentioned in the above link is to use the commands below depending on how you did the installation (i.e., run method or rpm method):
$ sudo /usr/local/cuda-X.Y/bin/uninstall_cuda_X.Y.pl
Use the following command to uninstall a Driver runfile installation:
$ sudo /usr/bin/nvidia-uninstall
Use the following commands to uninstall a RPM/Deb installation:
$ sudo apt-get --purge remove <package_name> # Ubuntu
$ sudo yum remove <package_name> # Fedora/Redhat/CentOS
$ sudo zypper remove <package_name> # OpenSUSE/SLES
I hope it works for you; I don't know about the Caffe deep learning library, but I am assuming that you didn't configure it before by providing the PATH of cuda 6.5 compiler and its libraries. If this is the case, first try to uninstall the previous cuda 6.5 properly, configure the library from scratch and then make it.
Upvotes: 1