Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on linux: Aquire image error ERROR_SURFACE_LOST_KHR #14225

Open
1 task done
lemtea8 opened this issue Jul 11, 2024 · 43 comments
Open
1 task done

Crash on linux: Aquire image error ERROR_SURFACE_LOST_KHR #14225

lemtea8 opened this issue Jul 11, 2024 · 43 comments
Labels
bug [core label] linux panic / crash [core label]

Comments

@lemtea8
Copy link

lemtea8 commented Jul 11, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Zed instantly crashes on KDE plasma.
Message from zed --foreground (There's also XIMClientError but I assume it didn't cause the crash):

[2024-07-12T00:34:12+08:00 ERROR gpui::platform::linux::x11::client] XIMClientError: Can't read xim message: Invalid Data ErrorCode: 0
[2024-07-12T00:34:12+08:00 ERROR zed::reliability] {
  "thread": "main",
  "payload": "Aquire image error ERROR_SURFACE_LOST_KHR",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/21a56f7/blade-graphics/src/vulkan/init.rs",
    "line": 954
  },
  "backtrace": [
    "core::panicking::panic_fmt",
    "blade_graphics::hal::init::<impl blade_graphics::hal::Context>::acquire_frame",
    "gpui::platform::blade::blade_renderer::BladeRenderer::draw",
    "<gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw",
    "gpui::window::Window::new::{{closure}}::{{closure}}",
    "gpui::window::Window::new::{{closure}}",
    "<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events",
    "<gpui::platform::linux::x11::client::X11Client 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@@GLIBC_2.34",
    "_start"
  ],
  "app_version": "0.143.6",
  "release_channel": "Zed",
  "os_name": "Linux X11",
  "os_version": "fedora 38",
  "architecture": "x86_64",
  "panicked_on": 1720715652892,
  "installation_id": "f17907b8-d58f-4445-853e-f9e797ee5c22",
  "session_id": "79e466e8-2994-4a23-b629-6fc235061ce7"
}

Environment

Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.8.9-100.fc38.x86_64 (64-bit)
Graphics Platform: X11
Graphics Processor: NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2

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

There is no Zed.log found.

@lemtea8 lemtea8 added admin read Pending admin review bug [core label] panic / crash [core label] triage Maintainer needs to classify the issue labels Jul 11, 2024
@JosephTLyons JosephTLyons added linux and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 11, 2024
@ConradIrwin
Copy link
Member

@lemtea8 does vkcube work for you? https://zed.dev/docs/linux#troubleshooting it sounds like a GPU issue

@lemtea8
Copy link
Author

lemtea8 commented Jul 12, 2024

does vkcube work for you? https://zed.dev/docs/linux#troubleshooting it sounds like a GPU issue

Yes, like below:
Screenshot_20240712_124218

My computer can also run Godot Engine (uses Vulkan 1.3) quite smoothly, which I think is a pretty complex Vulkan program.

@lemtea8
Copy link
Author

lemtea8 commented Jul 12, 2024

After installing Zed from script, I got the zed.log.

Based on the info, I think the problem is that my system is set to nvidia GPU only, but Zed decides to use integrated graphics(which won't work), and eventually caused the crash.

2024-07-13T00:17:36+08:00 [INFO] ========== starting zed ==========
2024-07-13T00:17:36+08:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-07-13T00:17:36+08:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-07-13T00:17:36+08:00 [INFO] Try connect fcitx5
2024-07-13T00:17:36+08:00 [INFO] perform;
2024-07-13T00:17:36+08:00 [INFO] read_command;
2024-07-13T00:17:36+08:00 [INFO] Opening main db
2024-07-13T00:17:36+08:00 [INFO] read_command;
2024-07-13T00:17:36+08:00 [INFO] socket reader;
2024-07-13T00:17:36+08:00 [INFO] new;
2024-07-13T00:17:36+08:00 [INFO] Using git binary path: None
2024-07-13T00:17:36+08:00 [INFO] keep_updated;
2024-07-13T00:17:36+08:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-13T00:17:36+08:00 [INFO] Opening main db
2024-07-13T00:17:36+08:00 [INFO] XConnected server on 50383156, transport version: 0.0, TRANSPORT_MAX: 20
2024-07-13T00:17:36+08:00 [INFO] installing extension html latest version
2024-07-13T00:17:36+08:00 [INFO] perform;
2024-07-13T00:17:36+08:00 [INFO] Using Visual { id: 35, colormap: 0, depth: 32 }
2024-07-13T00:17:36+08:00 [INFO] Creating colormap 83886083
2024-07-13T00:17:36+08:00 [INFO] read_command;
2024-07-13T00:17:36+08:00 [INFO] read_command;
2024-07-13T00:17:36+08:00 [INFO] socket reader;
2024-07-13T00:17:36+08:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:
2024-07-13T00:17:36+08:00 [INFO] Enabling Vulkan Portability
2024-07-13T00:17:36+08:00 [INFO] Enabling color space support
2024-07-13T00:17:36+08:00 [INFO] Adapter "Intel(R) UHD Graphics 630 (CFL GT2)"
2024-07-13T00:17:36+08:00 [INFO] No ray tracing extensions are supported
2024-07-13T00:17:36+08:00 [INFO] Using surface present mode MAILBOX
2024-07-13T00:17:36+08:00 [WARN] Unable to forbid exclusive full screen
2024-07-13T00:17:36+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-13T00:17:36+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-13T00:17:36+08:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-07-13T00:17:36+08:00 [INFO] Refreshing at 6944 micros
2024-07-13T00:17:36+08:00 [INFO] Using surface present mode MAILBOX
2024-07-13T00:17:36+08:00 [WARN] Unable to forbid exclusive full screen
2024-07-13T00:17:36+08:00 [ERROR] XIMClientError: Can't read xim message: Invalid Data ErrorCode: 0
2024-07-13T00:17:36+08:00 [ERROR] {
  "thread": "main",
  "payload": "Aquire image error ERROR_SURFACE_LOST_KHR",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/21a56f7/blade-graphics/src/vulkan/init.rs",
    "line": 954
  },
  "backtrace": [
    "core::panicking::panic_fmt",
    "blade_graphics::hal::init::<impl blade_graphics::hal::Context>::acquire_frame",
    "gpui::platform::blade::blade_renderer::BladeRenderer::draw",
    "<gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw",
    "gpui::window::Window::new::{{closure}}::{{closure}}",
    "gpui::window::Window::new::{{closure}}",
    "<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events",
    "<gpui::platform::linux::x11::client::X11Client 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@@GLIBC_2.34",
    "_start"
  ],
  "app_version": "0.143.6",
  "release_channel": "Zed",
  "os_name": "Linux X11",
  "os_version": "fedora 38",
  "architecture": "x86_64",
  "panicked_on": 1720714776649,
  "installation_id": "f17907b8-d58f-4445-853e-f9e797ee5c22",
  "session_id": "0361f0a0-9a74-4cb5-8379-85646fb13040"
}

