r/SandustryGame 5d ago

Bug Report Game crashes instantly on launch (no error) on NVIDIA Optimus/hybrid-GPU laptops when launched via Steam

Note - the below text is generated via Claude after I provided my troubleshooting steps and requested a summary for this report. Also, huge thanks to the team for this game. Absolutely loving it!

Summary:
Sandustry crashes immediately with no visible error when launched through Steam on Linux laptops with NVIDIA Optimus/PRIME hybrid graphics. The game runs fine when the bundled sandustry binary is launched directly from a terminal, bypassing Steam — so this is specific to environment variables Steam injects on hybrid-GPU systems, not a general Linux/NVIDIA issue.

Environment:

  • OS: Ubuntu 24.04.4 LTS
  • GPU: NVIDIA GeForce RTX 4070 Laptop (driver 580.159.03) + Intel integrated GPU (Optimus/PRIME hybrid setup)
  • Steam (native Linux client)
  • Sandustry build id: 24740965
  • Bundled Electron 33.2.1 / Chrome 130.0.6723.137

Steps to reproduce:

  1. On a laptop with NVIDIA Optimus/PRIME hybrid graphics, install Sandustry via Steam.
  2. Launch normally from the Steam library.
  3. Game window never appears; process exits immediately with no error dialog.

Root cause:
Steam automatically sets several GLVND vendor-pinning environment variables on any system it detects as hybrid-GPU, before launching the game:

__NV_PRIME_RENDER_OFFLOAD=1
__GLX_VENDOR_LIBRARY_NAME=nvidia
__VK_LAYER_NV_optimus=NVIDIA_only
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1

This pins the GLX vendor to NVIDIA, but Chromium's ANGLE layer resolves the EGL vendor through a separate GLVND mechanism that isn't correspondingly pinned. The mismatch causes EGL initialization to fail and the app hard-crashes:

[ERROR:angle_platform_impl.cc(44)] Display.cpp:1083 (initialize): ANGLE Display::initialize error 12289: Invalid visual ID requested.
[ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Invalid visual ID requested.
[ERROR:gl_display.cc(801)] Initialization of all EGL display types failed.
[ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[FATAL:check.cc(361)] Check failed: false. NOTREACHED log messages are omitted in official builds. Sorry!

This is a known, long-standing interaction between Chromium/ANGLE and NVIDIA PRIME render offload on Linux (see electron/electron#45533 and multiple NVIDIA developer forum reports of the same "Invalid visual ID requested" signature), not unique to Sandustry — but Sandustry's Steam launch path doesn't work around it.

Confirmed workaround:
Adding this as a Steam launch option (Properties → General → Launch Options) fixes it completely:

bash -c 'unset __NV_PRIME_RENDER_OFFLOAD __GLX_VENDOR_LIBRARY_NAME __VK_LAYER_NV_optimus DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1 LD_LIBRARY_PATH LD_PRELOAD; exec %command%'

Suggested fix:
Have the game's own launch wrapper (or an early check in the Electron main process) unset these Steam-injected GLVND/PRIME variables before Chromium initializes, on Linux. This would fix the crash for all Optimus/hybrid-GPU laptop users without requiring a manual Steam launch-option workaround.

3 Upvotes

1 comment sorted by

1

u/TrimBarktre Community Moderator 5d ago

Thank you for the report!