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.76k stars 3.15k forks source link

Zed's text breaks after entering and exiting sleep / suspend #12827

Open Person-Who-Exists opened 5 months ago

Person-Who-Exists commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

After entering and exiting suspend mode with systemctl suspend, the zed ui loses all it's text aside from popups: Zed ui but without text The only way I have found to return the text is to restart Zed or scroll which causes an unpleasant flickering: https://github.com/zed-industries/zed/assets/123006012/abd0213f-86bd-411c-a9d4-f7423413c02e

Environment

landonk@archlinux

OS: Arch Linux x86_64 Host: Predator PH315-54 V1.15 Kernel: 6.9.3-arch1-1 Shell: bash 5.2.26 Resolution: 1920x1080 DE: Plasma 6.0.5 WM: kwin Terminal: alacritty CPU: 11th Gen Intel i7-11800H (16) @ 4.600GHz GPU: Intel TigerLake-H GT1 [UHD Graphics] GPU: NVIDIA GeForce RTX 3050 Ti Mobile Memory: 4097MiB / 15770MiB

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

No response

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

2024-06-04T20:48:28-04:00 [ERROR] {
  "thread": "main",
  "payload": "called `Result::unwrap()` on an `Err` value: ERROR_INITIALIZATION_FAILED",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/9c9cabf/blade-graphics/src/vulkan/init.rs",
    "line": 847
  },
  "backtrace": [
    "__libc_start_main"
  ],
  "app_version": "0.138.4",
  "release_channel": "Zed Preview",
  "os_name": "Linux",
  "os_version": "1.0.0",
  "architecture": "x86_64",
  "panicked_on": 1717548508552,
  "installation_id": "4fad41da-5a89-4558-9f44-da4e9cc8f1f7",
  "session_id": "5cd64a06-a66c-4eb2-ab74-79432e619c25"
}
apricotbucket28 commented 5 months ago

This is really weird, and it looks like a graphical issue (rather than an issue with the text system). Could you run Zed with RUST_LOG=info,blade_graphics=debug and share the output? Also, what does vulkaninfo say?

Person-Who-Exists commented 5 months ago

Output from running zed with systemctl suspend

