roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

[Docker Desktop] Add GPU support with WSL2

Open simonferquel opened this issue 6 years ago • 16 comments

Tell us about your request Microsoft just announced GPU virtualization support in WSL2, demonstrating a Tensorflow workload running on the GPU. I want my containers to leverage that for Cuda, TF and other GPGPU worloads.

Which service(s) is this request for? Docker Desktop w/ wsl2

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? Deep Learning, ML, AI and other projects leveraging GPUs can't get addressed today with Docker Desktop. We want to be able to work on those on a local machine.

Are you currently working around the issue? No, the only viable solution today is working on a remote GPU-enabled Linux server.

simonferquel avatar May 19 '20 19:05 simonferquel

I'll add in that native GPU support would be very helpful in terms of rendering realtime GUI and physics environments like Gazebo and custom Unreal/Unity environment for robotics.

symmetryninja avatar May 26 '20 23:05 symmetryninja

@mrkoz note that the currently announced driver is just for GPU compute, not GUI; there may later be GUI support, but with a different driver and unknown timetable.

justincormack avatar Jun 06 '20 11:06 justincormack

@justincormack interesting, i honestly don't know of gazebo's physics engine runs in gui space or gpu compute. either way it's cool to see things moving foward.

symmetryninja avatar Jun 06 '20 13:06 symmetryninja

This is extremely important for Machine Learning development on Windows PCs.

Are you currently working around the issue? No, the only viable solution today is working on a remote GPU-enabled Linux server.

There is now a workaround where you can use the latest Windows 10 Insider Preview to utilise CUDA on WSL that lets you run GPU Linux containers natively on Windows, however it does involve many extra steps and requires installing/configuring a Linux distro. It would be much more seamless if this were to be directly integrated into Docker Desktop! :)

ghost avatar Jun 27 '20 00:06 ghost

This is extremely important for Machine Learning development on Windows PCs.

Are you currently working around the issue? No, the only viable solution today is working on a remote GPU-enabled Linux server.

There is now a workaround where you can use the latest Windows 10 Insider Preview to utilise CUDA on WSL that lets you run GPU Linux containers natively on Windows, however it does involve many extra steps and requires installing/configuring a Linux distro. It would be much more seamless if this were to be directly integrated into Docker Desktop! :)

In addition to this, it seems that Docker Desktop is the only supported method for VSCode's remote containers extension; see https://github.com/microsoft/vscode-remote-release/issues/3534

feynmanliang avatar Aug 18 '20 04:08 feynmanliang

Anyone knows when this will be implemented?

ghost avatar Sep 07 '20 13:09 ghost

Vey excited for this too, currently stopped by https://github.com/docker/for-win/issues/7581

MichaMucha avatar Sep 25 '20 15:09 MichaMucha

So this means that I have to wait for this feature to be added to a Windows 10 Update (stable) for being able to use GPU in Docker in WSL 2?

strarsis avatar Oct 03 '20 13:10 strarsis

when will be release?

nu007a avatar Oct 30 '20 02:10 nu007a

We released a preview of this to the users on our development preview program yesterday. If you're interested in joining the program, please see https://www.docker.com/blog/expanding-dockers-developer-preview-program/.

stephen-turner avatar Dec 11 '20 16:12 stephen-turner

Thank you; I've signed up for developer builds and will validate this when approved.

FWIW there is a work-around for VSCode (see discussion in https://github.com/microsoft/vscode-remote-release/issues/3534) using a Windows Docker CLI with a WSL docker context connected over tcp.

feynmanliang avatar Dec 11 '20 17:12 feynmanliang

I just signed up. I am excited to have GPU support in WSL2 so that I can run MLPerf.

WorksWellWithOthers avatar Jan 05 '21 03:01 WorksWellWithOthers

@stephen-turner Thanks. I'm using it for the past few days and it looks good. Just for curiosity and because maybe others that search for it will land on this thread: Is there alread an implementation for the "--gpus=all" flag in docker compose? I did not find anything in the docs or discussions yet.

UeliDeSchwert avatar Jan 07 '21 10:01 UeliDeSchwert

We just release Docker Desktop 3.1.0 with WSL2 GPU para-virtualization support for NVidia GPUs. A last minute issue prevented us to update compose though and we are still on 1.27.4. We'll do an update soon with compose 1.28 so that you can leverage GPU with docker-compose (note that you can also download docker-compose 1.28 rc3 separatly from https://github.com/docker/compose/releases/tag/1.28.0-rc3 and use it with docker desktop)

simonferquel avatar Jan 14 '21 14:01 simonferquel

We've now shipped 3.2.0 with compose 1.28.

I'm going to mark this as Shipped now. GPU support in Docker Desktop is still officially experimental until Microsoft ship it in a non-Insiders build of Windows, but our work is done.

stephen-turner avatar Mar 08 '21 09:03 stephen-turner

Thank you docker team for the great work, much appreciated! 👏 👏 🎉

feynmanliang avatar Mar 08 '21 15:03 feynmanliang