Switching MESA_D3D12_DEFAULT_ADAPTER_NAME to NVIDIA defaults to llvmpipe rendering
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [Version 10.0.26100.2605]
### WSL Version
2.3.26.0
### Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
### Kernel Version
5.15.167.4-1
### Distro Version
Ubuntu 24.04
### Other Software
_No response_
### Repro Steps
Steps were followed from [here](https://github.com/microsoft/wslg/wiki/GPU-selection-in-WSLg)
`sudo apt install mesa-utils`
`nvidia-smi`
`MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA glxinfo | grep "OpenGL renderer"`
### Expected Behavior
The following output should be present:
```bash
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 4060 Laptop GPU)
```
### Actual Behavior
The following output is given by running the `glxinfo` command as outlined in "Repro Steps":
```bash
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
OpenGL renderer string: llvmpipe (LLVM 17.0.6, 256 bits)
```
Running the same command without the env variable gives the following:
```bash
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
OpenGL renderer string: D3D12 (Intel(R) Arc(TM) Graphics)
```
It uses the integrated graphics card but refuses to use the Nvidia Graphics card despite `nvidia-smi` detecting it.
How can I get it to use the Nvidia Graphics card?
### Diagnostic Logs
[WslLogs-2024-12-26_17-48-04.zip](https://github.com/user-attachments/files/18250383/WslLogs-2024-12-26_17-48-04.zip)
Contributor guide
Research direction
Start by reproducing the issue with the documented WSLg GPU-selection steps, especially nvidia-smi and the MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA glxinfo command. Inspect the attached WslLogs-2024-12-26_17-48-04.zip and compare the NVIDIA-selected and default renderer paths; done means the command reports the NVIDIA D3D12 renderer rather than llvmpipe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, ubuntu
- Domain
- computer-graphics, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100