@ConradIrwin
Copy link
Member

@lemtea8 Can you try setting VULKAN_DEVICE_INDEX=X to choose the correct GPU?

Would be good to know if there's something we/blade need to test for that we're not yet.

@kvark
Copy link
Contributor

kvark commented Jul 16, 2024

@lemtea8 could you try the following

cat /etc/prime-discrete

And

vkcube --gpu_number 0
vkcube --gpu_number 1

@lemtea8
Copy link
Author

lemtea8 commented Jul 16, 2024

@ConradIrwin

Can you try setting VULKAN_DEVICE_INDEX=X to choose the correct GPU?

Both VULKAN_DEVICE_INDEX 0 and 1 crashed, it seems whatever I set it always uses integrated graphics.

Zed.log (upper part is VULKAN_DEVICE_INDEX=0 and lower part is 1):

2024-07-16T22:02:56+08:00 [INFO] ========== starting zed ==========
2024-07-16T22:02:56+08:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-07-16T22:02:56+08:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-07-16T22:02:56+08:00 [INFO] Try connect fcitx5
2024-07-16T22:02:56+08:00 [INFO] perform;
2024-07-16T22:02:56+08:00 [INFO] read_command;
2024-07-16T22:02:56+08:00 [INFO] read_command;
2024-07-16T22:02:56+08:00 [INFO] Opening main db
2024-07-16T22:02:56+08:00 [INFO] socket reader;
2024-07-16T22:02:56+08:00 [INFO] new;
2024-07-16T22:02:56+08:00 [INFO] keep_updated;
2024-07-16T22:02:56+08:00 [INFO] Using git binary path: None
2024-07-16T22:02:56+08:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-16T22:02:56+08:00 [INFO] Opening main db
2024-07-16T22:02:56+08:00 [INFO] installing extension html latest version
2024-07-16T22:02:56+08:00 [INFO] XConnected server on 50331657, transport version: 0.0, TRANSPORT_MAX: 20
2024-07-16T22:02:56+08:00 [INFO] perform;
2024-07-16T22:02:56+08:00 [INFO] Using Visual { id: 35, colormap: 0, depth: 32 }
2024-07-16T22:02:56+08:00 [INFO] Creating colormap 83886083
2024-07-16T22:02:56+08:00 [INFO] read_command;
2024-07-16T22:02:56+08:00 [INFO] read_command;
2024-07-16T22:02:56+08:00 [INFO] socket reader;
2024-07-16T22:02:56+08:00 [INFO] Enabling Vulkan Portability
2024-07-16T22:02:56+08:00 [INFO] Enabling color space support
2024-07-16T22:02:56+08:00 [INFO] Adapter "Intel(R) UHD Graphics 630 (CFL GT2)"
2024-07-16T22:02:56+08:00 [INFO] No ray tracing extensions are supported
2024-07-16T22:02:56+08:00 [INFO] Using surface present mode MAILBOX
2024-07-16T22:02:56+08:00 [WARN] Unable to forbid exclusive full screen
2024-07-16T22:02:56+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-16T22:02:56+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-16T22:02:56+08:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-07-16T22:02:56+08:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/user/.local/bin:/home/user/Android/Sdk/platform-tools
2024-07-16T22:02:56+08:00 [INFO] Refreshing at 6944 micros
2024-07-16T22:02:56+08:00 [INFO] Using surface present mode MAILBOX
2024-07-16T22:02:56+08:00 [WARN] Unable to forbid exclusive full screen
2024-07-16T22:02:57+08:00 [ERROR] XIMClientError: Can't read xim message: Invalid Data ErrorCode: 0
2024-07-16T22:02:57+08:00 [ERROR] {
  "thread": "main",
  "payload": "Aquire image error ERROR_SURFACE_LOST_KHR",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/21a56f7/blade-graphics/src/vulkan/init.rs",
    "line": 954
  },
  "backtrace": [
    "core::panicking::panic_fmt",
    "blade_graphics::hal::init::<impl blade_graphics::hal::Context>::acquire_frame",
    "gpui::platform::blade::blade_renderer::BladeRenderer::draw",
    "<gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw",
    "gpui::window::Window::new::{{closure}}::{{closure}}",
    "gpui::window::Window::new::{{closure}}",
    "<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events",
    "<gpui::platform::linux::x11::client::X11Client 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@@GLIBC_2.34",
    "_start"
  ],
  "app_version": "0.143.7",
  "release_channel": "Zed",
  "os_name": "Linux X11",
  "os_version": "fedora 38",
  "architecture": "x86_64",
  "panicked_on": 1721138577040,
  "installation_id": "f17907b8-d58f-4445-853e-f9e797ee5c22",
  "session_id": "3c8d7319-5024-4dd2-aff2-fa94bd3d2611"
}
2024-07-16T22:03:11+08:00 [INFO] ========== starting zed ==========
2024-07-16T22:03:11+08:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-07-16T22:03:11+08:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-07-16T22:03:11+08:00 [INFO] Try connect fcitx5
2024-07-16T22:03:11+08:00 [INFO] perform;
2024-07-16T22:03:11+08:00 [INFO] read_command;
2024-07-16T22:03:11+08:00 [INFO] read_command;
2024-07-16T22:03:11+08:00 [INFO] socket reader;
2024-07-16T22:03:11+08:00 [INFO] Opening main db
2024-07-16T22:03:11+08:00 [INFO] new;
2024-07-16T22:03:11+08:00 [INFO] keep_updated;
2024-07-16T22:03:11+08:00 [INFO] Using git binary path: None
2024-07-16T22:03:11+08:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-16T22:03:11+08:00 [INFO] Opening main db
2024-07-16T22:03:11+08:00 [INFO] XConnected server on 50331658, transport version: 0.0, TRANSPORT_MAX: 20
2024-07-16T22:03:11+08:00 [INFO] installing extension html latest version
2024-07-16T22:03:11+08:00 [INFO] perform;
2024-07-16T22:03:11+08:00 [INFO] read_command;
2024-07-16T22:03:11+08:00 [INFO] read_command;
2024-07-16T22:03:11+08:00 [INFO] Using Visual { id: 35, colormap: 0, depth: 32 }
2024-07-16T22:03:11+08:00 [INFO] Creating colormap 85983235
2024-07-16T22:03:11+08:00 [INFO] socket reader;
2024-07-16T22:03:11+08:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/user/.local/bin:/home/user/Android/Sdk/platform-tools
2024-07-16T22:03:11+08:00 [INFO] Enabling Vulkan Portability
2024-07-16T22:03:11+08:00 [INFO] Enabling color space support
2024-07-16T22:03:11+08:00 [INFO] Adapter "Intel(R) UHD Graphics 630 (CFL GT2)"
2024-07-16T22:03:11+08:00 [INFO] No ray tracing extensions are supported
2024-07-16T22:03:11+08:00 [INFO] Using surface present mode MAILBOX
2024-07-16T22:03:11+08:00 [WARN] Unable to forbid exclusive full screen
2024-07-16T22:03:11+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-16T22:03:11+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-16T22:03:11+08:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-07-16T22:03:12+08:00 [INFO] Refreshing at 6944 micros
2024-07-16T22:03:12+08:00 [INFO] Using surface present mode MAILBOX
2024-07-16T22:03:12+08:00 [WARN] Unable to forbid exclusive full screen
2024-07-16T22:03:12+08:00 [ERROR] XIMClientError: Can't read xim message: Invalid Data ErrorCode: 0
2024-07-16T22:03:12+08:00 [ERROR] {
  "thread": "main",
  "payload": "Aquire image error ERROR_SURFACE_LOST_KHR",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/21a56f7/blade-graphics/src/vulkan/init.rs",
    "line": 954
  },
  "backtrace": [
    "core::panicking::panic_fmt",
    "blade_graphics::hal::init::<impl blade_graphics::hal::Context>::acquire_frame",
    "gpui::platform::blade::blade_renderer::BladeRenderer::draw",
    "<gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw",
    "gpui::window::Window::new::{{closure}}::{{closure}}",
    "gpui::window::Window::new::{{closure}}",
    "<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events",
    "<gpui::platform::linux::x11::client::X11Client 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@@GLIBC_2.34",
    "_start"
  ],
  "app_version": "0.143.7",
  "release_channel": "Zed",
  "os_name": "Linux X11",
  "os_version": "fedora 38",
  "architecture": "x86_64",
  "panicked_on": 1721138592103,
  "installation_id": "f17907b8-d58f-4445-853e-f9e797ee5c22",
  "session_id": "19977648-2ac9-47b2-97da-76e910bc6f79"
}

