Zed refuses to use GPU (Nvidia) WSL 2 #33802
Replies: 21 comments
-
I have also started having this same exact issue on my arch Linux install. Probably NVIDIA causing more issues. |
Beta Was this translation helpful? Give feedback.
-
does regular zed even work in wsl 2? |
Beta Was this translation helpful? Give feedback.
-
No, which is what I said in my issue as well. I tried both regular and preview and neither worked. |
Beta Was this translation helpful? Give feedback.
-
In WSL, I was able to get past the error popup with |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I have the same problem , zed dont use nvidia gpu in wsl2 , even though I unset wayland ; |
Beta Was this translation helpful? Give feedback.
-
I think I've been down the rabbit hole... TLDR; it's not a direct issue with Zed but with Blade the Vulkan library used by Zed which require a Vulkan extension called VK_EXT_inline_uniform_block like OP mentionned in the former post. Zed is not using your nvidia GPU under WSL2 because the Mesa/Dozen Vulkan implementation which is a passthrough to Direct3D12 lack of VK_EXT_inline_uniform_block extension. This command show the issue: And now it makes more sense. When looking at Blade, the Vulkan library used by Zed, it's written:
I'm now looking at Dozen which was merged two years ago in Mesa if and when the missing VK_EXT_inline_uniform_block will be implemented. I'll let you know if I find something new. 😅 |
Beta Was this translation helpful? Give feedback.
-
Thank you seriously for all this. |
Beta Was this translation helpful? Give feedback.
-
If it helps, I'm also getting the emulation in zed on WSL2 with a working Radeon 7900XT.
zed does work but it doesn't matter which GPU I try to select, it always uses emulation: command:
result: |
Beta Was this translation helpful? Give feedback.
-
microsoft/wslg#40 sudo add-apt-repository ppa:kisak/kisak-mesa That brind d3d deveice to WSL 2 as mesa. |
Beta Was this translation helpful? Give feedback.
-
@brys0 You seem to have already tried running zed with wayland display. However, could you please try manually switching to nvidia, before running with wayland display? And then try running zed with |
Beta Was this translation helpful? Give feedback.
-
Hi, unfortunately switching to nvidia with prime-select doesn't work currently on wsl 2 it seems. brys0@brys:/mnt/c/Users/bryso$ sudo prime-select nvidia
Error: no integrated GPU detected. |
Beta Was this translation helpful? Give feedback.
-
Hi @apestel, I see similar issue with my integrated GPU:
|
Beta Was this translation helpful? Give feedback.
-
Same issue here. Zed is only using λ ~/ MESA_VK_DEVICE_SELECT=list zed --foreground
MESA-INTEL: warning: cannot initialize blitter engine
selectable devices:
GPU 0: 8086:7d55 "Intel(R) Arc(tm) Graphics (MTL)" integrated GPU 0000:00:02.0
GPU 1: 10005:0 "llvmpipe (LLVM 15.0.7, 256 bits)" CPU 0000:00:00.0
Fwiw: the last time my integrated GPU was used is
The only think I can think of changing was my build from Ghostty, which required Zig, gtk4, and a few other things. EDIT: Zed version info:
|
Beta Was this translation helpful? Give feedback.
-
Just to make things clear: it's not your device, nor your system or your libraries. Under WSL2, we depend on a Vulkan driver which translates GPU API calls to Direct3D (DirectX 12). You can try to implement this feature in Dozen (Mesa Vulkan to Direct3D Driver). It's out of my knowledge and current capabilities (Person willing to achieve this challenge need to have a good understanding of both Vulkan and Direct3D). In the meantime, you can build Zed from source. It works well natively under Windows. I hope it makes things clearer. |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks. Yeah, I'm using Zed also via Windows (scoop install versions/zed-nightly), but was exactly looking for the "remote" feature and that's why I gave a try on WSL. |
Beta Was this translation helpful? Give feedback.
-
@apestel - thanks for the explanation but can you help us understand why that inline_uniform_block call is strictly required in zed? Why do apps like google-chrome and vscode run fine in wsl2? it's not like their gpu performance is bad or anything either. |
Beta Was this translation helpful? Give feedback.
-
The Zed developers have selected the Blade GPU library to handle the bulk of the rendering workload. This library relies on certain Vulkan features for optimal performance, such as VK_EXT_inline_uniform_block. In contrast, other applications use different GPU rendering implementations and may not require the same Vulkan feature set. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a... strong choice if this means WSL can't possibly work then, eh? |
Beta Was this translation helpful? Give feedback.
-
They built blade specifically for rendering in zed. I don't think it'd be a very worthwhile change to create a different renderer |
Beta Was this translation helpful? Give feedback.
-
can we have some fallback plan if VK_EXT_inline_uniform_block is only for "optimal performance"? fallback to a normal gpu solution could still be better than fallback to cpu simulation. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Check for existing issues
Describe the bug / provide steps to reproduce it
wsl -v
Tried the regular ver. of zed as well
zed --version
Attempting to run zed results in it using the llvmpipe software renderer and not my dedicated gpu.
To attempt and resolve this I have tried the following
vkcube
This works, gpu is dedicated correctly and used in the application.
nvidia-smi
vulkaninfo (truncated)
MESA_VK_DEVICE_SELECT=list zed --foreground
Things I've tried:
Running zed with
DRI_PRIME=1
Running zed with
MESA_VK_DEVICE_SELECT=10de:1e81
(my gpu id)Running zed with
MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE=1
(Running zed with this causes the application not to display at all, the logs are similar as well)Running zed with
VK_ICD_FILENAMES=nvidia_icd.json
Running zed with
WAYLAND_DISPLAY=''
Additional steps I've tried:
Restarting computer
Restarting WSL
Reinstalling Ubuntu WSL from scratch
Installing CUDA drivers on Windows and Linux
Reinstalling mesa on Linux
Logs:
Environment
Processor Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz 3.60 GHz
Installed RAM 32.0 GB
Device ID 0F91E45C-0632-495F-9E08-DC08052333DE
Product ID 00330-80000-00000-AA933
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
GPU Settings

neofetch
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your Zed.log file to this issue.
Zed.log
Here are the logs just running with WAYLAND_DISPLAY='''
Zed.log
Zed_MESA_VK_DEVICE_SELECT&DRI_PRIME.log, Unsupported GPU, but window is displayed
There are no logs at all when MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE=1 is set. No logs are created in .local/share/zed/logs/Zed.log
Logs in console are the following:
With
VK_ICD_FILENAMES=nvidia_icd.json
as well logs return an error fromblade_graphics::hal::init
Beta Was this translation helpful? Give feedback.
All reactions