Windows版docker是否可以通过GPU? [英] Is GPU pass-through possible with docker for Windows?

查看:2379
本文介绍了Windows版docker是否可以通过GPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows 10的docker容器内运行应用程序。



但是我无法在docker内部运行GPU。



我读到它需要 GPU传递。



我应该如何解决?

解决方案


您需要 nvidia-docker ,但是目前仅在Linux上受支持。


平台。使用Hyper-v的GPU直通将需要离散设备分配(DDA),当前仅在Windows Server中,并且()没有计划改变这种状况。离散设备分配机器和设备/ rel = nofollow noreferrer>>因此,NVIDIA目前不会将 nvidia-docker 移植到Windows。


此处有更多信息:
< a href = https://devblogs.nvidia.com/nvidia-docker-gpu-server-application-deployment-made-easy/ rel = nofollow noreferrer> https://devblogs.nvidia.com/nvidia- docker-gpu-server-application-deployment-made-easy /


更新(2019年10月) nvidia-不推荐使用Docker ,因为Docker 19.03具有对NVIDIA GPU的本地支持。而是安装 nvidia-container-runtime ,并使用 docker run --gpus all 标志。您还可以运行具有GPU加速功能的Windows容器在Windows主机上,使用Docker 19.03,但不使用Linux容器。


更新(2020年8月):看来您现在可以进行GPU传递了,


此链接通过WSL 2中的Ubuntu在Ubuntu中的Docker内部安装,设置和运行TensorFlow Jupyter笔记本,并提供GPU支持。 :
https:// ubuntu .com / blog / getting-started-with-cuda-on-ubuntu-on-wsl-2


注意-我自己还没有这样做。


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?

解决方案

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.

Update (August 2020): It looks like you can now do GPU pass-through when running Docker inside the Windows Subsystem for Linux (WSL 2).

This link goes through installation, setup and running a TensorFlow Jupyter notebook inside Docker in Ubuntu in WSL 2, with GPU support: https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2

Note - I haven't done this myself yet.

这篇关于Windows版docker是否可以通过GPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