[2024-06-09T15:32:19-04:00 INFO  zbus::connection::socket_reader] read_socket; self=SocketReader { socket: Async { source: Source { registration: 12, key: 0, state: Mutex { data: [Direction { tick: 24, ticks: Some((23, 23)), waker: None, wakers: Slab { len: 0, cap: 0 } }, Direction { tick: 0, ticks: None, waker: None, wakers: Slab { len: 0, cap: 0 } }], poisoned: false, .. } }, io: Some(UnixStream { fd: FileDesc(OwnedFd { fd: 12 }), local: (unnamed), peer: "/run/user/1000/bus" (pathname) }) }, senders: Mutex { data: {None: Sender { inner: RwLock { data: Inner { queue: [], capacity: 64, receiver_count: 0, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event(<uninitialized>) }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Error), sender: None, interface: None, member: None, path_spec: None, destination: None, args: [], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 8, receiver_count: 0, inactive_receiver_count: 1, sender_count: 2, head_pos: 21, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 18446744073709551615, listeners_total: 0 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Signal), sender: Some(BusName::Unique("org.freedesktop.DBus")), interface: Some(InterfaceName("org.freedesktop.DBus")), member: Some(MemberName("NameOwnerChanged")), path_spec: Some(Path(ObjectPath("/org/freedesktop/DBus"))), destination: None, args: [(0, "org.freedesktop.portal.Desktop")], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 8, receiver_count: 2, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 0, listeners_total: 2 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Signal), sender: Some(BusName::WellKnown("org.freedesktop.portal.Desktop")), interface: Some(InterfaceName("org.freedesktop.portal.Settings")), member: Some(MemberName("SettingChanged")), path_spec: Some(Path(ObjectPath("/org/freedesktop/portal/desktop"))), destination: None, args: [(0, "org.freedesktop.appearance"), (1, "color-scheme")], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 64, receiver_count: 1, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 0, listeners_total: 1 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(MethodReturn), sender: None, interface: None, member: None, path_spec: None, destination: None, args: [], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 8, receiver_count: 0, inactive_receiver_count: 1, sender_count: 2, head_pos: 21, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 18446744073709551615, listeners_total: 0 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Signal), sender: Some(BusName::WellKnown("org.freedesktop.portal.Desktop")), interface: Some(InterfaceName("org.freedesktop.DBus.Properties")), member: Some(MemberName("PropertiesChanged")), path_spec: Some(Path(ObjectPath("/org/freedesktop/portal/desktop"))), destination: None, args: [], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [(Ok(Msg { type: Signal, sender: UniqueName(":1.7"), path: ObjectPath("/org/freedesktop/portal/desktop"), iface: InterfaceName("org.freedesktop.DBus.Properties"), member: MemberName("PropertiesChanged"), body: Signature("sa{sv}as"), fds: [] }), 1)], capacity: 64, receiver_count: 1, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 18446744073709551615, listeners_total: 1 } }, poisoned: false, .. } }} }, already_received_bytes: None, prev_seq: 23, activity_event: Event(<uninitialized>) }
[2024-06-09T15:32:25-04:00 INFO  zbus::connection::socket_reader] read_socket; self=SocketReader { socket: Async { source: Source { registration: 12, key: 0, state: Mutex { data: [Direction { tick: 25, ticks: Some((25, 24)), waker: None, wakers: Slab { len: 0, cap: 0 } }, Direction { tick: 0, ticks: None, waker: None, wakers: Slab { len: 0, cap: 0 } }], poisoned: false, .. } }, io: Some(UnixStream { fd: FileDesc(OwnedFd { fd: 12 }), local: (unnamed), peer: "/run/user/1000/bus" (pathname) }) }, senders: Mutex { data: {None: Sender { inner: RwLock { data: Inner { queue: [], capacity: 64, receiver_count: 0, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event(<uninitialized>) }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Error), sender: None, interface: None, member: None, path_spec: None, destination: None, args: [], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 8, receiver_count: 0, inactive_receiver_count: 1, sender_count: 2, head_pos: 21, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 18446744073709551615, listeners_total: 0 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Signal), sender: Some(BusName::Unique("org.freedesktop.DBus")), interface: Some(InterfaceName("org.freedesktop.DBus")), member: Some(MemberName("NameOwnerChanged")), path_spec: Some(Path(ObjectPath("/org/freedesktop/DBus"))), destination: None, args: [(0, "org.freedesktop.portal.Desktop")], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 8, receiver_count: 2, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 0, listeners_total: 2 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Signal), sender: Some(BusName::WellKnown("org.freedesktop.portal.Desktop")), interface: Some(InterfaceName("org.freedesktop.portal.Settings")), member: Some(MemberName("SettingChanged")), path_spec: Some(Path(ObjectPath("/org/freedesktop/portal/desktop"))), destination: None, args: [(0, "org.freedesktop.appearance"), (1, "color-scheme")], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 64, receiver_count: 1, inactive_receiver_count: 1, sender_count: 1, head_pos: 0, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 0, listeners_total: 1 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(MethodReturn), sender: None, interface: None, member: None, path_spec: None, destination: None, args: [], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [], capacity: 8, receiver_count: 0, inactive_receiver_count: 1, sender_count: 2, head_pos: 21, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 18446744073709551615, listeners_total: 0 } }, poisoned: false, .. } }, Some(OwnedMatchRule(MatchRule { msg_type: Some(Signal), sender: Some(BusName::WellKnown("org.freedesktop.portal.Desktop")), interface: Some(InterfaceName("org.freedesktop.DBus.Properties")), member: Some(MemberName("PropertiesChanged")), path_spec: Some(Path(ObjectPath("/org/freedesktop/portal/desktop"))), destination: None, args: [], arg_paths: [], arg0ns: None })): Sender { inner: RwLock { data: Inner { queue: [(Ok(Msg { type: Signal, sender: UniqueName(":1.7"), path: ObjectPath("/org/freedesktop/portal/desktop"), iface: InterfaceName("org.freedesktop.DBus.Properties"), member: MemberName("PropertiesChanged"), body: Signature("sa{sv}as"), fds: [] }), 1)], capacity: 64, receiver_count: 1, inactive_receiver_count: 1, sender_count: 1, head_pos: 1, overflow: false, await_active: false, is_closed: false, send_ops: Event(<uninitialized>), recv_ops: Event { listeners_notified: 18446744073709551615, listeners_total: 1 } }, poisoned: false, .. } }} }, already_received_bytes: None, prev_seq: 24, activity_event: Event(<uninitialized>) }

Also, is there a specific section of vulkan info you need? I don't think I can fit the full info into a single github comment.

apricotbucket28 commented 5 months ago

Output from running zed with systemctl suspend

That doesn't say anything useful in this case. Could you share the whole log from running with those settings I mentioned?

Also, is there a specific section of vulkan info you need? I don't think I can fit the full info into a single github comment.

