0

I met a strange question after I installed CUDA on Ubuntu 18.04. I found there are three different versions of CUDA on this computer. May I ask which one is used by Pytorch, and where can I find the root folder of it?

Version 1: 9.1.85

When I use locate cuda | grep /cuda$ to find my CUDA, the result /usr/lib/cuda lead me here.

/usr/lib/cuda$ ls
>>> bin  include  lib64  nvvm  version.txt

cat version.txt
>>> CUDA Version 9.1.85

Version 2: 10.2

It happens when I use nvidia-smi, the result shows as following:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro K600         Off  | 00000000:02:00.0  On |                  N/A |
| 30%   61C    P0    N/A /  N/A |    457MiB /   974MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 106...  Off  | 00000000:03:00.0 Off |                  N/A |
|  0%   41C    P8     4W / 120W |     25MiB /  6078MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1432      G   /usr/lib/xorg/Xorg                            31MiB |
|    0      1500      G   /usr/bin/gnome-shell                          51MiB |
|    0      1681      G   /usr/lib/xorg/Xorg                           139MiB |
|    0      1799      G   /usr/bin/gnome-shell                          85MiB |
|    0      2629      G   ...AAAAAAAAAAAAAAgAAAAAAAAA --shared-files   131MiB |
|    1      1432      G   /usr/lib/xorg/Xorg                             5MiB |
|    1      1681      G   /usr/lib/xorg/Xorg                             6MiB |

Version 3: 10.1

I find this version when using Pytorch:

import torch
torch.cuda.is_available()
>>>True

torch.version.cuda
>>>'10.1'

torch.cuda.get_device_name(0)
>>>'GeForce GTX 1060 6GB'

torch.cuda.get_device_name(1)
>>>'Quadro K600'

sudo find / -name nvcc and which nvcc return:

sudo find / -name nvcc
>>>/usr/bin/nvcc
>>>/usr/lib/nvidia-cuda-toolkit/bin/nvcc

which nvcc
>>>/usr/bin/nvcc

I'm a beginner to Ubuntu and CUDA. These versions really confuse me. Can anyone help me with which CUDA the Pytorch is using, and how can I find the root of it? Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.