docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/docker/roadmap/projects/1
Creative Commons Zero v1.0 Universal
1.45k stars 246 forks source link

[Docker Desktop] Add GPU support with WSL2 #96

Closed simonferquel closed 3 years ago

simonferquel commented 4 years ago

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.

symmetryninja commented 4 years ago

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.

justincormack commented 3 years ago

@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.

symmetryninja commented 3 years ago

@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.

ghost commented 3 years ago

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! :)

feynmanliang commented 3 years ago

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

ghost commented 3 years ago

Anyone knows when this will be implemented?

MichaMucha commented 3 years ago

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

strarsis commented 3 years ago

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?

nu007a commented 3 years ago

when will be release?

stephen-turner commented 3 years ago

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/.

feynmanliang commented 3 years ago

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.

WorksWellWithOthers commented 3 years ago

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

UeliDeSchwert commented 3 years ago

@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.

simonferquel commented 3 years ago

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)

stephen-turner commented 3 years ago

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.

feynmanliang commented 3 years ago

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