You can attach the output file or upload it to https://pastebin.com/.

Person-Who-Exists commented 5 months ago

Zed error + vulkaninfo

Moshyfawn commented 5 months ago

This looks like the same Vulkan error as in #8168 🤔

Person-Who-Exists commented 5 months ago

I had that error too at first and I couldn't even start Zed, but after properly setting up Nvidia drivers (Adding early loading etc.) (Archinstall doesn't do all the steps) I can get it to start without errors in terminal. This weird text rendering issue only happens after a suspension.

mikayla-maki commented 5 months ago

We couldn't reproduce these on our machines. Let us know if it's still happening :)

Person-Who-Exists commented 5 months ago

This is still an issue, here is a full video showing it.

https://github.com/zed-industries/zed/assets/123006012/4b198200-3b84-4b85-a315-5bca73f1aab7

apricotbucket28 commented 5 months ago

This is still an issue, here is a full video showing it. Screencast_20240626_145138.mp4

Hmm... notice how it's not only the text but also icons (only quads seem to be rendered after resume)

Could you try running with the OpenGL ES backend? you'll need to recompile with RUSTFLAGS="--cfg gles" cargo run --release

Person-Who-Exists commented 5 months ago

Running with those flags appear to stop the breakage of zed.

EDLLT commented 2 months ago

image I am also facing the same issue but in my case, Zed stops responding completely and sometimes it just crashes as soon as I open my pc

Ubuntu 24.04 Nvidia Version: 550 Graphics Driver: Nvidia 3060 Ti Zed 0.152.4

aureliobarbosa commented 1 month ago

Same problem here:

Ubuntu 24.04.1, via X11. Nvidia Version: 555 Graphics Driver: Nvidia RTX 2060 Super Zed 0.155.2

I was trying zed but this is a blocker for my workflow. As soon as it is fixed I will try it again.

bernardolansing commented 2 days ago

For me it breaks completely, causing Zed to quit. I've managed to get the error message by running Zed with zed --foreground:

Details

``` [2024-11-19T19:01:12-03:00 ERROR zed::reliability] { "thread": "main", "payload": "GPU has crashed, and no debug information is available.", "location_data": { "file": "/home/ubuntu/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/e142a3a/blade-graphics/src/vulkan/command.rs", "line": 439 }, "backtrace": [ "core::panicking::panic_fmt", "::submit", "gpui::platform::blade::blade_renderer::BladeRenderer::draw", "::draw", "gpui::window::Window::new::{{closure}}::{{closure}}", "gpui::window::Window::new::{{closure}}", "gpui::platform::linux::wayland::window::WaylandWindowStatePtr::frame", ">::event", "wayland_client::event_queue::queue_callback", "> as calloop::sources::EventDispatcher>::process_events", "::run", "gpui::platform::linux::platform::::run", "gpui::app::App::run", "zed::main", "std::sys::backtrace::__rust_begin_short_backtrace", "std::rt::lang_start::{{closure}}", "std::rt::lang_start_internal", "main", "__libc_start_call_main", "__libc_start_main_impl", "_start" ], "app_version": "0.161.2", "release_channel": "Zed", "os_name": "Linux Wayland", "os_version": "ubuntu 24.10", "architecture": "x86_64", "panicked_on": 1732053672664, "system_id": "b6f50655-c9ec-4bc1-a726-331f83ee6205", "installation_id": "34da3835-484d-4d6e-9b13-bef3106a5c0a", "session_id": "eef2b92a-0789-4324-a300-a2a2d7598de1" } ```

jansol commented 2 days ago

Can affected people post what sleep modes their systems support (and what they actually use)? The reproducibility problem may be related to different sleep modes being used.

You can find out like this:

$ cat /sys/power/mem_sleep
s2idle [deep]

This one is my desktop, which supports suspend-to-idle (s2idle) and suspend-to-ram (deep), and the latter is what it actually chooses to do at the moment. I have heard a lot of stories about problems with resuming from suspend, but haven't encountered them myself (I haven't really used suspend on the desktop). FWIW on my laptop Zed is fine after suspending by closing the lid (only s2idle supported, AMD integrated GPU with RADV driver + NVIDIA with proprietary driver)

@mikayla-maki I'd double-check what your test machines say about that as well.

aureliobarbosa commented 2 days ago
❯ cat /sys/power/mem_sleep 
s2idle [deep]

Just installed the last version and the problem persists (with the same configuration as indicated above).

moderation commented 1 day ago

OpenSUSE Tumbleweed and building from source on main

cat /sys/power/mem_sleep
[s2idle] deep

image image