@lemtea8
Copy link
Author

lemtea8 commented Jul 16, 2024

@kvark There is no file which path is /etc/prime-discrete, as I uses envycontrol.
The output of envycontrol --query is nvidia.

vkcube --gpu_number 1 runs normally, it uses discrete GPU.
However, vkcube --gpu_number 0 generates a black window and nothing appears. After closing the window, the graphics driver seems crashed and need to reboot.

@kvark
Copy link
Contributor

kvark commented Jul 16, 2024

That's great, thank you! So you are affected by this platform issue (it's not a Blade implementation problem, strictly speaking), and Intel isn't able to present. I haven't heard of envycontrol, will look into it.

@kvark
Copy link
Contributor

kvark commented Jul 18, 2024

I'm still trying to understand what our options are:

  1. Don't do anything - a significant portion of users will not be able to launch Zed
  2. Prefer Nvidia on all systems that have both Intel and Nvidia - it will work everywhere, but a lot of systems will use the dGPU and burn the battery faster than needed.
  3. Try to create a surface if we suspect the system may be problematic. This would be a good path if the failure was consistent. Previously, I saw the swapchain creation failing. But here we are seeing the swapchain created fine, but the frame failing to be acquired.
  4. Presumably, both prime-select and envycontrol work well with OpenGL apps. So we could initialize a GL context and see what adapter is being chosen by default... This seems like the most hacky implementation, and it drags more dependencies ("khronos-egl" and "gl-rs").

