From fcf041be393a265fab9c19dfed5f2a3e1b0b407d Mon Sep 17 00:00:00 2001 From: sanasol Date: Sat, 28 Feb 2026 20:11:42 +0100 Subject: [PATCH] v2.4.7: Fix Linux SDL3_image crash and NVIDIA Wayland stability - Add LD_LIBRARY_PATH with Client directory so the dynamic linker finds bundled native libraries (libSDL3_image.so.0, etc). Official Hytale uses Flatpak which provides these; F2P runs natively and needs this. - Add __NV_DISABLE_EXPLICIT_SYNC=1 for NVIDIA on Wayland to prevent crashes on Hyprland and other Wayland compositors. Co-Authored-By: Claude Opus 4.6 --- backend/managers/gameLauncher.js | 11 +++++++++++ backend/utils/platformUtils.js | 4 ++++ package.json | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/managers/gameLauncher.js b/backend/managers/gameLauncher.js index a4a4308..73a5922 100644 --- a/backend/managers/gameLauncher.js +++ b/backend/managers/gameLauncher.js @@ -445,6 +445,17 @@ async function launchGame(playerNameOverride = null, progressCallback, javaPathO const env = { ...process.env }; + // Linux: Add Client directory to LD_LIBRARY_PATH so the dynamic linker can find + // bundled native libraries (e.g. libSDL3_image.so.0). The .NET DllImport only tries + // bare names like "SDL3_image.so" which don't match versioned .so.0 files. + // LD_LIBRARY_PATH lets dlopen() find them via standard library resolution. + if (process.platform === 'linux') { + const clientDir = path.dirname(clientPath); + const existing = env.LD_LIBRARY_PATH || ''; + env.LD_LIBRARY_PATH = existing ? `${clientDir}:${existing}` : clientDir; + console.log(`Linux: LD_LIBRARY_PATH includes ${clientDir}`); + } + const waylandEnv = setupWaylandEnvironment(); Object.assign(env, waylandEnv); const gpuEnv = setupGpuEnvironment(gpuPreference); diff --git a/backend/utils/platformUtils.js b/backend/utils/platformUtils.js index 9e95770..4757340 100644 --- a/backend/utils/platformUtils.js +++ b/backend/utils/platformUtils.js @@ -594,6 +594,10 @@ function setupGpuEnvironment(gpuPreference) { if (detected.vendor === 'nvidia') { envVars.__NV_PRIME_RENDER_OFFLOAD = '1'; envVars.__GLX_VENDOR_LIBRARY_NAME = 'nvidia'; + // Prevent Wayland explicit sync crashes on NVIDIA (Hyprland, etc.) + if (isWaylandSession()) { + envVars.__NV_DISABLE_EXPLICIT_SYNC = '1'; + } const nvidiaEglFile = '/usr/share/glvnd/egl_vendor.d/10_nvidia.json'; if (fs.existsSync(nvidiaEglFile)) { envVars.__EGL_VENDOR_LIBRARY_FILENAMES = nvidiaEglFile; diff --git a/package.json b/package.json index 4307d70..5f518e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hytale-f2p-launcher", - "version": "2.4.6", + "version": "2.4.7", "description": "A modern, cross-platform launcher for Hytale with automatic updates and multi-client support", "homepage": "https://git.sanhost.net/sanasol/hytale-f2p", "main": "main.js",