Skip to content

fix(boot-device): disable guest Vulkan on macOS Android emulators - #1554

Merged
latekvo merged 4 commits into
mainfrom
fix/macos-emulator-guest-vulkan
Oct 27, 2026
Merged

latekvo merged 4 commits into
mainfrom
fix/macos-emulator-guest-vulkan

Conversation

@latekvo

@latekvo latekvo commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Fixes #1549

On macOS, guest Vulkan in the Android emulator crashes Chrome's GPU process with every host backend (lavapipe, SwiftShader, MoltenVK). This breaks Chrome and Custom Tab sign-in flows. boot-device now boots macOS emulators with -feature -Vulkan.

Apps then find no Vulkan device, so a Vulkan-only renderer (react-native-wgpu, WebGPU) draws nothing. guestVulkan: true turns it back on; ARGENT_EMULATOR_GUEST_VULKAN sets the default. An emulator already running in the other mode (Android Studio, Diplomat) is reused with a note that points at force: true, which needs #1586.

Pixel 6 API 34 Chrome GPU-process crashes in 45 s Vulkan devices in the guest react-native-shine example
main 6 1 renders
this PR 0 0 blank
this PR, guestVulkan: true 6 1 renders

Docs: the ARGENT_EMULATOR_GUEST_VULKAN row in reference/configuration.mdx.

Repro and checks
  • Hosts: M4 Pro, emulator 36.1.9; M3 Pro, macOS 27, emulator 36.6.11. Booted through the real createBootDeviceTool().execute(), then ran the issue's chrome-gpu-check.sh.
  • Crash count without the flag on the M3 Pro (emulator 36.6.11): auto/lavapipe 6/6/6, host/MoltenVK 6/6, swiftshader 6/6. With the flag, every mode gives 0.
  • Linux (x86_64, emulator 36.5.11): the default -gpu swiftshader does not crash (0/0/0), so Linux is unchanged. -gpu auto (lavapipe) crashes 6/6.
  • With the flag the guest still lists android.hardware.vulkan.* (static vendor XML) and ro.hardware.vulkan=ranchu. Only ro.boot.hardware.vulkan goes empty, so the reuse note reads that property.
  • guestVulkan: true passes -feature Vulkan, which also overrides Vulkan = off in advancedFeatures.ini (checked: 1 Vulkan device).
  • Snapshot parity: a probe without the flag rejects a snapshot saved with it, so the probe, hot boot and cold boot get the same argv. An existing default_boot cold-boots once after the upgrade.
  • Unit tests fail without the change, and mutants of the platform gate, env/param precedence, note logic and argv are killed. Build, typecheck:tests, eslint, knip, prettier, docusaurus and the SpiderShield gate (9.07) pass. The tool-server suite passes except e2e-tool-aliases, which also fails locally on main.
  • TODO: an Intel Mac, where -gpu auto may give guest Vulkan on the real GPU.

On macOS the emulator backs guest Vulkan with a CPU driver (SwiftShader,
or lavapipe on emulator 37), and Chrome's GPU process keeps crashing on
it, so Chrome Custom Tab sign-in flows die. Boot with -feature -Vulkan
on macOS, in both the snapshot probe and the boot argv.
ARGENT_EMULATOR_GUEST_VULKAN=1 keeps guest Vulkan.

Fixes #1549
@latekvo

latekvo commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

AVD rendering pipelines are dense sources of absurd edge-cases, do not merge this until extremely thorough review.

I'd be even more in favour of sensible defaults with extensive at-runtime configurability, allowing the agent to change the rendering pipelines and more.

…r mode

Guest Vulkan off leaves apps with no Vulkan device, so a Vulkan-only
renderer (react-native-wgpu) draws nothing. `guestVulkan: true` turns it
back on per call; ARGENT_EMULATOR_GUEST_VULKAN sets the default. macOS
always passes `-feature Vulkan` or `-feature -Vulkan`, so an
advancedFeatures.ini setting cannot override the choice.

The already-running fast path reuses an emulator started elsewhere
(Android Studio, Diplomat) as-is; it now returns a `note` when that
emulator's guest Vulkan mode differs from the one asked for.

The crash is not specific to a CPU driver: it also happens with
`-gpu host` (MoltenVK), so the comment and docs say so.
@latekvo
latekvo marked this pull request as ready for review October 27, 2026 18:48
@latekvo

latekvo commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Ready to merge, just fixing last couple of comments and low test findings, then merging.

@latekvo
latekvo merged commit 729823b into main Oct 27, 2026
16 checks passed
@latekvo
latekvo deleted the fix/macos-emulator-guest-vulkan branch October 27, 2026 18:58
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.

Android emulator boots with lavapipe Vulkan on macOS; Chrome GPU process crashes ("Timed out waiting for GPU channel")

1 participant