How can I dedicate my second GPU to WSL2 containers while keeping the first for Windows gaming?

September 23, 2026 1 answer
Asked by ~bakery queue+
I'm trying to use one Windows PC as an all-purpose machine that stays running 24/7. Windows will handle gaming and everyday tasks, while Docker containers inside WSL2 will run Frigate, Jellyfin, Home Assistant, and Immich. The system has an ASUS ROG Strix Z890-E motherboard, an Intel Core Ultra 5 250K, a 1TB Kingston NVMe boot drive, and a 1TB WD Black SN850X for WSL2 data. For now, it has two older ASUS Strix GTX 1070 Ti graphics cards. I want the GPU in slot 1 reserved for Windows and gaming, and the GPU in slot 2 reserved for the WSL2 containers. However, WSL2 detects both GPUs and appears to combine or expose them together. Even when I specify the UUID of the second card in my Docker Compose configuration, both GPUs are still available. Is there a way to make WSL2 expose only the second GPU without using Proxmox or Unraid?

Answers

cAn we compare
WSL2 doesnโ€™t provide true PCI passthrough or a built-in way to hide one host GPU. It uses GPU paravirtualization through /dev/dxg, so WSL2 generally sees every compatible graphics adapter that Windows exposes. CUDA_VISIBLE_DEVICES can limit what CUDA-based applications use, but it doesnโ€™t remove the other card from WSL2 entirely. Also, a GPU UUID in Compose may not affect applications such as Frigate or Jellyfin if they select hardware acceleration through VA-API, NVENC, or another device picker. Youโ€™ll likely need to select the correct device inside each container or application.

6flute.endmill: For NVIDIA containers, you can try reserving the second card by its Docker device index, for example with `device_ids: ["1"]` under the NVIDIA GPU reservation. That limits the GPU resources assigned to that container, although the application itself may still need its own encoder or acceleration setting configured.

~bakery queue+: Thanks, that clears up why the UUID setting wasnโ€™t controlling every application.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions