microsoft / microsoft/WSL

Running CUDA inside Docker\WSL on Windows 11 Hyper-v VM with GPU Patritioning

Open
#12,097 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Is your feature request related to a problem? Please describe.

The problem is that WSL under a Hyper-V GPU Partitioned machine can't use the GPU (Nvidia), as stated in #8179 2 YEARS ago.

Describe the solution you'd like

Expected behavior on vm:
https://www.youtube.com/watch?v=JaHVsZa2jTc

For this to work there should be some configuration regarding the linkers to the drivers that are virtualized inside the Hyper-v VM.

The files from "C:\Windows\System32\lxss" when copied to the VM should do the link to the drivers. Or they should be changed in a way to accommodate the virtual GPU.

Describe alternatives you've considered

I'll try to do GPU partitioning with a Ubuntu VM under Hyper-v.

Additional context

Tech stack:
Windows 11 ✅ → Hyper-v ✅-> Windows 11 guest + Gpu Partitioning + Nested Virtualization ✅-> Docker Desktop + WSL ✅ → GPU acceleration (nvidia-smi) ❌

This is what I get in WSL when I copy the linkers("C:\Windows\System32\lxss") to VM:

    Ubuntu:$ nvidia-smi

    Failed to initialize NVML: GPU access blocked by the operating system

    Failed to properly shut down NVML: GPU access blocked by the operating system

More details and my hardware are here:
https://forums.developer.nvidia.com/t/run-cuda-inside-docker-wsl-on-windows-11-hyper-v-vm-with-gpu-patritioning/308212

#Cuda #WSL #GPU-P #Paravirtualization #GPU Partitioning #NVIDIA #Docker #Nested Virtualization #nvidia-smi #Hyper-v

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked issue #8179 and the reported nvidia-smi output in WSL after copying files from C:\Windows\System32\lxss. Compare the setup with the linked NVIDIA forum details and identify the relevant WSL, Hyper-V GPU partitioning, and nested virtualization constraints. Done means documenting or implementing a supported configuration that permits GPU access in this environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux
Domain
devops, infrastructure, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.