@ConradIrwin
Copy link
Member

@kvark Just so I understand it the problem is that the surface creation fails in a few different way (probably due to a platform issue on the Intel side?).

This can be fixed by:

  • Using a different GPU if one is available
  • Using different GPU drivers?

There's obviously some trade-offs here, but my sense is:

  • It's OK if we fail sometimes as long as we can show a notification to users (as we do if there are no supported devices).
  • It's better to fail less often. It sounds like we can detect some of these cases (e.g. creating a swap chain).
  • There's a trade-off in terms of app boot latency and how much we can try (though I'm not too worried about pulling in more dependencies)

So maybe a sensible plan would be:

  • Allow for submit to return a result so we can dbus notify with a link to the docs instead of just panicking.
  • Add in whatever level of detection you think makes sense to reduce the failure rate

@kvark
Copy link
Contributor

kvark commented Jul 19, 2024

I've implemented (3) in kvark/blade#144
Need more data from running Blade and Zed on affected systems before we can consider this a proper fix.

@ConradIrwin
Copy link
Member

I've pulled kvark/blade#144 into zed main.

Can anyone seeing this issue try zed main and see if it has improved things?

@tepavcevic
Copy link

I've pulled kvark/blade#144 into zed main.

Can anyone seeing this issue try zed main and see if it has improved things?

FWIW I think this update broke zed nighly on my ubuntu 24.04 with intel and nvidia graphics.
Here is relevant contents of the log

2024-07-24T13:40:07.887128317+02:00 [INFO] ========== starting zed ==========
2024-07-24T13:40:08.039451662+02:00 [INFO] perform;
2024-07-24T13:40:08.039530387+02:00 [INFO] read_command;
2024-07-24T13:40:08.039683995+02:00 [INFO] read_command;
2024-07-24T13:40:08.039752146+02:00 [INFO] Opening main db
2024-07-24T13:40:08.040016554+02:00 [INFO] socket reader;
2024-07-24T13:40:08.040899818+02:00 [INFO] new;
2024-07-24T13:40:08.041824877+02:00 [INFO] keep_updated;
2024-07-24T13:40:08.058909588+02:00 [INFO] Using git binary path: None
2024-07-24T13:40:08.114844567+02:00 [ERROR] theme not found: Catppuccin Mocha (Blur)
2024-07-24T13:40:08.117272235+02:00 [INFO] extensions updated. loading 10, reloading 0, unloading 0
2024-07-24T13:40:08.122168924+02:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-24T13:40:08.128470608+02:00 [INFO] Opening main db
2024-07-24T13:40:08.129020676+02:00 [INFO] perform;
2024-07-24T13:40:08.129097238+02:00 [INFO] read_command;
2024-07-24T13:40:08.129142818+02:00 [INFO] read_command;
2024-07-24T13:40:08.129280789+02:00 [INFO] socket reader;
2024-07-24T13:40:08.138700271+02:00 [INFO] new;
2024-07-24T13:40:08.139779953+02:00 [INFO] keep_updated;
2024-07-24T13:40:08.19678284+02:00 [INFO] Enabling Vulkan Portability
2024-07-24T13:40:08.196815659+02:00 [INFO] Enabling color space support
2024-07-24T13:40:08.22527139+02:00 [INFO] Testing presentation capability on Linux/Intel

