As Jared mentions in a comment, from the command line:
nvcc --version
(or /usr/local/cuda/bin/nvcc --version
) gives the CUDA compiler version (which matches the toolkit version).
From application code, you can query the runtime API version with
cudaRuntimeGetVersion()
or the driver API version with
cudaDriverGetVersion()
As Daniel points out, deviceQuery is an SDK sample app that queries the above, along with device capabilities.
As others note, you can also check the contents of the version.txt
using (e.g., on Mac or Linux)
cat /usr/local/cuda/version.txt
However, if there is another version of the CUDA toolkit installed other than the one symlinked from /usr/local/cuda
, this may report an inaccurate version if another version is earlier in your PATH
than the above, so use with caution.
Usually, it is /usr/local/cuda
. If this is not the case, you can try to locate cuda
. If you want to find directories only, run
locate cuda | grep /cuda$
or
find / -type d -name cuda 2>/dev/null
For me, it turned out to be in /opt/cuda-7.5
Best Answer
For cuda-8.0 on Ubuntu16.04, you should be able to read
I agree with Robert Crovella, you might need to check your PATH