3

I'm trying to run this simple line of code in a docker container that comes with Pytorch.

import torch torch.cuda.set_device(0) 

I get this error:

RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at torch/csrc/cuda/Module.cpp:32 

Running torch.cuda.is_available() returns False.

The host machine has the most up-to-date Nvidia drivers. Pytorch ships with Cuda, so there should be no incompatibility issues.

What could cause this problem?

Edit: @Patel Sunil's answer to this question answers my question, but I didn't come across this question in my search because their question is broad, while my question is specific to the cuda runtime/driver error. I posted this as a separate question for those who come across this error but don't know what it is a symptom of (namely, forgetting to use nvidia-docker).

2
  • I'm happy that you found a solution to your problem! But isn't this a duplicate of this question? Well, nvidia-docker is only the last answer. Probably mainly because the answer was written way after the question was asked. Commented Apr 11, 2019 at 21:59
  • Edited my post to clarify - thanks! Commented Apr 12, 2019 at 12:13

1 Answer 1

2

The problem was that I was running the container with docker, not nvidia-docker. Running the docker container with nvidia-docker fixed the problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.