@ConradIrwin
Copy link
Member

@tepavcevic What happens after that in the logs?

It looks like it's working as expected up to that point

@ConradIrwin
Copy link
Member

Reverting the change before preview out of an abundance of caution #15095

@tepavcevic
Copy link

tepavcevic commented Jul 24, 2024

@ConradIrwin nothing, that's the entire output. I'll try a clean install and give you an update on it.
Update after install:

2024-07-24T17:33:26.703840756+02:00 [INFO] ========== starting zed ==========
2024-07-24T17:33:26.763189341+02:00 [INFO] perform;
2024-07-24T17:33:26.763285129+02:00 [INFO] read_command;
2024-07-24T17:33:26.763508477+02:00 [INFO] Opening main db
2024-07-24T17:33:26.763594316+02:00 [INFO] read_command;
2024-07-24T17:33:26.763765923+02:00 [INFO] socket reader;
2024-07-24T17:33:26.764684731+02:00 [INFO] new;
2024-07-24T17:33:26.765282301+02:00 [INFO] keep_updated;
2024-07-24T17:33:26.765826569+02:00 [INFO] Using git binary path: None
2024-07-24T17:33:26.801215613+02:00 [ERROR] theme not found: Catppuccin Mocha (Blur)
2024-07-24T17:33:26.802179142+02:00 [INFO] extensions updated. loading 10, reloading 0, unloading 0
2024-07-24T17:33:26.806281871+02:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-24T17:33:26.806438441+02:00 [INFO] Opening main db
2024-07-24T17:33:26.808461174+02:00 [INFO] perform;
2024-07-24T17:33:26.808542943+02:00 [INFO] read_command;
2024-07-24T17:33:26.80869932+02:00 [INFO] read_command;
2024-07-24T17:33:26.808866055+02:00 [INFO] socket reader;
2024-07-24T17:33:26.814848709+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.814931632+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.814985427+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.815117472+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.815173786+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.815226099+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.815286654+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.815339308+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.815391507+02:00 [WARN] request completed with error: failed to connect to the server
2024-07-24T17:33:26.821057336+02:00 [INFO] new;
2024-07-24T17:33:26.822284672+02:00 [INFO] keep_updated;
2024-07-24T17:33:26.870165241+02:00 [INFO] Enabling Vulkan Portability
2024-07-24T17:33:26.870206221+02:00 [INFO] Enabling color space support
2024-07-24T17:33:26.886203132+02:00 [INFO] Testing presentation capability on Linux/Intel

@ConradIrwin
Copy link
Member

ConradIrwin commented Jul 24, 2024 via email

@bashfulrobot
Copy link

Hi all, I have run into this issue on Nixos,

❯ zed --version
Zed  – /nix/store/0r0i6wyr1lp0ppws32f6q0qj6qr9xrav-zed-0.147.2/libexec/zed-editor
NVIDIA GeForce RTX 4070 

NVIDIA-SMI 560.31.02              Driver Version: 560.31.02      CUDA Version: 12.6
dustin@evo
----------
OS: NixOS 24.11.20240814.c3aa7b8 (Vicuna) x86_64
Host: XPS 15 9530
Bios (UEFI): 1.7.0 (1.7)
Bootmgr: Linux Boot Manager - systemd-bootx64.efi
Board: 00KH17 (A00)
Chassis: Notebook
Kernel: Linux 6.6.45
Init System: systemd 256.4
Loadavg: 0.72, 0.89, 0.72
Processes: 414
Packages: 2657 (nix-system)
Shell: fish 3.7.1
Editor: nvim
Display (SDC414D): 3456x2160 @ 60 Hz (as 1728x1080) in 16″ [Built-in]
Brightness (SDC414D): 31%
Monitor (eDP-1): 3456x2160 px @ 59.99 Hz - 340x210 mm (15.73 inches, 259.04 ppi)
LM: gdm-password (Wayland)
DE: GNOME 46.4
WM: Mutter (Wayland)
Terminal: alacritty 0.13.2
CPU: 13th Gen Intel(R) Core(TM) i9-13900H (12+8) @ 5.40 GHz - 45.0°C
CPU Cache (L1): 6x48.00 KiB (D), 6x32.00 KiB (I), 8x32.00 KiB (D), 8x64.00 KiB (I)
CPU Cache (L2): 6x1.25 MiB (U), 2x2.00 MiB (U)
CPU Cache (L3): 24.00 MiB (U)
CPU Usage: 0%
GPU 1: Intel Iris Xe Graphics @ 1.50 GHz [Integrated]
GPU 2: NVIDIA GeForce RTX 4070 Max-Q / Mobile [Discrete]
Memory: 4.48 GiB / 31.03 GiB (14%)
Swap: Disabled
Disk (/): 129.02 GiB / 934.94 GiB (14%) - ext4
Battery: 56% [Discharging]
DNS: 100.100.100.100
Wifi: SERHIENKO - WPA2 (54%)
Date & Time: 2024-08-19 22:13:10
Locale: en_CA.UTF-8
Vulkan: 1.3.280 - Intel open-source Mesa driver [Mesa 24.1.5]NVIDIA [560.31.02]
OpenGL: 4.6 (Compatibility Profile) Mesa 24.1.5
Bluetooth Radio (evo): Bluetooth 5.3 (Intel)
Sound: Raptor Lake-P/U/H cAVS Speaker (82%)
Camera 1: Integrated_Webcam_HD: Integrate - sRGB (1280x720 px)
Camera 2: Integrated_Webcam_HD: Integrate - sRGB (640x360 px)
Network IO (wlp0s20f3): 245 B/s (IN) - 253 B/s (OUT) *
Disk IO (PC801 NVMe SK hynix 1TB): 8.34 MiB/s (R) - 3.87 MiB/s (W)

@kvark
Copy link
Contributor

kvark commented Aug 20, 2024

@tepavcevic could you make sure you have vulkan validation layers installed? I wonder if we can get a concrete errors when running with kvark/blade#144. Alternatively, could you run it under gdb and get a call stack? That would help as well, albeit less.

@bashfulrobot that looks like the same issue. We are choosing the first GPU, which is Intel, and it fails to create a vulkan surface.

@bashfulrobot
Copy link

Ok, great, I'll assume an upcoming patch will resolve it. Appreciate your time.

@kvark
Copy link
Contributor

kvark commented Aug 22, 2024

We have ideas on how to improve/solve this but currently lacking a good way to test them. If you can help, that would be great! You can start by checking out https://github.com/kvark/blade and doing cargo run --example bunnymark and seeing if it's able to present.
I'm also getting a NV+Intel desktop mahcine, which I hope will reproduce this.

@tepavcevic
Copy link

tepavcevic commented Aug 23, 2024

Sorry for a late reply, I've just cloned blade and checked out to intel present branch. On compilation finished it said there was a segmentation fault

Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 05s
     Running `target/debug/examples/bunnymark`
[1]    10876 segmentation fault (core dumped)  cargo run --example bunnymark

edit: I've made sure to have vulkan libs installed

@kvark
Copy link
Contributor

kvark commented Aug 25, 2024

@tepavcevic great! Do you have vulkan validation, too? Could you run the same thing under gdb to see the call stack and local variables? Also please share the logs produced with RUST_LOG=blade_graphics=debug environment.

@tepavcevic
Copy link

I am not well versed in this kind of debugging but I hope this helps @kvark

logs produced with debug env flag:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.37s
     Running `target/debug/examples/bunnymark`
[2024-08-25T16:28:24Z INFO  blade_graphics::hal::init] Enabling Vulkan Portability
[2024-08-25T16:28:24Z INFO  blade_graphics::hal::init] Enabling color space support
[2024-08-25T16:28:24Z INFO  blade_graphics::hal::init] Testing presentation capability on Linux/Intel
VUID-VkSwapchainCreateInfoKHR-presentMode-01281(ERROR / SPEC): msgNum: -1378015611 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-presentMode-01281 ] | MessageID = 0xaddd2685 | vkCreateSwapchainKHR(): pCreateInfo->presentMode (VK_PRESENT_MODE_IMMEDIATE_KHR) is not supported (the following are supported VK_PRESENT_MODE_MAILBOX_KHR VK_PRESENT_MODE_FIFO_KHR ). The Vulkan spec states: presentMode must be one of the VkPresentModeKHR values returned by vkGetPhysicalDeviceSurfacePresentModesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-01281)
    Objects: 0
[1]    13335 segmentation fault (core dumped)  cargo run --example bunnymark

And for gdb I've gotten this output:

gdb log (gdb) file ./target/debug/examples/bunnymark Load new symbol table from "./target/debug/examples/bunnymark"? (y or n) y Reading symbols from ./target/debug/examples/bunnymark... (gdb) run Starting program: /home/djordje/Projects/blade/target/debug/examples/bunnymark [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [Detaching after vfork from child process 20070] [Detaching after vfork from child process 20072] [Detaching after vfork from child process 20078] [Detaching after vfork from child process 20079] warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libtinfo.so.6 warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/libvulkan_intel.so warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/libvulkan_virtio.so warning: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/libvulkan_intel_hasvk.so [2024-08-25T17:16:57Z INFO blade_graphics::hal::init] Enabling Vulkan Portability [2024-08-25T17:16:57Z INFO blade_graphics::hal::init] Enabling color space support warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libVkLayer_MESA_overlay.so warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libVkLayer_MESA_device_select.so warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libcap.so.2 [New Thread 0x7fffe2c006c0 (LWP 20080)] [2024-08-25T17:16:57Z INFO blade_graphics::hal::init] Testing presentation capability on Linux/Intel [New Thread 0x7fffe54006c0 (LWP 20081)] VUID-VkSwapchainCreateInfoKHR-presentMode-01281(ERROR / SPEC): msgNum: -1378015611 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-presentMode-01281 ] | MessageID = 0xaddd2685 | vkCreateSwapchainKHR(): pCreateInfo->presentMode (VK_PRESENT_MODE_IMMEDIATE_KHR) is not supported (the following are supported VK_PRESENT_MODE_MAILBOX_KHR VK_PRESENT_MODE_FIFO_KHR ). The Vulkan spec states: presentMode must be one of the VkPresentModeKHR values returned by vkGetPhysicalDeviceSurfacePresentModesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-01281) Objects: 0

Thread 1 "bunnymark" received signal SIGSEGV, Segmentation fault.
0x00007ffff7fb0fb4 in wl_proxy_get_version ()
from /lib/x86_64-linux-gnu/libwayland-client.so.0

@kvark
Copy link
Contributor

kvark commented Aug 27, 2024

That's very helpful, thank you @tepavcevic !
I've just pushed an update to "intel present" branch (commit fee06c42f658b36dd9ac85444a9ee2a481383695), and it should work now. If you could check it on your side, that would be great!

@tepavcevic
Copy link

@kvark I've tested it now, was able to build and run it. It also produces a lot of logs, I saw three distinct messages:

Objects: 0 VUID-VkMemoryBarrier-dstAccessMask-parameter(ERROR / SPEC): msgNum: 1190714446 - Validation Error: [ VUID-VkMemoryBarrier-dstAccessMask-parameter ] | MessageID = 0x46f8dc4e | vkCmdPipelineBarrier(): pMemoryBarriers[0].dstAccessMask (0x419800) has VkAccessFlagBits values that requires the extensions VK_NV_ray_tracing or VK_KHR_acceleration_structure. The Vulkan spec states: dstAccessMask must be a valid combination of VkAccessFlagBits values (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-VkMemoryBarrier-dstAccessMask-parameter) Objects: 0 VUID-vkDestroySurfaceKHR-surface-01266(ERROR / SPEC): msgNum: -1093400348 - Validation Error: [ VUID-vkDestroySurfaceKHR-surface-01266 ] Object 0: handle = 0x585e8ba4c380, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xbed408e4 | vkDestroySurfaceKHR(): called before its associated VkSwapchainKHR was destroyed. The Vulkan spec states: All VkSwapchainKHR objects created for surface must have been destroyed prior to destroying surface (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-vkDestroySurfaceKHR-surface-01266) Objects: 1 [0] 0x585e8ba4c380, type: 1, name: NULL warning: queue 0x585e8bda4a60 destroyed while proxies still attached: wl_buffer@62 still attached wl_buffer@60 still attached wl_buffer@58 still attached wl_buffer@56 still attached VUID-vkDestroyDevice-device-05137(ERROR / SPEC): msgNum: 1215490720 - Validation Error: [ VUID-vkDestroyDevice-device-05137 ] Object 0: handle = 0xead9370000000008, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x4872eaa0 | vkDestroyDevice(): OBJ ERROR : For VkDevice 0x585e8bede290[], VkSemaphore 0xead9370000000008[] has not been destroyed. The Vulkan spec states: All child objects created on device must have been destroyed prior to destroying device (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-vkDestroyDevice-device-05137) Objects: 1 [0] 0xead9370000000008, type: 5, name: NULL VUID-vkDestroyDevice-device-05137(ERROR / SPEC): msgNum: 1215490720 - Validation Error: [ VUID-vkDestroyDevice-device-05137 ] Object 0: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x4872eaa0 | vkDestroyDevice(): OBJ ERROR : For VkDevice 0x585e8bede290[], VkSemaphore 0xdd3a8a0000000015[] has not been destroyed. The Vulkan spec states: All child objects created on device must have been destroyed prior to destroying device (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-vkDestroyDevice-device-05137)

If you need me to test something in the future on this setup, feel free to ping me.

@notpeter notpeter changed the title Crash on linux: "Aquire image error ERROR_SURFACE_LOST_KHR" Crash on linux: Aquire image error ERROR_SURFACE_LOST_KHR Aug 27, 2024
@kvark
Copy link
Contributor

kvark commented Aug 28, 2024

Ok, sounds great, thank you! The validation error about "VkMemoryBarrier" I'll fix quickly, but overall this appears to work.
@ConradIrwin would you be interested to give it a second shot for Zed users? The "intel-present" branch is updated on latest and appears to be working now.

@ConradIrwin
Copy link
Member

ConradIrwin commented Aug 28, 2024

Done!

@notpeter
Copy link
Member

notpeter commented Sep 2, 2024

In another thread @edwloef mentioned:

This is a bug with the Nvidia 560 drivers. Going back to the 555 drivers or running Zed with Xwayland, or using a compositor that doesn't support explicit sync, resolves the issue for me.

@edwloef
Copy link

edwloef commented Sep 2, 2024

In another thread @edwloef mentioned:

This is a bug with the Nvidia 560 drivers. Going back to the 555 drivers or running Zed with Xwayland, or using a compositor that doesn't support explicit sync, resolves the issue for me.

This thread isn't the same issue, the 560 issue is as far as I can tell only the Protocol error 0 on object wp_linux_drm_syncobj_manager_v1 spam, which can only occur on wayland, which the original reporter isn't using.

@ConradIrwin
Copy link
Member

