I tried using Cuda in Pytorch in my set up but it can't be detected and I am puzzled as to why.
torch.cuda.is_available()
return False. Digging deeper,
torch._C._cuda_getDeviceCount()
returns 0. Using version 1.5, e.g.
$ pip freeze | grep torch
torch==1.5.0
I tried to write a small C program to do the same, e.g.
#include <stdio.h>
#include <cuda_runtime_api.h>
int main() {
int count = 0;
cudaGetDeviceCount(&count);
printf("Device count: %d\n", count);
return 0;
}
prints 1, so the Cuda runtime can obviously find a device. Also, running nvidia-smi:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21 Driver Version: 435.21 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| 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 106... Off | 00000000:02:00.0 On | N/A |
| 0% 41C P8 9W / 200W | 219MiB / 6075MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
So where did my Cuda device disappear in Python?