Reputation: 4572
I just installed the latest CUDA 9.1 on Ubuntu 16.04 according to the official instruction. But when I run the command nvcc -V
, it still shows my cuda version is 7.5 like below.
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17
Also, which nvcc
gave me /usr/bin/nvcc
which is not under /usr/local
folder. Is this normal? Is this a compatibility issue? I have a GTX 1080 Ti and a GTX 980. I added commands below to .bashrc
file, but it still didn't work.
export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Upvotes: 2
Views: 2910
Reputation: 152113
The best thing to do here is to remove all traces of CUDA binaries from the /usr/bin
directory, and in the future always install the CUDA toolkit in the "default" locations at /usr/local/cuda-XX
To remove CUDA items from /usr/bin
, just use the linux rm
command as a root user. Not sure what to remove? Take a look in an "ordinary" CUDA install bin directory, such as /usr/local/cuda-8.0/bin
By having your CUDA install at the default locations e.g. /usr/local/cuda-8.0
and /usr/local/cuda-9.0
(for example), you can have "side-by-side" installs, and switch between them by modifying the PATH
and LD_LIBRARY_PATH
variables accordingly.
Upvotes: 6