Prevent Chromium Vulkan crashes on Wayland#6333
Conversation
There was a problem hiding this comment.
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=openglesto the shipped default Chromium flags. - Introduce a migration that appends the flag idempotently to existing Chromium-family
*-flags.conffiles. - 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| @@ -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>
There was a problem hiding this comment.
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 -fcan fail on dangling symlinks; because migrations are run withbash -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-effile comparison to detect whether the Brave Origin flags symlink resolves to the same file asbrave-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.conffiles, 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.confinbin/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
Summary
brave-flags.confwhen it is shared with its known broken multi-line flags wrapperWhy
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 Vulkanerror and can crash or freeze the browser.--use-webgpu-adapter=openglesdisables that interop path while retaining hardware compositing and rasterization.Refs: brave/brave-browser#55805, #5372
Testing
./test/all