问题
I am trying to run an application inside a docker container in Windows 10.
But I am not able to get the GPU working inside docker.
I read that it needs "GPU Pass-through."
How should I get around this?
回答1:
GPU access from within a Docker container currently isn't supported on Windows.
You need nvidia-docker
, but that is currently only supported on Linux platforms. GPU passthrough with Hyper-v would require Discrete Device Assignment (DDA), which is currently only in Windows Server, and (at least in 2015) there was no plan to change that state of affairs. Hence, NVIDIA are not porting nvidia-docker
to Windows at the moment.
A bit more info here: https://devblogs.nvidia.com/nvidia-docker-gpu-server-application-deployment-made-easy/
Update (October 2019): nvidia-docker
is deprecated, as Docker 19.03 has native support for NVIDIA GPUs. Instead install nvidia-container-runtime
, and use the docker run --gpus all
flag. You can also run Windows Containers with GPU acceleration on a Windows host, using Docker 19.03, but not a Linux container.
来源:https://stackoverflow.com/questions/49589229/is-gpu-pass-through-possible-with-docker-for-windows