WSL: Failed to initialize NVML: GPU access blocked by the operating system
Windows Version
Windows 10 [19045.2728]
WSL Version
1.1.6.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
Linux version 5.15.90.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
I install wsl2 in Windows 10 [19045.2728]

In Windows, “nvidia-smi” output is :

but in wsl2, output is :

Below are the solutions I have tried that didn’t work:
- log in with administrator privileges
- update the driver to the latest version
- install cuda toolkits
My file list in C:\Windows\System32\lxss\lib is :

Expected Behavior
that nvidia-smi outputs the informations related to my gpu and that I can use it inside the WSL2 environment.
Actual Behavior
this is what happens when I launch nvidia-smi inside ubuntu 22.04 :
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
Diagnostic Logs
No response
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 22 (1 by maintainers)
Here, I found solution in #9962 that says:
It worked for me. Hope it does for you too.
I have the exact same problem
thank you so much. it is means a lot @lpdink
Yeah,just see: https://github.com/microsoft/WSL/issues/9962 @alf-wangzhi