/dev/dxg not visible and NVIDIA-SMI couldn't find libnvidia-ml.so library

Hello, my system information is as follows:

  • Windows 10 22H2
  • Ubuntu 20.04 (WSL 2)
  • ROS Melodic
  • Nvidia Geforce Driver 536.40
  • Nvidia Geforce RTX 3070

The “nvidia-smi” command works well in the windows system. However, in wsl2 system it gets the following error

NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system. 
Please also try adding directory that contains libnvidia-ml.so to your system PATH

As I further look into this issue, the “libnvidia-ml.so library” is missing in the supposed path. Moreover, in the “/dev/dxg” path the GPU is not visible. The wsl2 system seems fail to detect the GPU. I also get the issue that the Nvidia driver can not be uninstalled or reinstalled in the Windows system.

Thanks a lot for any help and suggestion!

I never saw that particular error, but I was banging my head against the wall for a while trying to get WSL to work before discovering that it was running in WSL v1 mode instead of v2.

If you run dmesg and it only gives a few lines, you’re probably in v1 mode.

1 Like

Thank you very much for your reply!

I have run several commands to confirm the WSL kernel version. These are what I got: (Sorry for the misrepresentation in this topic. I use Ubuntu 18.04 instead of Ubuntu 20.04)

cat /proc/sys/kernel/osrelease
5.15.90.1-microsoft-standard-WSL2

wsl --list --verbose
  NAME            STATE           VERSION
* Ubuntu-18.04    Running         2

I also tried to run “dmesg” and it also began with “Linux version 5.15.90.1-microsoft-standard-WSL2”. But I am confused with the output of the following command:

ls -l /proc/sys/kernel/osrelease
-r--r--r-- 1 root root 0 Jul 13 17:17 /proc/sys/kernel/osrelease

Is the output supposed to contain something like “microsoft-standard-WSL2”?

I guess that this nvidia error is related to the version of WSL2 kernel. I will try to downgrade the WSL2 kernel in the few days and I will update this topic soon.

Thank you again for your kind help! Have a nice day:)

Sorry, I’m not here often, and I’m not sure how to address your main issue, but that last one at least is an easy one… (Let’s see if I can figure out how to make a code section.)

cat /proc/sys/kernel/osrelease
5.15.90.1-microsoft-standard-WSL2

Oh, you did that already. But there’s nothing wrong with the ls -l.