melkam
melkam•4d ago

Unable to request adapter for webgpu on WSL2

Hi. I would like to experiment with webgpu on wsl, but when I tried running my code with deno, I couldn't request adapter.
console.log(await navigator.gpu.requestAdapter()) // returns null on WSL2
console.log(await navigator.gpu.requestAdapter()) // returns null on WSL2
3 Replies
melkam
melkamOP•4d ago
I tried running nvidia-smi to make sure that I can access my gpu
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.02 Driver Version: 566.03 CUDA Version: 12.7 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4060 On | 00000000:29:00.0 On | N/A |
| 0% 42C P8 N/A / 115W | 2132MiB / 8188MiB | 7% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 33 G /Xwayland N/A |
+-----------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.02 Driver Version: 566.03 CUDA Version: 12.7 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4060 On | 00000000:29:00.0 On | N/A |
| 0% 42C P8 N/A / 115W | 2132MiB / 8188MiB | 7% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 33 G /Xwayland N/A |
+-----------------------------------------------------------------------------------------+
I also tried to requestAdapter on windows(the same machine) and on macos. They both worked
crowlKats
crowlKats•4d ago
WSL is currently not supported, see https://github.com/gfx-rs/wgpu/issues/1443
GitHub
Support Windows Subsystem for Linux · Issue #1443 · gfx-rs/wgpu
Microsoft recently released WSLG support for GUI linux applications on windows subsystem for linux. I've enabled all the steps for WSLG and am able to successfully run applications using it (VL...
melkam
melkamOP•4d ago
that's unfortunate 😩 thanks for reply