Select specific GPU in docker windows dont work

I have Docker installed for Windows and am trying to access a specific GPU for a container via CUDA.

According to the documentation, Windows Docker supports this; I have CUDA Toolkit installed.

Now, when I start a container and do the following:

docker run -dp 3050:3000 opendronemap/nodeodm:gpu --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0

While the image doesn’t matter, nvidia-smi always shows me all three GPUs. The version listed there also seems to be the host version rather than the container version.

My goal, however, is to only display one specific GPU.

Does anyone here have experience with this in combination with Windows?

What was the exact command you tried? Because what you shared could not run. You passed the docker run parameters as a parameter of the command running in the container. That won’T affect how the container is created and it will not set variables or runtimes for the container.

Here are the examples for the correct commands: