Skip to content

fix(desktop): disable GPU acceleration on remote displays to stop flicker - #37932

Merged
OutThisLife merged 2 commits into
mainfrom
bb/desktop-remote-flicker
Jun 3, 2026
Merged

fix(desktop): disable GPU acceleration on remote displays to stop flicker#37932
OutThisLife merged 2 commits into
mainfrom
bb/desktop-remote-flicker

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Users on remote/forwarded displays reported the desktop window flickering during scroll/streaming. Nobody on native Windows/macOS ever saw it — the tell that it's a remote-display problem.

  • @l0gix5: "no longer jumping but still flicker" → "i'm using over remote connection."
  • @etechvolution: "screen flickering (very few times)" for sessions started in the desktop app.

Root cause. The app shipped with Chromium's default GPU hardware acceleration and no remote-display handling (main.cjs had no GPU switches at all; the existing "remote" code is all about the remote gateway backend, unrelated to the display). Over a remote connection (SSH X11 forwarding, VNC, RDP), Chromium's GPU compositor can't present accelerated layers cleanly across the wire, so the surface flashes on repaint. Local sessions composite on the GPU and never hit it.

Fix. Detect a remote display before app.ready and fall back to software rendering — the standard remedy (what VS Code/Slack expose for RDP/VNC). Detection (detectRemoteDisplay in bootstrap-platform.cjs, pure + unit-tested) flags:

  • SSH sessions (SSH_CONNECTION / SSH_CLIENT / SSH_TTY)
  • X11 forwarding (DISPLAY=<host>:N, e.g. localhost:10.0) — but not local :0/:1
  • Windows RDP (SESSIONNAME=RDP-*)

WSLg is intentionally not flagged: it renders locally via vGPU and doesn't show the flicker (confirmed by a WSL user with zero flickering). VNC/screen-sharing can't be sniffed reliably, so it's covered by the override.

When flagged: app.disableHardwareAcceleration() + --disable-gpu-compositing. HERMES_DESKTOP_DISABLE_GPU overrides both ways (1/true → always disable for VNC/screen-sharing we can't sniff; 0/false → keep GPU on for remote hosts that do have working acceleration). The decision is logged.

This also quietly fixes the terminal's WebGL surface: with --disable-gpu the WebglAddon context creation fails into its existing DOM-renderer fallback, which is stable over the wire.

Changes

  • electron/bootstrap-platform.cjs — add pure detectRemoteDisplay({ env, platform }).
  • electron/main.cjs — disable HW acceleration early when a remote display is detected; log the reason.
  • electron/bootstrap-platform.test.cjs — tests (local stays on; WSLg stays on; SSH/X11-forward/RDP flagged; local :0/:1 not flagged; override both ways).

Test plan

  • node --test electron/bootstrap-platform.test.cjs — 10/10 pass
  • npm run test:desktop:platforms — pass
  • eslint on changed files — 0 new problems (the 6 main.cjs errors are pre-existing on main, verified via stdin lint of origin/main)
  • Local macOS npm run dev confirmed unaffected (GPU stays on; no remote display detected boot line)
  • Manual: launch over SSH X11-forwarding (or set HERMES_DESKTOP_DISABLE_GPU=1), confirm the boot log shows the disable line and the flicker is gone

…cker

Users on remote/forwarded displays (SSH X11 forwarding, VNC, RDP, WSLg)
reported the window flickering during scroll/streaming; nobody on native
Windows/macOS ever saw it.

Root cause: the app shipped with Chromium's default GPU hardware
acceleration and no remote-display handling. Over a remote connection the
GPU compositor can't present accelerated layers cleanly across the wire,
so the surface flashes on repaint. Local sessions composite on the GPU
and never hit it.

Detect a remote display before app `ready` (detectRemoteDisplay in
bootstrap-platform.cjs) and fall back to software rendering via
app.disableHardwareAcceleration() + --disable-gpu-compositing. Software
compositing is rock-steady over the wire and the CPU cost is negligible
next to the connection's latency. HERMES_DESKTOP_DISABLE_GPU overrides
detection both ways for VNC/screen-sharing setups we can't sniff or
remote hosts that do have working acceleration.
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/desktop-remote-flicker vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9709 on HEAD, 9709 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5031 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

WSLg renders Linux GUIs locally through a vGPU surface rather than
shipping frames over the wire, so it doesn't show the remote-compositor
flicker — confirmed by a WSL user seeing zero flickering. Drop the WSL
branch from detectRemoteDisplay so WSLg keeps hardware acceleration;
detection now covers only genuinely-remote displays (SSH X11 forwarding,
VNC, RDP). The HERMES_DESKTOP_DISABLE_GPU override still works for anyone
who does hit it.
@OutThisLife
OutThisLife merged commit 5005b79 into main Jun 3, 2026
19 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-remote-flicker branch June 3, 2026 05:43
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have labels Jun 3, 2026
davidgut1982 pushed a commit to davidgut1982/hermes-agent that referenced this pull request Jun 5, 2026
…mote-flicker

fix(desktop): disable GPU acceleration on remote displays to stop flicker
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
fix(desktop): disable GPU acceleration on remote displays to stop flicker
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…mote-flicker

fix(desktop): disable GPU acceleration on remote displays to stop flicker
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…mote-flicker

fix(desktop): disable GPU acceleration on remote displays to stop flicker
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…mote-flicker

fix(desktop): disable GPU acceleration on remote displays to stop flicker
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…mote-flicker

fix(desktop): disable GPU acceleration on remote displays to stop flicker
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…mote-flicker

fix(desktop): disable GPU acceleration on remote displays to stop flicker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants