Jacob Stern
Jacob Stern

Reputation: 4597

Cuda Runtime/Driver incompatibility in docker container

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).

Upvotes: 3

Views: 1380

Answers (1)

Jacob Stern
Jacob Stern

Reputation: 4597

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

Upvotes: 2

Related Questions