Nvidia-smi through WSL2

Here is my PC build.

OS: Windows 10 Pro, 64-Bit
GPU: NVIDIA GeForce GTX 1080 Ti x 4
CPU: AMD Ryzen Threadripper 1950X 16-Core Processor

I was able to successfully install WSL2 and Ubuntu 20.04. I also installed Windows Terminal to run the commands.

I tried installing CUDA and it seems that did not actually work.

  1. I downloaded the WSL drivers from: CUDA on WSL | NVIDIA Developer

I downloaded and ran the exe: 470.76_gameready_win10-dch_64bit_international.exe

  1. I then following this user guide: CUDA on WSL :: CUDA Toolkit Documentation

I ran:

  1. Step 2 seemed to have run successfully but when I try running nvidia-smi I get:

This makes me think the CUDA installation did not actually work.

what’s the the Windows build you are running? (winver.exe )

Microsoft Windows
Version 20H2 (OS Build 19042.1052)

As stated here, CUDA in WSL2 is only available in build 20145 and superior. For now is only for Insider builds in the Dev channel but it should be available for everyone in October-November in the upcoming Windows 10 version 21H2.

Thanks for the answer. So what is the best way to “fix” my installation since I have already installed the driver and wsl2? Simply enable the Insider builds, or do I have to uninstall prior items first?

Just enable the Dev channel for Insider builds and after a while the build will appear on Windows Update.

One more question: will this allow me to do multiple GPU training in PyTorch using DDP? Does CUDA in WSL2 allow for this?

Since I don’t have multi-GPU I can’t really say. The nvidia driver is still in preview but they improved it a lot since the first release so maybe it’s already ready for that. Just make sure every gpu has a WDDM3.0 driver installed in Windows and they should appear inside WSL2.

1 Like