Skip to content

fix(electron): let Linux users turn off the GPU and choose the window platform - #5646

Merged
kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:fix/999-1068-linux-gpu-and-ozone-switches
Oct 23, 2026
Merged

kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:fix/999-1068-linux-gpu-and-ozone-switches

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

On some Linux setups the Agent UI desktop app either crashes at GPU startup (#999, Fedora Kinoite with ROCm on RDNA4) or opens without window decorations under GNOME Wayland (#1068). Both reporters found a Chromium flag that fixes it, but GAIA gave them no supported way to set it. In #999 we promised a GAIA_DISABLE_GPU switch that never shipped. Now GAIA_DISABLE_GPU=1 turns the GPU off, and the troubleshooting page shows how to pass --ozone-platform=x11 in a way that sticks. The forced ozone-platform-hint=auto is dropped as dead code: Electron 38+ already defaults to it, and a user's --ozone-platform flag wins over it either way. The Linux troubleshooting page shows both, for the AppImage and the .deb.

Closes #999
Refs #1068 (needs a re-test on Wayland: #5312 since made the Linux window frameless, so the original symptom may have changed)

Test plan

  • New tests/electron/chromium-switches.test.cjs (16 tests): per-platform defaults, which GAIA_DISABLE_GPU values count as on, no ozone switch added, and switches applied before app.whenReady()
  • Launched the pinned Electron (44.x) with the switch module: disable-gpu is applied only when GAIA_DISABLE_GPU=1
  • util/check_doc_links.py reports all links valid
  • On Fedora Kinoite with ROCm, GAIA_DISABLE_GPU=1 launches the AppImage without the SIGTRAP
  • On GNOME Wayland, the window shows working controls, with and without --ozone-platform=x11

… platform

The desktop app aborted at launch on GPU stacks whose Chromium GPU process
crashes (Fedora Kinoite with ROCm), and the only fix was retyping
--disable-gpu every time. Setting GAIA_DISABLE_GPU=1 (or true/yes) now turns
GPU acceleration off on every launch, on any platform.

The app also forced ozone-platform-hint=auto, which Electron 38+ already
defaults to; dropping it leaves the window platform to Electron and to the
user's --ozone-platform=x11, the knob that fixed missing window decorations
on GNOME Wayland. ELECTRON_OZONE_PLATFORM_HINT was removed in Electron 38,
so the troubleshooting guide points users at the command-line flag.

The startup switches move into services/chromium-switches.cjs so they are
unit-tested without launching Electron.

Closes amd#999
Refs amd#1068
…Wayland switches

Users who installed the .deb launch gaia-desktop, not the AppImage, so the
entry now gives both forms.
@github-actions github-actions Bot added documentation Documentation changes tests Test changes labels Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

Linux users who hit a GPU crash at launch now have a supported fix: start the desktop app with GAIA_DISABLE_GPU=1. The app also stops setting its own window-platform hint, so --ozone-platform=x11 decides the window platform without competition. The existing Linux workarounds (no sandbox, Wayland color-management off) are unchanged, just moved into a small module that has tests. I found no blocking issues.

The two hardware checks in the test plan (the Kinoite/ROCm crash and GNOME Wayland) are still open. Because the GPU switch is opt-in, merging without them won't change behaviour for anyone who doesn't set it.

Real-world evidence

N/A: no evidence bundle was produced for this run. The PR description reports launching the pinned Electron 44 with the new module, and disable-gpu was applied only when GAIA_DISABLE_GPU=1 was set. Everything else here rests on static review. I couldn't run the Jest suite in this environment because tests/electron has no installed node_modules.

🔍 Technical details

Issues found

🟢 Advice to edit the .desktop file is lost on upgrade for .deb installs (docs/reference/troubleshooting.mdx:744-747, :756). The .deb ships its .desktop entry under /usr/share/applications, and a package upgrade overwrites any edit made there. Users should copy the entry to ~/.local/share/applications/ and edit the copy. Suggested wording:

    To make it stick, export `GAIA_DISABLE_GPU=1` in your shell profile, or
    add it to the `.desktop` entry's `Exec=` line
    (`Exec=env GAIA_DISABLE_GPU=1 /path/to/gaia-agent-ui.AppImage %U`). For
    the .deb, copy its entry to `~/.local/share/applications/` and edit the
    copy, since upgrades replace the system one. It

🟢 The PR description slightly misstates why the ozone hint was removed. In Chromium, an explicit --ozone-platform=x11 already took precedence over ozone-platform-hint=auto, so the hint wasn't overriding the user's flag. It was just redundant on Electron 38+. Dropping it is still correct. Only the stated reason is off, and the code comment at main.cjs:107 already gives the accurate one.

Checked:

  • The .deb binary is gaia-desktop (electron-builder.yml:15), and AppImage files match gaia-agent-ui-${version}-${arch}.AppImage, so the doc commands are correct.
  • The switches are still applied before app.whenReady() (main.cjs:1171). The ordering test's indexOf("app.whenReady()") first hits the comment at line 1147, which is still well after the apply loop, so the assertion holds.
  • tests/electron/package.json already picks up **/*.test.cjs. No existing test depended on the removed inline appendSwitch calls. appimage-smoke checks only the .desktop --no-sandbox, which is unchanged.

Strengths

  • Moving the switch selection into a pure function with no Electron dependency makes per-platform and per-env behaviour testable without launching the app. The tests also cover the negatives: falsy values, and no ozone switch on any platform.
  • Behaviour is unchanged for anyone who doesn't set the variable, and the new switch is opt-in, which matches the no-silent-fallback rule.
  • The docs give both the AppImage and .deb commands, and they say plainly that ELECTRON_OZONE_PLATFORM_HINT no longer works, which heads off a likely dead end.

…deb upgrades

Edits to the .deb's desktop entry in /usr/share/applications are lost on
every upgrade, so the entry now tells users to edit a copy in
~/.local/share/applications instead.
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Thanks. The entry now tells .deb users to copy the desktop entry to ~/.local/share/applications/ and edit the copy, so the GPU and Wayland flags survive upgrades. Agreed on the ozone hint: --ozone-platform=x11 already won over it, and it was removed only because Electron 38+ makes it the default. I've corrected the description.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 23, 2026
Merged via the queue into amd:main with commit 11a170a Oct 23, 2026
45 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the fix/999-1068-linux-gpu-and-ozone-switches branch October 23, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AppImage crashes on custom Fedora Kinoite Image

2 participants