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] image

In Windows, “nvidia-smi” output is : image

but in wsl2, output is : image

Below are the solutions I have tried that didn’t work:

  1. log in with administrator privileges
  2. update the driver to the latest version
  3. install cuda toolkits

My file list in C:\Windows\System32\lxss\lib is :

image

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)

Most upvoted comments

Here, I found solution in #9962 that says:

Inside the file /etc/nvidia-container-runtime/config.toml change no-cgroups from true to false

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