2

I am running code that UI downloaded from github. It is supposed to be working (I saw that other people managed to activate it). When I try to run it I get the following error message:

RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS

The code uses pytorch 0.4.1. I have cuda installed.

When I run the command cat /usr/local/cuda/version.txt I get the answer:

CUDA Version 10.0.130

When I run the command conda list -n <my env name> I see:

cudatoolkit ver 9.0
cudnn       ver 7.6.5

And now, my question:

What should I do to avoid this error? Do I need to use pip install for a more recent version of cudnn? If so, which one?

double-beep
  • 5,031
  • 17
  • 33
  • 41
Hadas Ofir
  • 21
  • 1
  • 4

2 Answers2

6

I also faced the same issue. In my case, the PyTorch version was 0.4.1, and the Cuda version was 9.0. I solved the issue by adding this piece of code:

torch.backends.cudnn.benchmark = True
Ixtiyor Majidov
  • 301
  • 4
  • 11
1

try this

if torch.cuda.is_available():
    device = torch.device("cuda")
    print("working on gpu")
else:
    device = torch.device("cpu")
    print("working on cpu")