{{ message }}
Repository navigation
fix(engine): software renders reach SwiftShader when VK_DRIVER_FILES pins a GPU - #5976
Open
diogochaves wants to merge 1 commit into
Open
diogochaves wants to merge 1 commit into
diogochaves wants to merge 1 commit into
Conversation
…pins a GPU ANGLE (and Dawn) load SwiftShader by pointing the Vulkan loader at its ICD through VK_ICD_FILENAMES. The loader ignores VK_ICD_FILENAMES while VK_DRIVER_FILES is set, and still applies VK_LOADER_DRIVERS_SELECT/DISABLE, so on a machine that pins its Vulkan driver that way a --no-browser-gpu render gets ANGLE on the real GPU and assertSwiftShader refuses it. Launch SwiftShader browsers without those three variables. Hardware launches, and environments that set none of them, are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Software renders (
--no-browser-gpu, or auto falling back to software) launch Chrome withoutVK_DRIVER_FILES,VK_LOADER_DRIVERS_SELECTandVK_LOADER_DRIVERS_DISABLE. Hardware launches, and environments that set none of them, are unchanged.Why
On my Linux desktop the session pins Vulkan to the AMD iGPU with
VK_DRIVER_FILES=/usr/share/vulkan/icd.d/radeon_icd.json(it has a second GPU). Every software render failed before the first frame:The flags were right (
--use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader). ANGLE loads SwiftShader by pointing the Vulkan loader at its ICD throughVK_ICD_FILENAMES, and the loader ignoresVK_ICD_FILENAMESwheneverVK_DRIVER_FILESis set (LoaderDriverInterface.md), so ANGLE gets the real GPU.VK_LOADER_DRIVERS_SELECTbreaks it too:VK_LOADER_DRIVERS_SELECT='*radeon*'filters SwiftShader out and the check sees no WebGL at all.Repro, any project:
VK_DRIVER_FILES=<your GPU's ICD json> npx hyperframes render --no-browser-gpu. Fails on 0.8.179 and 0.8.181 with chrome-headless-shell 155.0.8059.84; works withenv -u VK_DRIVER_FILES.Related work
None that I found (searched issues and PRs for VK_DRIVER_FILES, VK_ICD_FILENAMES, assertSwiftShader, SwiftShader Vulkan). It sits next to the
WAYLAND_DISPLAYlaunch env from #5591. The CLI's own browsers (check,snapshot) don't go throughlaunchBrowser, so they still inherit the pin in software mode; nothing fails there, so I left them out.How
launchBrowsernow askslaunchEnv(fingerprint)for its env: the WSL case as before, otherwise, when the args select SwiftShader (--use-angle=swiftshaderor--use-vulkan=swiftshader) and one of the three variables is set, a copy ofprocess.envwithout them. Otherwiseundefined, so Puppeteer inherits as it does today.Test plan
browserManager-vulkanEnv.test.tschecks the launch env for software (pins dropped, rest kept), hardware (inherited) and an unpinned env (inherited). The first case fails onmain.assertSwiftShaderpasses on worker 0. Same withVK_LOADER_DRIVERS_SELECT='*radeon*'. Default (hardware) render unchanged.oxlint,oxfmt --check, engine typecheck,check-comment-citations.mjs,comment-ratchet.mjs. Engine suite: the 6 failures I get are the same onmain(ffmpeg 9 dropped-vsync, and two WSL probe-timeout tests).