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
49.28k stars 2.99k forks source link

Zed is Not Launching On Fedora Linux #17256

Open IshanAsati opened 2 months ago

IshanAsati commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I open zed and then i can see it in the taskbar for like a split second then it crashes, I also cant launch with the terminal I don't know how to recreate it tbh

Environment

System Details Report


Report details

Hardware Information:

Software Information:

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log

ramipellumbi commented 2 months ago

It is interesting you report this -- I have been using Zed on Fedora and it was working fine until today. Now, the official and preview releases both crash on launch. I presume it was due to all the updates I installed this morning. Unfortunately, I do not know what updated as I just hit the good 'ol sudo dnf update -y

EDIT: including the panic log

{"thread":"main","payload":"called `Result::unwrap()` on an `Err` value: ERROR_SURFACE_LOST_KHR","location_data":{"file":"/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/ac25c77/blade-graphics/src/vulkan/init.rs","line":822},"backtrace":["core::panicking::panic_fmt","core::result::unwrap_failed","blade_graphics::hal::init::<impl blade_graphics::hal::Context>::resize","gpui::platform::linux::wayland::window::WaylandWindowStatePtr::set_size_and_scale","<gpui::platform::linux::wayland::client::WaylandClientStatePtr as wayland_client::event_queue::Dispatch<wayland_protocols::wp::fractional_scale::v1::generated::client::wp_fractional_scale_v1::WpFractionalScaleV1,wayland_backend::sys::client::ObjectId>>::event","wayland_client::event_queue::queue_callback","<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events","<gpui::platform::linux::wayland::client::WaylandClient as gpui::platform::linux::platform::LinuxClient>::run","gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run","gpui::app::App::run","zed::main","std::sys_common::backtrace::__rust_begin_short_backtrace","std::rt::lang_start::{{closure}}","std::rt::lang_start_internal","main","__libc_start_call_main","__libc_start_main_alias_1","_start"],"app_version":"0.150.4","release_channel":"Zed","os_name":"Linux Wayland","os_version":"fedora 40","architecture":"x86_64","panicked_on":1725381858630,"installation_id":"2a2e9441-3858-4997-bece-57378b527a78","session_id":"d7d970aa-eb4a-4e8c-a735-c2210be1ef7b"}
jacobwhall commented 2 months ago

Same story as @ramipellumbi. When I run zed --foreground, I get the same output as this comment. It looks like this issue has to do with a graphics driver update.

ramipellumbi commented 2 months ago

Same story as @ramipellumbi. When I run zed --foreground, I get the same output as this comment. It looks like this issue has to do with a graphics driver update.

From that same thread -- I am working around it for now via: https://github.com/zed-industries/zed/issues/17129#issuecomment-2323817322

deng232 commented 1 month ago

happens to me today wayland, with intel mesa driver.

update: actually not, I though zed gpu selection based on nvidia prime provided

snapfast commented 1 month ago

Not working on Fedora 40 ZED :(

snapfast commented 1 month ago
xkbcommon: ERROR: /usr/share/X11/locale/en_US.UTF-8/Compose:1661:1: unrecognized keysym "dead_hamza" on left-hand side
xkbcommon: ERROR: /usr/share/X11/locale/en_US.UTF-8/Compose:1662:1: unrecognized keysym "dead_hamza" on left-hand side
xkbcommon: ERROR: /usr/share/X11/locale/en_US.UTF-8/Compose:1663:1: unrecognized keysym "dead_hamza" on left-hand side
xkbcommon: ERROR: /usr/share/X11/locale/en_US.UTF-8/Compose:1664:1: unrecognized keysym "dead_hamza" on left-hand side
xkbcommon: ERROR: /usr/share/X11/locale/en_US.UTF-8/Compose:1665:1: unrecognized keysym "dead_hamza" on left-hand side
wl_surface#22: error 0: DRM Syncobj surface object already created for surface 22
[2024-09-14T00:27:35+05:30 ERROR zed::reliability] {
  "thread": "main",
  "payload": "called `Result::unwrap()` on an `Err` value: ERROR_SURFACE_LOST_KHR",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/e142a3a/blade-graphics/src/vulkan/init.rs",
    "line": 930
  },
  "backtrace": [
    "core::panicking::panic_fmt",
    "core::result::unwrap_failed",
    "blade_graphics::hal::init::<impl blade_graphics::hal::Context>::resize",
    "gpui::platform::blade::blade_renderer::BladeRenderer::new",
    "gpui::platform::linux::wayland::window::WaylandWindow::new",
    "<gpui::platform::linux::wayland::client::WaylandClient as gpui::platform::linux::platform::LinuxClient>::open_window",
    "gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::open_window",
    "gpui::window::Window::new",
    "workspace::Workspace::new_local::{{closure}}::{{closure}}",
    "async_task::raw::RawTask<F,T,S,M>::run",
    "<gpui::platform::linux::wayland::client::WaylandClient as gpui::platform::linux::platform::LinuxClient>::run",
    "gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run",
    "gpui::app::App::run",
    "zed::main",
    "std::sys_common::backtrace::__rust_begin_short_backtrace",
    "std::rt::lang_start::{{closure}}",
    "std::rt::lang_start_internal",
    "main",
    "__libc_start_call_main",
    "__libc_start_main_alias_1",
    "_start"
  ],
  "app_version": "0.152.3",
  "release_channel": "Zed",
  "os_name": "Linux Wayland",
  "os_version": "fedora 40",
  "architecture": "x86_64",
  "panicked_on": 1726253855252,
  "installation_id": "56858ff5-4a92-4ea3-be00-44e094d9ca02",
  "session_id": "38a9dd39-f0e5-445b-82a4-a8f0546f53fb"
}

Error when running zed --foreground

notpeter commented 1 month ago

@IshanAsati Which version of the Nvidia driver are you using?

  1. Running export DRI_PRIME=1 before running zed from the command line (which will default to using your AMD CPU integrated graphics before launch)

  2. Attempt to apply the NVidia kernel driver settings mentioned here (not sure exactly how to do this in Fedora, but it should be possible):

See also:

akseg73 commented 1 month ago

This issue still exists on Fedora 40, utilizing DRI_PRIME=1 does not help. We have to be able to utilize the iGPU because the Nvidia GPU is occupied by the LLM ...

akseg73 commented 1 month ago

Found it, to utilize iGPU you have to say DRI_PRIME=0 not 1 as is suggested by someone sel

tobico commented 1 month ago

I'm running into this same issue also. Running from the terminal after export DRI_PRIME=1 functions as a workaround, but I have no idea how I'd make it work when launched normally, and I'd prefer not to have to launch GUI applications from the terminal.

notpeter commented 1 month ago

I'm running into this same issue also. Running from the terminal after export DRI_PRIME=1 functions as a workaround, but I have no idea how I'd make it work when launched normally, and I'd prefer not to have to launch GUI applications from the terminal.

You can edit the desktop shortcut to include that in the environment. For example:

$ cat ~/.local/share/applications/dev.zed.Zed.desktop 
[Desktop Entry]
Version=1.0
Type=Application
Name=Zed
GenericName=Text Editor
Comment=A high-performance, multiplayer code editor.
TryExec=/home/peter/.local/zed.app/libexec/zed-editor
StartupNotify=true
Exec=/home/peter/.local/zed.app/libexec/zed-editor %U
Icon=/home/peter/.local/zed.app/share/icons/hicolor/512x512/apps/zed.png
Categories=Utility;TextEditor;Development;IDE;
Keywords=zed;
MimeType=text/plain;application/x-zerosize;inode/directory;x-scheme-handler/zed;
Actions=NewWorkspace;

[Desktop Action NewWorkspace]
Exec=/home/peter/.local/zed.app/libexec/zed-editor --new %U
Name=Open a new workspace

Just edit the Exec line:

Exec=env DRI_PRIME=1 /home/peter/.local/zed.app/libexec/zed-editor %U

reference

snapfast commented 1 month ago

I really don't understand, they made a Code editor and it doesn't work on Linux. What ? Why ?

tobico commented 3 weeks ago

Just edit the Exec line:

Exec=env DRI_PRIME=1 /home/peter/.local/zed.app/libexec/zed-editor %U

For anyone else facing this issue, I found that after editing my desktop file as described, I also had to run sudo update-desktop-database before Zed would launch correctly.