Table of contents
NoteCurrently GPU support in Docker Desktop is only available on Windows with the WSL2 backend.
Docker Desktop for Windows supports NVIDIA GPU Paravirtualization (GPU-PV) on NVIDIA GPUs, allowing containers to access GPU resources for compute-intensive workloads like AI, machine learning, or video processing.
Prerequisites
To enable WSL 2 GPU Paravirtualization, you need:
- A Windows machine with an NVIDIA GPU
- Up to date Windows 10 or Windows 11 installation
- Up to date drivers from NVIDIA supporting WSL 2 GPU Paravirtualization
- The latest version of the WSL 2 Linux kernel. Use
wsl --updateon the command line - To make sure the WSL 2 backend is turned on in Docker Desktop
Validate GPU support
To confirm GPU access is working inside Docker, run the following:
This runs an n-body simulation benchmark on the GPU. The output will be similar to:
Run a real-world model: SmolLM2 with Docker Model Runner
NoteDocker Model Runner with vLLM for Windows with WSL2 is available starting with Docker Desktop 4.54.
Use Docker Model Runner to run the SmolLM2 LLM with vLLM and GPU acceleration:
Check it's correctly installed:
Run the model: