Skip to content

Add Wayland GPU rendering profile#302

Merged
ilysenko merged 2 commits into
ilysenko:mainfrom
VrtxOmega:fix/cosmic-wayland-gpu-profile
May 24, 2026
Merged

Add Wayland GPU rendering profile#302
ilysenko merged 2 commits into
ilysenko:mainfrom
VrtxOmega:fix/cosmic-wayland-gpu-profile

Conversation

@VrtxOmega
Copy link
Copy Markdown
Contributor

Summary

  • Add CODEX_LINUX_RENDERING_MODE=wayland-gpu to force native Wayland while keeping GPU compositing enabled.
  • Skip forced renderer accessibility by default for that profile, while preserving the CODEX_FORCE_RENDERER_ACCESSIBILITY=1 override.
  • Document the profile for Wayland desktops where XWayland or software rendering is unstable, and add launcher smoke coverage.

Context

On Pop!_OS 24.04 COSMIC with NVIDIA, the safe-mode/software-rendering path failed with GPU access not allowed, and the X11/Xwayland path could hang. The stable launch profile was native Wayland with GPU enabled, GPU compositing enabled, and forced renderer accessibility disabled. This PR keeps the existing default Linux and WSLg behavior intact while making that working profile first-class.

Validation

  • bash -n launcher/start.sh.template
  • bash -n tests/scripts_smoke.sh
  • git diff --check
  • env -i HOME="$HOME" PATH="$PATH" USER="$USER" SHELL="$SHELL" TERM="${TERM:-xterm}" bash tests/scripts_smoke.sh

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9b9f99286

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1858 to +1860
case "$ELECTRON_RENDERING_MODE" in
wslg|wayland-gpu)
return 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate renderer accessibility on platform, not requested mode

When CODEX_LINUX_RENDERING_MODE=wayland-gpu is set, should_force_renderer_accessibility() now always disables --force-renderer-accessibility even if launch args later force X11 (for example --x11, --safe-mode, or passthrough --ozone-platform=x11). That regresses prior behavior for those X11 launches and can break accessibility-dependent tooling in exactly the troubleshooting path users are likely to take after exporting the new mode globally. The check should use the effective platform (or explicit X11 overrides) rather than only the requested rendering profile.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

@ilysenko ilysenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the Wayland GPU profile. I re-reviewed the current head and confirmed the existing renderer-accessibility concern is still present, so I cannot merge this yet.

Finding:

  • launcher/start.sh.template: should_force_renderer_accessibility() now keys off ELECTRON_RENDERING_MODE=wayland-gpu, not the effective Electron platform. When a user has CODEX_LINUX_RENDERING_MODE=wayland-gpu exported globally but launches an explicit X11 fallback (--x11 or --safe-mode), the launcher still suppresses --force-renderer-accessibility even though it is actually launching with --ozone-platform=x11. I reproduced this locally: CODEX_LINUX_RENDERING_MODE=wayland-gpu ... --x11 produced ozone_platform=x11 renderer_accessibility=0 and no --force-renderer-accessibility. The --safe-mode path has the same issue while also disabling GPU.

Please base the default accessibility decision on the effective platform/explicit overrides, or add a guard so explicit X11 fallback keeps the prior default accessibility behavior. Also add smoke coverage for CODEX_LINUX_RENDERING_MODE=wayland-gpu --x11 and CODEX_LINUX_RENDERING_MODE=wayland-gpu --safe-mode.

Validation I ran:

  • bash -n launcher/start.sh.template tests/scripts_smoke.sh
  • git diff --check origin/main...HEAD
  • targeted launcher probe for wayland-gpu --x11 and wayland-gpu --safe-mode

Copy link
Copy Markdown
Contributor Author

Thanks for the clear review. I pushed c7e7e27 to address this.

The follow-up changes should_force_renderer_accessibility() so the wayland-gpu default is based on the effective ozone platform rather than only the requested rendering profile. Native Wayland still skips --force-renderer-accessibility, but explicit X11 fallbacks now preserve the prior default behavior:

  • CODEX_LINUX_RENDERING_MODE=wayland-gpu --x11 keeps --force-renderer-accessibility
  • CODEX_LINUX_RENDERING_MODE=wayland-gpu --safe-mode keeps --force-renderer-accessibility
  • pass-through --ozone-platform=x11 also keeps the X11 accessibility default

I also added smoke coverage for those cases and reran validation:

  • bash -n launcher/start.sh.template
  • bash -n tests/scripts_smoke.sh
  • git diff --check
  • targeted launcher sanity coverage
  • env -i HOME="$HOME" PATH="$PATH" USER="$USER" SHELL="$SHELL" TERM="${TERM:-xterm}" bash tests/scripts_smoke.sh

Copy link
Copy Markdown
Owner

@ilysenko ilysenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed current head c7e7e27. The previous renderer-accessibility concern is addressed: wayland-gpu still skips forced renderer accessibility on native Wayland, while explicit X11 fallback paths (--x11, --safe-mode, and pass-through --ozone-platform=x11) preserve the existing --force-renderer-accessibility default.

Validation checked:

  • GitHub Actions are green
  • bash -n launcher/start.sh.template tests/scripts_smoke.sh
  • git diff --check origin/main...HEAD
  • targeted launcher probe for native Wayland, --x11, --safe-mode, and pass-through X11
  • full tests/scripts_smoke.sh

@ilysenko ilysenko merged commit 19d3ca1 into ilysenko:main May 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants