zed icon indicating copy to clipboard operation
zed copied to clipboard

Crash at launch: `Unable to init GPU context: Platform(Loading(Library(LoadLibraryExW { ...`

Open Unknown78 opened this issue 8 months ago • 6 comments

Summary

This is my first time trying the software and it just crashed at launch.

Description

Steps to trigger the problem:

  1. Run zed-opengl.exe

Actual Behavior:

It closes itself.

Expected Behavior:

It opens.

Zed Version and System Specs

The app binary was built by @deevus, He told me to post the issue here: https://github.com/deevus/zed-windows-builds/issues/45#issuecomment-2820191915

App: zed-opengl.exe: v0.182.11

  • OS: Windows 11 Pro for Workstations x64 24H2 v10.0.26100.3775
  • CPU: Intel Core i3-2310M
  • RAM: 16 GB
  • GPU: Intel HD Graphics 3000
  • GPU Driver: https://winraid.level1techs.com/t/get-your-intel-hd3000-sandy-bridge-windows-10-64bit-drivers-here/40044

With the unofficial drivers, it supports 100% up to OpenGL 3.1 instead of the default Microsoft GDI Generic renderer that is OpenGL 1.1.

HWiNFO64 Screenshot (click to expand)

image

AIDA64 Screenshot (click to expand)

image

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

Windows Terminal:

set RUST_LOG=debug
set RUST_BACKTRACE=full
zed-opengl > zed-opengl.log 2>&1

zed-opengl.log:

thread 'main' panicked at crates\gpui\src\platform\windows\platform.rs:111:47:
Unable to init GPU context: Platform(Loading(Library(LoadLibraryExW { source: Os { code: 126, kind: Uncategorized, message: "The specified module could not be found." } })))

Stack backtrace:
   0: git_odb_object_size
   1: git_odb_object_size
   2: git_trace_set
   3: git_patch_owner
   4: git_patch_owner
   5: git_odb_object_size
   6: git_odb_object_size
   7: git_odb_object_size
   8: git_odb_object_size
   9: git_odb_object_size
  10: git_trace_set
  11: BaseThreadInitThunk
  12: RtlUserThreadStart
stack backtrace:
   0:     0x7ff6e114cb8a - git_odb_object_size
   1:     0x7ff6dbf2b7da - git_filter_source_repo
   2:     0x7ff6e1146268 - git_odb_object_size
   3:     0x7ff6e114c9b5 - git_odb_object_size
   4:     0x7ff6e114ed84 - git_odb_object_size
   5:     0x7ff6e114eb7f - git_odb_object_size
   6:     0x7ff6e114fb9f - git_odb_object_size
   7:     0x7ff6e114f93a - git_odb_object_size
   8:     0x7ff6e114d75f - git_odb_object_size
   9:     0x7ff6e114f51e - git_odb_object_size
  10:     0x7ff6e45d2281 - git_trace_set
  11:     0x7ff6e45d26b0 - git_trace_set
  12:     0x7ff6ddceca5b - git_patch_owner
  13:     0x7ff6ddc2f34a - git_patch_owner
  14:     0x7ff6e3052031 - git_odb_object_size
  15:     0x7ff6e2edb2a6 - git_odb_object_size
  16:     0x7ff6e2f3d13c - git_odb_object_size
  17:     0x7ff6e113ba0c - git_odb_object_size
  18:     0x7ff6e305c1ec - git_odb_object_size
  19:     0x7ff6e4534790 - git_trace_set
  20:     0x7ffc7a81e8d7 - BaseThreadInitThunk
  21:     0x7ffc7c5314fc - RtlUserThreadStart

Unknown78 avatar Apr 22 '25 07:04 Unknown78

I encountered the same error on my desktop computer with an Intel processor, Core i56500 and Windows 10. No solution has been found up to now.

luckzylp avatar Apr 23 '25 05:04 luckzylp

Intel Core i3-2310M
Intel HD Graphics 3000

DirectX: 11.1 (10_1)
OpenGL: 3.1
OpenCL: N/A
Vulkan: N/A
Shader Model: 4.1

Intel Core i5-6500
Intel HD Graphics 530

DirectX: 12 (12_1)
OpenGL: 4.6
OpenCL: 3.0
Vulkan: 1.3
Shader Model: 6.4

@luckzylp Your integrated graphics support Vulkan and OpenGL. So, neither of them works?

Unknown78 avatar Apr 23 '25 06:04 Unknown78

@Unknown78 Yes. Neither Vulkan nor OpenGL works.

Neither Vulkan nor OpenGL works. The error code is the same as yours. The Core i56500 is equipped with the GPU Intel® HD Graphics 530 and uses the official intel Driver Graphics Driver 31.0.101.2115. Judging from the official API support provided by intel, it is supported DirectX* : 12 OpenGL* : 4.6 OpenCL* : 2.0 Vulkan* : 1.3 (The official Driver, Graphics Driver 31.0.101.2115, is tested to support version 1.2. It seems that the official updated the description on February 20, 2025, but in fact, the driver has not been updated.)

luckzylp avatar Apr 23 '25 07:04 luckzylp

After I re-uninstalled the driver of Intel® HD Graphics 530 and reinstalled the driver of version 31.0.101.2115, the zed v0.184.0 Vulkan version could run normally and there was no crash. However, the zed-opengl version still cannot run.

luckzylp avatar Apr 23 '25 16:04 luckzylp

Thanks for reporting, unfortunately as you seem to be aware, Windows is not an officially supported platform as of yet, so I cannot promise we will get to this until it is being prioritized.

probably-neb avatar Apr 29 '25 15:04 probably-neb

@probably-neb What's the minimum OpenGL version that's required to run Zed? @luckyzip has tried it with OpenGL 4.6, which is latest version, and still failed.

Unknown78 avatar Apr 30 '25 05:04 Unknown78

@Unknown78 I'm not sure. Unfortunately this issue relates to an unofficial build on a non-officially supported platform, using an non-officially supported backend. For this reason I'm going to close the issue. While we plan to support Windows soon, and hope to have better OpenGL support in the future, neither are officially supported as of right now, and so I will be closing this issue in order to keep our list of open issues actionable

probably-neb avatar May 21 '25 16:05 probably-neb

I was running zed.exe on my laptop with an MX150 graphics card and integrated graphics, and it also reported this "unable to init GPU context" error. Then, in the NVIDIA display settings, I forced zed to use the dedicated graphics card, and the error disappeared. The software seems to be working normally now.

amwps290 avatar Jul 28 '25 00:07 amwps290

@probably-neb Will https://github.com/zed-industries/zed/pull/34374 solve my issue? We should have the complete D3D9, D3D11, and D3D12.

Unknown78 avatar Jul 30 '25 10:07 Unknown78

The launch of official support for windows will likely fix your problem yes, not just the referenced PR

probably-neb avatar Jul 30 '25 13:07 probably-neb

I am on linux and also have a crash where Zed is unable to init the GPU context. Could this be related?

2025-10-24 15:25:17 riley-desktop-debian ~ » export RUST_LOG=debug
2025-10-24 15:25:29 riley-desktop-debian ~ » export RUST_BACKTRACE=full
2025-10-24 15:26:36 riley-desktop-debian ~ » zed --foreground | tee -a ~/Documents/zed-crash-$(date +%Y-%m-%d_%H%M%S).log
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

thread 'main' panicked at crates/gpui/src/platform.rs:116:18:
called `Result::unwrap()` on an `Err` value: Failed to initialize X11 client.

Caused by:
    0: Unable to init GPU context
    1: Platform(Init(ERROR_INITIALIZATION_FAILED))

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: anyhow::__private::format_err
   2: gpui::platform::blade::blade_context::BladeContext::new::{{closure}}
   3: gpui::platform::blade::blade_context::BladeContext::new
   4: gpui::platform::current_platform
   5: gpui::app::Application::new
   6: zed::main
   7: std::sys::backtrace::__rust_begin_short_backtrace
   8: std::rt::lang_start::{{closure}}
   9: std::rt::lang_start_internal
  10: main
  11: <unknown>
  12: __libc_start_main
  13: _start
stack backtrace:
   0:     0x55a40fadd833 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdcfcb6d4c8489523
   1:     0x55a408377273 - core::fmt::write::h8a494366950f23bb
   2:     0x55a40fad7933 - std::io::Write::write_fmt::h6556609fca33d0b1
   3:     0x55a40fadd692 - std::sys::backtrace::BacktraceLock::print::hb2a626a81e06b2dc
   4:     0x55a40fae12ef - std::panicking::default_hook::{{closure}}::h4f78485264f12d10
   5:     0x55a40fae0e6e - std::panicking::default_hook::h2c66fc99e962531d
   6:     0x55a40fae1a55 - std::panicking::rust_panic_with_hook::h33ac55f64bbd807d
   7:     0x55a40fae17fa - std::panicking::begin_panic_handler::{{closure}}::h30e7cb89678a57fe
   8:     0x55a40faddd09 - std::sys::backtrace::__rust_end_short_backtrace::hed60f27456c16ced
   9:     0x55a40fae14ad - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind
  10:     0x55a408373a10 - core::panicking::panic_fmt::h62f63d096dd276af
  11:     0x55a408373e36 - core::result::unwrap_failed::h95bc3f5a607b2c95
  12:     0x55a40af9cdaf - gpui::platform::current_platform::ha1decab4437142bb
  13:     0x55a40aea2e40 - gpui::app::Application::new::hf3d9cbcfcf772d63
  14:     0x55a411df8861 - zed::main::hdd69df9d3df74f80
  15:     0x55a4124716e3 - std::sys::backtrace::__rust_begin_short_backtrace::h4e83c100b4080934
  16:     0x55a4124716c9 - std::rt::lang_start::{{closure}}::h59d9e10e08da8738
  17:     0x55a40facc441 - std::rt::lang_start_internal::h34f9328d113fd60a
  18:     0x55a41247172c - main
  19:     0x7f6ab5737ca8 - <unknown>
  20:     0x7f6ab5737d65 - __libc_start_main
  21:     0x55a40520aaee - _start
  22:                0x0 - <unknown>
2025-10-24 15:26:39 riley-desktop-debian ~ »

If this is unrelated, is there another issue that captures this bug?

c3cuddles avatar Oct 24 '25 20:10 c3cuddles

@c3cuddles

No, my issue was on Windows and you're on Linux.

Unknown78 avatar Oct 25 '25 00:10 Unknown78

My issue was eventually fixed albeit unsatisfactory with this commit: https://github.com/zed-industries/zed/commit/17499453f64811f10f307c26e3df2f3fa7a8f0b8

The thing is that, the GPU doesn't support Structured Buffer, so all I have is CPU or software rendering. VSCode with its ANGLE backend of D3D11 is much better at this point.

And I don't understand the rationale of why the Structured Buffer is mandatory for Zed.

Unknown78 avatar Oct 25 '25 00:10 Unknown78

Hey @c3cuddles and @Unknown78, I highly encourage both of you to create new issues for the problems you're facing (GPU failing to init and the Structured Buffer requirement respectively)

probably-neb avatar Oct 30 '25 14:10 probably-neb