mirror of
https://github.com/saphid/chromium-webxr-steam-frame.git
synced 2026-10-04 22:00:10 +02:00
Launcher: drop Steam's overlay from LD_PRELOAD
Launched from the Steam library, Steam preloads gameoverlayrenderer.so, which segfaults Chromium's zygote; the GPU process can't start and Chromium quits after about 30 seconds. Found testing on a Steam Frame; reviewed by GPT-6 Astra. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3eaf618acf
commit
d87817237b
2 files changed
+30
No files matched your search
@@ -85,6 +85,15 @@ the shortcut through the Steam client's DevTools port (`127.0.0.1:8080`,
|
||||
page `SharedJSContext`) with `SteamClient.Apps.AddShortcut`, so Steam doesn't
|
||||
need restarting. (`steam steam://addnonsteamgame/<path>` adds nothing.)
|
||||
|
||||
Steam preloads its in-game overlay, `gameoverlayrenderer.so`, into everything
|
||||
it launches through `LD_PRELOAD`. In Chromium it segfaults the zygote during
|
||||
library initialisation. The GPU process then fails to launch
|
||||
(`GPU process launch failed: error_code=1002`), and after a few tries
|
||||
Chromium quits with `GPU process isn't usable. Goodbye.` about 30 seconds
|
||||
after starting. The `chromium-xr` launcher removes the overlay from
|
||||
`LD_PRELOAD` before starting Chromium, keeping anything else that was
|
||||
preloaded.
|
||||
|
||||
## Debugging
|
||||
|
||||
- `chromium-xr --remote-debugging-port=9223 URL` opens DevTools on the Frame's
|
||||
|
||||
@@ -7,6 +7,27 @@ set -euo pipefail
|
||||
CHROME="${CHROMIUM_XR_HOME:-$HOME/chromium-xr}/chrome"
|
||||
[[ -x "$CHROME" ]] || { echo "chromium-xr: no build at $CHROME (run frame/install.sh)" >&2; exit 1; }
|
||||
|
||||
# Steam preloads its in-game overlay (gameoverlayrenderer.so) into anything it
|
||||
# launches. It segfaults in Chromium's zygote, the GPU process then can't
|
||||
# start, and Chromium quits with "GPU process isn't usable". Drop it and keep
|
||||
# anything else that was preloaded.
|
||||
if [[ -n "${LD_PRELOAD:-}" ]]; then
|
||||
keep=()
|
||||
# Split on spaces and colons only, like ld.so, with no glob expansion.
|
||||
# read -d '' takes the whole value, newlines included (it returns 1 at EOF).
|
||||
IFS=' :' read -r -d '' -a libs < <(printf '%s' "$LD_PRELOAD") || true
|
||||
for lib in ${libs[@]+"${libs[@]}"}; do
|
||||
[[ -z "$lib" || "$lib" == *gameoverlayrenderer.so ]] || keep+=("$lib")
|
||||
done
|
||||
if (( ${#keep[@]} )); then
|
||||
LD_PRELOAD=${keep[0]}
|
||||
for lib in "${keep[@]:1}"; do LD_PRELOAD+=":$lib"; done
|
||||
export LD_PRELOAD
|
||||
else
|
||||
unset LD_PRELOAD
|
||||
fi
|
||||
fi
|
||||
|
||||
# --enable-features=OpenXR: the Linux OpenXR device is off by default.
|
||||
# --ozone-platform=x11: gamescope's X display, where each app is a panel.
|
||||
# --no-first-run and --password-store=basic: otherwise startup can stop at a
|
||||
|
||||
Reference in new issue
Block a user