When I try to use CUDA for training NN or just for simple calculation, PyTorch utilize CPU instead of GPU
Python 3.8.3 (default, Jun 25 2020, 23:21:14) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import torch >>> torch.cuda.is_available() True >>> device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") >>> device device(type='cuda', index=0) >>> tensor = torch.rand(1, 1, 10).to(device) >>> tensor tensor([[[0.1126, 0.1737, 0.9678, 0.8833, 0.6923, 0.2118, 0.9874, 0.9397, 0.4831, 0.4274]]], device='cuda:0') >>> tensor_two = tensor + tensor >>> tensor_two tensor([[[0.2252, 0.3474, 1.9356, 1.7666, 1.3847, 0.4236, 1.9747, 1.8794, 0.9661, 0.8549]]], device='cuda:0') >>> while True: ... tensor_two = tensor + tensor ...
nvidia-smi output under Windows:
Sun Jun 28 10:46:36 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.41 Driver Version: 455.41 CUDA Version: 11.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1070 WDDM | 00000000:01:00.0 On | N/A |
| 44% 39C P2 33W / 151W | 1394MiB / 8192MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 4 C Insufficient Permissions N/A |
| 0 N/A N/A 1268 C+G ...lPanel\SystemSettings.exe N/A |
| 0 N/A N/A 1468 C+G C:\Windows\System32\dwm.exe N/A |
| 0 N/A N/A 3784 C+G ...bbwe\Microsoft.Photos.exe N/A |
| 0 N/A N/A 8844 C+G ...5n1h2txyewy\SearchApp.exe N/A |
| 0 N/A N/A 8892 C+G ...artMenuExperienceHost.exe N/A |
| 0 N/A N/A 10380 C+G ...ropbox\Client\Dropbox.exe N/A |
| 0 N/A N/A 14504 C+G ...y\ShellExperienceHost.exe N/A |
| 0 N/A N/A 15984 C+G ...8bbwe\WindowsTerminal.exe N/A |
| 0 N/A N/A 19380 C+G ...2txyewy\TextInputHost.exe N/A |
| 0 N/A N/A 28380 C+G ...b3d8bbwe\WinStore.App.exe N/A |
+-----------------------------------------------------------------------------+
Task manager:
WSL version:
Linux version 4.19.121-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Fri Jun 19 21:06:10 UTC 2020
Ubuntu 20.04 LTS
DxDiag.txt (114.6 KB)
The same code on Ubuntu PC:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100 Driver Version: 440.100 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 GeForce GTX 108... Off | 00000000:01:00.0 Off | N/A |
| 0% 46C P2 63W / 250W | 663MiB / 11178MiB | 19% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 108... Off | 00000000:02:00.0 Off | N/A |
| 0% 39C P8 11W / 250W | 12MiB / 11178MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 2 GeForce GTX 108... Off | 00000000:04:00.0 Off | N/A |
| 0% 43C P8 12W / 250W | 12MiB / 11178MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 3 GeForce GTX 108... Off | 00000000:05:00.0 Off | N/A |
| 0% 43C P8 13W / 250W | 12MiB / 11178MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 942 G /usr/lib/xorg/Xorg 25MiB |
| 0 1239 G /usr/bin/gnome-shell 57MiB |
| 0 5591 C ...vlad/.pyenv/versions/pytorch/bin/python 567MiB |
+-----------------------------------------------------------------------------+