RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/torch/lib/THC/THCGeneral.c:70

Hi everyone,

I am trying to run to run the python module on my CPU server ,but I face the mentioned error ! . I have no idea what is causing this issue ,any help is greatly appreciated. Here is the full log :

THCudaCheck FAIL file=/pytorch/torch/lib/THC/THCGeneral.c line=70 error=38 : no CUDA-capable device is detected
Traceback (most recent call last):
  File "main.py", line 448, in <module>
    print("torch.cuda.initial_seed", torch.cuda.initial_seed())
  File "/home/shannon-lab/.pyenv/versions/3.5.4/lib/python3.5/site-packages/torch/cuda/random.py", line 113, in initial_seed
    _lazy_init()
  File "/home/shannon-lab/.pyenv/versions/3.5.4/lib/python3.5/site-packages/torch/cuda/__init__.py", line 142, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/torch/lib/THC/THCGeneral.c:70


You have no CUDA device. You have to switch every tensor’s cuda device to the cpu device using torch. device.