Skip to content

Prevent Chromium Vulkan crashes on Wayland#6333

Open
a-b wants to merge 4 commits into
basecamp:quattrofrom
a-b:fix/wayland-vulkan-webgpu-adapter
Open

Prevent Chromium Vulkan crashes on Wayland#6333
a-b wants to merge 4 commits into
basecamp:quattrofrom
a-b:fix/wayland-vulkan-webgpu-adapter

Conversation

@a-b

@a-b a-b commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • select the OpenGL ES WebGPU adapter to avoid Chromium's Wayland Vulkan interop path
  • migrate existing Chromium-based browser flag files idempotently
  • preserve Brave Origin stability by skipping brave-flags.conf when it is shared with its known broken multi-line flags wrapper

Why

Chromium can initialize Vulkan for WebGPU-on-Vulkan-via-GL interop even when the browser compositor uses OpenGL. On Wayland this triggers the --ozone-platform=wayland is not compatible with Vulkan error and can crash or freeze the browser. --use-webgpu-adapter=opengles disables that interop path while retaining hardware compositing and rasterization.

Refs: brave/brave-browser#55805, #5372

Testing

  • ./test/all
  • exercised the migration against normal Chromium/Brave configurations and a Brave configuration shared with Brave Origin
  • verified Brave reports hardware compositing and rasterization enabled, Vulkan disabled, and WebGPU-on-Vulkan interop disabled with this flag

Copilot AI review requested due to automatic review settings July 21, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent Chromium-based browsers from crashing/freezing on Wayland by avoiding Chromium’s Vulkan WebGPU interop path, via forcing the OpenGL ES WebGPU adapter in shipped defaults and migrating existing per-browser flags files.

Changes:

  • Add --use-webgpu-adapter=opengles to the shipped default Chromium flags.
  • Introduce a migration that appends the flag idempotently to existing Chromium-family *-flags.conf files.
  • Add special handling intended to avoid breaking a Brave/Brave Origin shared-flags setup.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
migrations/1784607542.sh Migrates existing browser flag files to include the WebGPU adapter override, with Brave/Brave Origin sharing logic.
config/chromium-flags.conf Ships the new Chromium default flag to avoid Wayland Vulkan WebGPU interop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1784607542.sh
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread migrations/1784607542.sh Outdated
Comment thread migrations/1784607542.sh
Comment thread migrations/1784607542.sh
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread migrations/1784607542.sh
Comment thread migrations/1784607542.sh
@@ -0,0 +1,28 @@
echo "Disable Chromium's Wayland Vulkan WebGPU interop to prevent browser crashes"
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

migrations/1784607542.sh:22

  • readlink -f can fail on dangling symlinks; because migrations are run with bash -euo pipefail, this can abort the entire migration and prevent flag updates. You can avoid the external call (and the failure mode) by using Bash's -ef file comparison to detect whether the Brave Origin flags symlink resolves to the same file as brave-flags.conf.
if [[ -f $brave_flags ]] && {
  [[ -L $brave_origin_flags && $(readlink -f "$brave_flags") == $(readlink -f "$brave_origin_flags") ]] ||
  [[ -L $brave_origin_beta_flags && $(readlink -f "$brave_flags") == $(readlink -f "$brave_origin_beta_flags") ]]
}; then

migrations/1784607542.sh:11

  • The migration claims to cover existing Chromium-family *-flags.conf files, but this hard-coded list misses several flag filenames already recognized elsewhere in the repo (e.g. google-chrome-stable-flags.conf, microsoft-edge-flags.conf, vivaldi-flags.conf, helium-flags.conf, brave-browser-flags.conf in bin/omarchy-upgrade-to-quattro:1613-1626). Adding them here would make the migration more complete and align it with the repo’s known flag file set.
for flags_file in "$HOME"/.config/{chromium,chrome,google-chrome,google-chrome-beta,google-chrome-unstable,microsoft-edge-stable,microsoft-edge-beta,microsoft-edge-dev,vivaldi-stable,vivaldi-snapshot,opera,opera-beta,opera-developer}-flags.conf; do

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