From 9c08e684b0410c8a9e7ac0d6e327c4318bd7b03d Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 2 May 2026 22:38:14 -0700 Subject: [PATCH] Electron: keep Windows console + silence VAAPI warning --- desktop/main.js | 5 +++++ desktop/textgen.bat | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/desktop/main.js b/desktop/main.js index 4c30a00a..5ac92ab8 100644 --- a/desktop/main.js +++ b/desktop/main.js @@ -24,10 +24,15 @@ app.setName(TITLE); // - no-sandbox: chrome-sandbox needs SUID root, which an unzipped tarball can't ship. // - no-zygote: zygote's mount namespace hides /dev/shm and /tmp from subprocesses, // producing a blank gray window; disabling restores full filesystem visibility. +// - disable-accelerated-video-decode/encode: skip Chromium's hardware video pipeline, +// which probes VAAPI at startup and logs a noisy version-mismatch error on systems +// with older libva. We don't render video content anyway. // Safe to disable sandboxing here — we only load our own localhost server. if (process.platform === "linux") { app.commandLine.appendSwitch("no-sandbox"); app.commandLine.appendSwitch("no-zygote"); + app.commandLine.appendSwitch("disable-accelerated-video-decode"); + app.commandLine.appendSwitch("disable-accelerated-video-encode"); } let serverProcess = null; diff --git a/desktop/textgen.bat b/desktop/textgen.bat index e51c0183..b669805f 100644 --- a/desktop/textgen.bat +++ b/desktop/textgen.bat @@ -6,8 +6,8 @@ for %%a in (%*) do ( if /i "%%~a"=="--nowebui" goto :server if /i "%%~a"=="--listen" goto :server ) -start "" "%APP%\electron\electron.exe" "%APP%" -- %* -exit /b 0 +"%APP%\electron\electron.exe" "%APP%" -- %* +exit /b %errorlevel% :help "%APP%\portable_env\python.exe" "%APP%\server.py" --help exit /b %errorlevel%