zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.57k stars 3.13k forks source link

Zed Editor doesn't launch the GUI with error : VulkanError(ERROR_OUT_OF_HOST_MEMORY) #17525

Open ManuaL46 opened 2 months ago

ManuaL46 commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I installed zed editor through the flatpak and the installation script provided in the installation guide. When I try to launch the GUI app I get the this error

manual@fedora-silverblue:~$ zed . error opening [PathWithPosition { path: "/var/home/manual", row: None, column: None }]: VulkanError(ERROR_OUT_OF_HOST_MEMORY)

By using ps I can see there is a process running for zed just the GUI is not launching.

manual@fedora-silverblue:~$ ps -ef | grep -i zed manual 27989 5252 99 12:53 ? 00:00:01 /var/home/manual/.local/zed.app/libexec/zed-editor zed-cli:///tmp/.tmpTDo70y/socket manual 28083 27989 37 12:53 ? 00:00:00 /var/home/manual/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node /var/home/manual/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js --stdio manual 28096 27377 0 12:53 pts/3 00:00:00 grep --color=auto -i zed

My system has hybrid graphics with AMD Vega 7 iGPU and a Nvidia RTX 3050 85W mobile and both support vulkan 1.3. I also tested by installing through distrobox but still the same issue and vkcube works as intended inside the container.

Not sure how I can get it to work, as there is no verbose mode to check for more details for debugging. I tried using export RUST_BACKTRACE=1 to no avail.

Environment

System Details Report


Report details

Hardware Information:

Software Information:

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

[Zed.log](https://github.com/user-attachments/files/16915239/Zed.log)
jansol commented 2 months ago

You can try launching zed with --foreground to get some more log output in the terminal.

oguzhaniptes commented 2 months ago

I tried launch with zeditor --foreground output is

Protocol error 0 on object wl_surface@23:

what should i do ?

ManuaL46 commented 2 months ago

I had the exact same issue as @oguzhaniptes when I used zed --foreground. @oguzhaniptes are you using an atomic/immutable distro?

wl_surface is wayland specific terminology AFAIK, I tested on X11 and well the issue is no longer present.

Current workaround that I suggest using is to run zed in XWayland using the following command env -u WAYLAND_DISPLAY zed . This will unset the variable WAYLAND_DISPLAY and launch the app using XWayland.

jansol commented 2 months ago

The wl_surface thing seems to be a common problem with nvidia hybrid graphics.

ManuaL46 commented 2 months ago

The wl_surface thing seems to be a common problem with nvidia hybrid graphics.

Weird because the nvidia graphics aren't used, and I have setup optimus correctly. I tried force launching it on the nvidia graphics and the same issue is still there.

What might be the exact explanation for this?

jansol commented 2 months ago

What might be the exact explanation for this?

No idea, I don't have any affected hardware and no spoons for digging deeper. Hybrid setups with specifically one GPU being NVIDIA and the other not just seem to be a strong theme in these reports.

oguzhaniptes commented 2 months ago

@ManuaL46 im using arch linux with Wayland. I have amd and nvidia gpu.

But unlike you vulkan use my nvidia gpu when i run vkcube-wayland command. Selected GPU 1: NVIDIA GeForce RTX 3050 Ti Laptop GPU, type: DiscreteGpu

If i use env -u WAYLAND_DISPLAY zeditor . command Zed openning fastly and without any problem.

v3ss0n commented 2 months ago

thnks , this fixed for me env -u WAYLAND_DISPLAY zed .

ManuaL46 commented 1 month ago

Hi, something unrelated but similar issue popped up, with some changes to gnome, where they switched the default renderer to vulkan, and some gnome apps were not opening on systems with hybrid graphics.

Can someone look into this mesa issue and verify if this is also the culprit for the current specific issue as well?

I don't really understand the technical details of wayland that much, but if this is the root cause this issue can be closed.

oguzhaniptes commented 1 month ago

I had the same situation. I was updated to Gnome 47 but all Gnome app not working truthly. Im writing comment from Hyprland. Zed is still not working in the Wayland session on Hyprland. Then I started to think Zed is not relevant this issue. The culprit could be Vulkan.

ManuaL46 commented 3 weeks ago

Hello, I have updated to fedora 41 and gnome 47, the previously mentioned vulkan issue seems to be resolved in this update. So I tested using zed without Xwayland and it seems to be working for me in my hybrid graphics environment. Can someone else confirm this workaround is no longer needed to run zed on wayland and hybrid graphics.