@kvark it's early days, but so far on v0.152 the crashes seem similar. Is there something in particular I should check on?

Since release we've seen:

  • 4
called `Result::unwrap()` on an `Err` value: ERROR_SURFACE_LOST_KHR | core::panicking::panic_fmt | c
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
  • 2
called `Result::unwrap()` on an `Err` value: ERROR_INITIALIZATION_FAILED | core::panicking::panic_fm	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::x11::client::X11Client 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::x11::client::X11Client 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_main
_start
  • 2
called `Result::unwrap()` on an `Err` value: ERROR_SURFACE_LOST_KHR | core::panicking::panic_fmt | c	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
  • 2
Unexpected descriptor allocation error: ERROR_OUT_OF_DEVICE_MEMORY | core::panicking::panic_fmt | bl	core::panicking::panic_fmt
blade_graphics::hal::descriptor::<impl blade_graphics::hal::Device>::allocate_descriptor_set
gpui::platform::blade::blade_renderer::BladeRenderer::draw
<gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw
gpui::window::Window::new::{{closure}}::{{closure}}
gpui::window::Window::new::{{closure}}
<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
<gpui::platform::linux::x11::client::X11Client 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_main
_start
  • 1
Aquire image error ERROR_SURFACE_LOST_KHR | core::panicking::panic_fmt | blade_graphics::hal::init::	core::panicking::panic_fmt
blade_graphics::hal::init::<impl blade_graphics::hal::Context>::acquire_frame
gpui::platform::blade::blade_renderer::BladeRenderer::draw
<gpui::platform::linux::x11::window::X11Window as gpui::platform::PlatformWindow>::draw
gpui::window::Window::new::{{closure}}::{{closure}}
gpui::window::Window::new::{{closure}}
<core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
<gpui::platform::linux::x11::client::X11Client 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_impl
_start

@kvark
Copy link
Contributor

kvark commented Sep 6, 2024

It's important to have the logs associated with these stack traces. In particular, I'd need to know:

  • if the new adapter selection logic worked for them (on Intel + Nvidia systems)
  • for a crash on resize(), is this is the first resize of the surface

@gyreas
Copy link

gyreas commented Sep 11, 2024

On Void Linux, installing mesa-vulkan-intel fixes it for me (Intel CPU).

@CDimonaco
Copy link

Issue is still present

Zed 0.158.1

Dual GPU setup on laptop, Fedora 40
VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)

Zed could not be run with intel graphics, shows the same log as other users, works with nvidia graphics enabled.

@kvark
Copy link
Contributor

kvark commented Nov 7, 2024

@ConradIrwin is this with kvark/blade#144 included?
@CDimonaco could you share the full log please?

@ConradIrwin
Copy link
Member

@kvark yes. We updated to that PR in f91bf7f, which is in 0.153 and above.

@j-fu
Copy link

j-fu commented Nov 25, 2024

... I am running into this issue with zed 0.162.5 on a Dell XPS and a NVIDIA GeForce RTX 4050.
vkcube runs perfectly well, but zed chooses the intel GPU0 despite any attempts to control this via the environment and creates an empty canvas.

@graipher
Copy link

... I am running into this issue with zed 0.162.5 on a Dell XPS and a NVIDIA GeForce RTX 4050. vkcube runs perfectly well, but zed chooses the intel GPU0 despite any attempts to control this via the environment and creates an empty canvas.

Similar on an older Dell XPS 15 with a NVIDIA GeForce GTX 1650 Ti. But for me starting it like this, as mentioned in some linked issue, works:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia zed

@j-fu
Copy link

j-fu commented Nov 25, 2024

There seems to be a recent related discussion on #20853

@kvark
Copy link
Contributor

kvark commented Nov 27, 2024

@j-fu your case is particularly interesting though. We've seen the surface creation failing on those Nvidia optimus configurations. We've seen presentation failing with an error. But your case shows that it all seemingly succeeds, so even with the most detailed workaround checks on our side, it still believes that Intel is fine to present. But you apparently get a blank window.

It would help to get the vulkaninfo output from you. Also, if you can confirm you can run vkcube --gpu_number 0.

@j-fu
Copy link

j-fu commented Nov 27, 2024

Thanks, great that you are looking into this!

vkcube --gpu_number 0 shows a blank window with black background and the frame from the window manager (while zed shows a borderless window which contains a copy of whatever was in the graphics buffer)
The output is

Selected GPU 0: Intel(R) Graphics (RPL-P), type: IntegratedGpu

The output of vulkaninfo and the Zed.log are in this gist.

@kvark
Copy link
Contributor

kvark commented Nov 28, 2024

@j-fu I filed https://gitlab.freedesktop.org/mesa/mesa/-/issues/12212 upstream about your case. There is a few fields that are left as . If you can fill them out (by editing the description), or provide the info here (for me to copy it there), that would help devs to investigate.

@j-fu
Copy link

j-fu commented Nov 28, 2024

Thanks! I added this to the gist for the moment. I could sign up there if deemed helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] linux panic / crash [core label]
Projects
None yet
Development

No branches or pull requests