Enabling GPU support when WSL runs inside a Hyper-V VM configured with GPU partitioning
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
(I asked this question [previously](https://github.com/microsoft/WSL/issues/12698#issuecomment-2734910100) but it was answered erroneously and the issue was closed).
I run WSL inside a Windows 11 Hyper-V VM configured for nested virtualization. This is a development environment and WSL has worked successfully in this manner for many years. I would now like for programs executing in WSL and Docker to take advantage of the internal GPU (Intel Iris Xe Graphics) for some ML related tasks. To this end, **I enabled GPU partitioning for the guest VM** and the GPU now appears both in Device Manager and Task Manager of the guest VM. Programs running in the Windows guest are able to access the GPU so, presumably, partitioning has been configured correctly
**Hyper-V Guest VM**

Inside the WSL instance of the Hyper-V guest VM, the situation is different. Running `glxinfo -B` shows that it does not recognize the GPU. For comparison, even though I do not need it, I installed WSL in the Hyper-V host, This is what WSL shows when running in the host and inside the VM.
| Hyper-V Host | Hyper-V Guest VM|
|--------|--------|
|  | |
|  |  |
I would like to know whether enabling GPU support inside WSL is possible in this scenario, and if it is, how to do it.
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported comparison with glxinfo -B in WSL on the Hyper-V host and inside the GPU-partitioned guest VM. Investigate whether WSL GPU support is available in this nested configuration; done means establishing a supported configuration or documenting that the scenario is not supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- computer-graphics, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100