Open brys0 opened 4 months ago
I have also started having this same exact issue on my arch Linux install. Probably NVIDIA causing more issues.
does regular zed even work in wsl 2?
does regular zed even work in wsl 2?
No, which is what I said in my issue as well. I tried both regular and preview and neither worked.
In WSL, I was able to get past the error popup with ZED_ALLOW_EMULATED_GPU=1
In WSL, I was able to get past the error popup with
ZED_ALLOW_EMULATED_GPU=1
ZED_ALLOW_EMULATED_GPU=1
removes the error popup by acknowledging "using a emulated GPU is find by me", but it doesn't solve the issue that zed is using an emulated GPU
I have the same problem , zed dont use nvidia gpu in wsl2 , even though I unset wayland ; And when I use glxinfo -B too see gpu infomation , Nvidia Gpu is working , But zed didn't use it when I open zed
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. Our first hope is a support in Dozen/Mesa for this extension to use our GPU.
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: VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/dzn_icd.x86_64.json RUST_LOG='blade_graphics=debug' ./zed --foreground . [2024-09-07T20:26:17+02:00 INFO blade_graphics::hal::init] Enabling Vulkan Portability WARNING: dzn is not a conformant Vulkan implementation, testing use only. WARNING: dzn is not a conformant Vulkan implementation, testing use only. [2024-09-07T20:26:18+02:00 INFO blade_graphics::hal::init] Adapter: "Microsoft Direct3D12 (NVIDIA GeForce RTX 4090)" [2024-09-07T20:26:18+02:00 WARN blade_graphics::hal::init] Rejected for device extension "VK_EXT_inline_uniform_block" not supported. Please update the driver! [2024-09-07T20:26:18+02:00 INFO blade_graphics::hal::init] Adapter: "Microsoft Direct3D12 (AMD Radeon(TM) Graphics)" [2024-09-07T20:26:18+02:00 WARN blade_graphics::hal::init] Rejected for device extension "VK_EXT_inline_uniform_block" not supported. Please update the driver! error opening [PathWithPosition { path: "/home/adrien/.local/zed.app/bin", row: None, column: None }]: NoSupportedDeviceFound
And now it makes more sense. If you want to check which driver implement which extension: $ vulkaninfo
When looking at Blade, the Vulkan library used by Zed, it's written: On Vulkan we'll require certain features to make the translation simple:
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. 😅
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. Our first hope is a support in Dozen/Mesa for this extension to use our GPU.
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: VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/dzn_icd.x86_64.json RUST_LOG='blade_graphics=debug' ./zed --foreground . [2024-09-07T20:26:17+02:00 INFO blade_graphics::hal::init] Enabling Vulkan Portability WARNING: dzn is not a conformant Vulkan implementation, testing use only. WARNING: dzn is not a conformant Vulkan implementation, testing use only. [2024-09-07T20:26:18+02:00 INFO blade_graphics::hal::init] Adapter: "Microsoft Direct3D12 (NVIDIA GeForce RTX 4090)" [2024-09-07T20:26:18+02:00 WARN blade_graphics::hal::init] Rejected for device extension "VK_EXT_inline_uniform_block" not supported. Please update the driver! [2024-09-07T20:26:18+02:00 INFO blade_graphics::hal::init] Adapter: "Microsoft Direct3D12 (AMD Radeon(TM) Graphics)" [2024-09-07T20:26:18+02:00 WARN blade_graphics::hal::init] Rejected for device extension "VK_EXT_inline_uniform_block" not supported. Please update the driver! error opening [PathWithPosition { path: "/home/adrien/.local/zed.app/bin", row: None, column: None }]: NoSupportedDeviceFound
And now it makes more sense. If you want to check which driver implement which extension: $ vulkaninfo
When looking at Blade, the Vulkan library used by Zed, it's written: On Vulkan we'll require certain features to make the translation simple:
- VK_KHR_push_descriptor
- VK_KHR_descriptor_update_template
- VK_EXT_inline_uniform_block
- VK_KHR_dynamic_rendering
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. 😅
Thank you seriously for all this.
If it helps, I'm also getting the emulation in zed on WSL2 with a working Radeon 7900XT. vkcube
works fine with all three of my available GPU options, and here is the list output:
:~$ MESA_VK_DEVICE_SELECT=list zed --foreground
GPU 0: 10005:0 "llvmpipe (LLVM 15.0.7, 256 bits)" CPU
GPU 1: 1002:744c "Microsoft Direct3D12 (AMD Radeon RX 7900 XT)" discrete GPU
GPU 2: 1002:164e "Microsoft Direct3D12 (AMD Radeon(TM) Graphics)" integrated GPU
# dedicated GPU
:~$ vkcube --gpu_number 0
Selected GPU 0: Microsoft Direct3D12 (AMD Radeon RX 7900 XT), type: 2
# emulated
:~$ vkcube --gpu_number 1
Selected GPU 1: llvmpipe (LLVM 15.0.7, 256 bits), type: 4
# dedicated integrated GPU
:~$ vkcube --gpu_number 2
Selected GPU 2: Microsoft Direct3D12 (AMD Radeon(TM) Graphics), type: 1
zed does work but it doesn't matter which GPU I try to select, it always uses emulation:
MESA_VK_DEVICE_SELECT=1002:744c && zed --foreground .
https://github.com/microsoft/wslg/issues/40 Zed developers can contribute to this implementation of MESA:
sudo add-apt-repository ppa:kisak/kisak-mesa sudo apt update sudo apt upgrade
That brind d3d deveice to WSL 2 as mesa. So GPU ZED layer can by develop for WSL2 separately - for Ubuntu on WSL2.
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 withMESA_VK_DEVICE_SELECT=10de:1e81
(my gpu id) Running zed withMESA_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 withVK_ICD_FILENAMES=nvidia_icd.json
Running zed withWAYLAND_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