koralgoll
koralgoll

Reputation: 43

How can I use GPU in Docker image with Theano launched from Windows host?

I want to run Theano via Docker image on my PC with Windows installed. The Docker image contains Ubuntu system, CUDA drivers and Theano (https://hub.docker.com/r/kaixhin/cuda-theano/) but in order to use GPU in my algorithm I need to attach Nvidia devices to the image:

docker run -it --device /dev/nvidiactl --device /dev/nvidia-uvm --device /dev/nvidia0 kaixhin/cuda-theano

Is there a way to do it in Windows, since I don't have a path /dev/nvidiactl etc.? I have been looking for other Docker images but it seems that all of these are using Linux as the host system. Is there a version that will allow me to use GPU from Windows?

For now I can run my script in Docker, but it uses only my CPU:

WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: Unable to get the number of gpus available: no CUDA-capable device is detected)

Upvotes: 0

Views: 1238

Answers (2)

MrE
MrE

Reputation: 20768

You can try this image:

https://hub.docker.com/r/kaixhin/cuda-theano/

It requires nvidia-docker

nvidia-docker run -it kaixhin/cuda-theano

Upvotes: 0

3XX0
3XX0

Reputation: 1325

In order to run CUDA Docker images you need NVIDIA Docker. Unfortunately, Theano is not supported as an official image at the moment but you can write your own Dockerfile leveraging nvidia/cuda

Having said that, you won't be able to do it on Windows because Docker needs a Linux VM and there is no support for VM GPU passthrough on Windows.

Upvotes: 1

Related Questions