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
48.42k stars 2.88k forks source link

zed crashes using with nvidia 560 #17859

Closed akseg73 closed 1 month ago

akseg73 commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Here is what i see, when running on fedora 40, just downloaded and installed all nvidia drivers and kernel modules, which apparently llama is able to utilize.

$ zed --foreground [2024-09-15T14:26:14-07:00 ERROR fs] No such file or directory (os error 2) about ["/root/.config/github-copilot"] 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#21: error 0: DRM Syncobj surface object already created for surface 21 [2024-09-15T14:26:14-07:00 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::::resize", "gpui::platform::blade::blade_renderer::BladeRenderer::new", "gpui::platform::linux::wayland::window::WaylandWindow::new", "::open_window", "gpui::platform::linux::platform::::open_window", "gpui::window::Window::new", "workspace::Workspace::new_local::{{closure}}::{{closure}}", "async_task::raw::RawTask<F,T,S,M>::run", "::run", "gpui::platform::linux::platform::::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": 1726435574880, "installation_id": "120b9b9d-46e3-4660-a0e1-bdb474752b4f", "session_id": "6cdbc106-581c-417b-bd4f-ee0a1c6b516a" }

Environment

fedora 40 nvidia 560 driver

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


GabrielSahdo commented 1 month ago

It happens to me every time that i resize the window

notpeter commented 1 month ago

I think this is a duplicate of:

There are some workaround suggested (downgrading to nvidia drivers v555, forcing usage of the discrete GPU).

akseg73 commented 4 weeks ago

I did not find the workaround to force the useage of Intel Integerated GPU (UHD770) ... since the nvidia GPU is running llms it is probably better to avoid utilizing the nvidia GPU regardless of this bug. for a cpu core i7 14700, it should support vulkan ... how do we force the use of iGPU instead of nvidia?

notpeter commented 4 weeks ago

I think it's just export DRI_PRIME=1 before running zed. If that works you can edit your .desktop shortcut to include that too. More info:

akseg73 commented 4 weeks ago

Thanks for your response ... i think iGPU should be fast enough for an editor which is not doing any fancy animations ...

akseg73 commented 4 weeks ago

One can't help but muse that this bug is a blessing in disguise, there are probably a lot of people who would rather run this on iGPU and free up the discreet card for more intensive tasks ...

iamjdcollins commented 4 weeks ago

I have found another solution that worked for me. Reading Arch documentation on the NVIDIA drivers there are two kernel settings mentioned. With current 560 drivers provided with Arch and these two kernel parameters zed is launching perfectly fine. I won't claim to fully understand the ramifications of these settings, but they do mention being required for Wayland compositors to work properly.

Reference: https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting

nvidia_drm.modeset=1 nvidia_drm.fbdev=1

deng232 commented 3 weeks ago

nvidia_drm.modeset=1 nvidia_drm.fbdev=1 didn't work in nixos. I have checked the parameters are enabled through

sudo cat /sys/module/nvidia_drm/parameters/modeset
sudo cat /sys/module/nvidia_drm/parameters/fbdev

both output Y

akseg73 commented 3 weeks ago

After utilizing export DRI_PRIME=1 on fedora 40 a window appears and immediately dies and if zed is run with --foreground the error remains the same: zed --foreground 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 [2024-09-21T21:49:10-07:00 ERROR fs] No such file or directory (os error 2) about ["/root/.config/github-copilot"] [2024-09-21T21:49:10-07:00 ERROR zed::reliability] { "thread": "main", "payload": "called Result::unwrap() on an Err value: ERROR_UNKNOWN", "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::::resize", "gpui::platform::blade::blade_renderer::BladeRenderer::new", "::open_window", "gpui::platform::linux::platform::::open_window", "gpui::window::Window::new", "workspace::Workspace::new_local::{{closure}}::{{closure}}", "async_task::raw::RawTask<F,T,S,M>::run", "::run", "gpui::platform::linux::platform::::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 X11", "os_version": "fedora 40", "architecture": "x86_64", "panicked_on": 1726980550587, "installation_id": "120b9b9d-46e3-4660-a0e1-bdb474752b4f", "session_id": "3c2f65ff-8986-4cd6-aa98-876ddcbe098f" }

akseg73 commented 3 weeks ago

It may be that ZED is not working on fedora, it may be working on other flavors of linux ... a window just appeared and disappeared immediately ...

akseg73 commented 3 weeks ago

We are kind of stuck on this, any ideas when the fix may be available? we have to be able to utilize DRI_PRIME=1 to force usage of iGPU because the Nvidia GPU is occupied by the LLM

starfreck commented 5 days ago

I think it's just export DRI_PRIME=1 before running zed. If that works you can edit your .desktop shortcut to include that too. More info:

This solution worked for me on a hybrid graphics laptop. My primary GPU is Intel and my secondary GPU is NVIDIA. If export DRI_PRIME=1 does not work try export DRI_PRIME=0

starfreck commented 5 days ago

It may be that ZED is not working on fedora, it may be working on other flavors of linux ... a window just appeared and disappeared immediately ...

FYI you are using X11, I am using Wayland on a flavour of Fedora Silverblue (bluefin-dx) and it worked for me. Try switching to the Wayland session and see if it works.