Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the CUDA version?

Tags:

cuda

Is there any quick command or script to check for the version of CUDA installed?

I found the manual of 4.0 under the installation directory but I'm not sure whether it is of the actual installed version or not.

like image 476
Hailiang Zhang Avatar asked Mar 15 '12 20:03

Hailiang Zhang


People also ask

How do I find my CUDA version Windows 10?

(or /usr/local/cuda/bin/nvcc --version ) gives the CUDA compiler version (which matches the toolkit version).

How do you check if I have CUDA?

You can verify that you have a CUDA-capable GPU through the Display Adapters section in the Windows Device Manager. Here you will find the vendor name and model of your graphics card(s). If you have an NVIDIA card that is listed in http://developer.nvidia.com/cuda-gpus, that GPU is CUDA-capable.

How do I find my CUDA driver version Ubuntu?

The first way to check CUDA version is to run nvidia-smi that comes from your Ubuntu 18.04's NVIDIA driver, specifically the NVIDIA-utils package. You can install either Nvidia driver from the official repository of Ubuntu, or from the NVIDIA website. You will see similar output to the screenshot below.


1 Answers

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.

like image 114
harrism Avatar answered Sep 28 '22 04:09

harrism



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!