Skip to content

fix: preload SwiftShader before the GPU sandbox locks down again - #53174

Merged
codebytere merged 1 commit into
mainfrom
fix-win-preload-swiftshader-webgpu
Aug 26, 2026
Merged

fix: preload SwiftShader before the GPU sandbox locks down again#53174
codebytere merged 1 commit into
mainfrom
fix-win-preload-swiftshader-webgpu

Conversation

@codebytere

@codebytere codebytere commented Aug 25, 2026

Copy link
Copy Markdown
Member

Description of Change

Fixes #52700

On Windows the GPU process turns on MITIGATION_FORCE_MS_SIGNED_BINS once its sandbox is up, so any of our own DLLs it needs later have to be loaded before that. vk_swiftshader.dll used to be preloaded there unconditionally; CL 7636200 (Chromium 148, so Electron 42 and later) made it conditional on SwiftShader being asked for on the command line. WebGPU's fallback adapter on Windows is SwiftShader over Vulkan (Dawn's D3D backends return no adapters for forceFallbackAdapter; WARP is only the software path for GL), and WebGPUDecoderImpl still asks for it when no D3D12 adapter is usable or a page passes forceFallbackAdapter, so that load is now rejected by Code Integrity (event 3033). For a normal install that just means no fallback adapter; for AppX/MSIX packages the loader treats it as package tampering, kills the GPU process and marks the package as needing repair, which is what #52700 and the linked reports describe. 41 is unaffected because its Chromium predates the CL.

This reverts that CL's gpu_init.cc change so the DLL is preloaded unconditionally again, as in 41; a narrower condition is proposed upstream at https://chromium-review.googlesource.com/c/chromium/src/+/8286976 and the patch goes away once that or an equivalent lands.

Verified on Windows 11 arm64 with an MSIX-installed Electron 42.9.2 app: navigator.gpu.requestAdapter() alone produces the 3033 and kills the GPU process with 0x060C201E (package goes to Modified, NeedsRemediation); the same build unpackaged logs the 3033 but survives; Electron 41.10.7 never loads the DLL late; and forcing the preload on 42 (--enable-unsafe-swiftshader) makes the events and the crash go away.

Checklist

Release Notes

Notes: Fixed the GPU process being terminated in AppX/MSIX packaged apps on Windows when WebGPU fell back to SwiftShader.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/42-x-y PR should also be added to the "42-x-y" branch. labels Aug 25, 2026
@codebytere
codebytere requested a review from a team as a code owner August 25, 2026 11:39
@codebytere codebytere added target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Aug 25, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 25, 2026
@codebytere
codebytere force-pushed the fix-win-preload-swiftshader-webgpu branch from 72b9429 to 8f8d72f Compare August 25, 2026 13:29
@codebytere
codebytere requested a review from a team as a code owner August 25, 2026 13:29
@codebytere
codebytere force-pushed the fix-win-preload-swiftshader-webgpu branch from 8f8d72f to 7fec32e Compare August 25, 2026 13:32

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

enable_webgpu is a broader gate that would make the other conditions no-op for the majority cases. https://groups.google.com/a/chromium.org/g/blink-dev/c/yhFguWS_3pM did make WARP the default fallback for GL path but why was this code added with webgpu path not using WARP as default.

Seems fine to restore the old path but couldn't we just revert https://chromium-review.googlesource.com/c/chromium/src/+/7636200 for the crash while he upstream CL is being worked on ?

@codebytere
codebytere force-pushed the fix-win-preload-swiftshader-webgpu branch from 7fec32e to 8d8626b Compare August 25, 2026 13:44
@codebytere codebytere changed the title fix: preload SwiftShader before the GPU sandbox locks down when WebGPU is on fix: preload SwiftShader before the GPU sandbox locks down again Aug 25, 2026
@codebytere

Copy link
Copy Markdown
Member Author

@deepak1556 yeah, a straight revert is simpler here - switched the patch to revert 7636200's gpu_init.cc hunk in 8d8626b and left the gating question to the upstream CL. on warp: dawn's d3d backends return no adapters at all for forceFallbackAdapter (third_party/dawn/src/dawn/native/d3d/BackendD3D.cpp, DiscoverPhysicalDevices), so webgpu's fallback adapter on windows is swiftshader-over-vulkan by design and warp only ever covered the gl/angle software path; 7636200 seems to have assumed otherwise.

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@codebytere
codebytere force-pushed the fix-win-preload-swiftshader-webgpu branch from 8d8626b to c1ded43 Compare August 25, 2026 13:52
@codebytere
codebytere force-pushed the fix-win-preload-swiftshader-webgpu branch from c1ded43 to 687b380 Compare August 25, 2026 20:34
Reverts the gpu_init.cc change from https://crrev.com/c/7636200
(Chromium 148). Since then the GPU process only preloads
vk_swiftshader.dll when SwiftShader is requested on the command line,
but WebGPU still falls back to it when no D3D12 adapter is usable. That
load now happens after MITIGATION_FORCE_MS_SIGNED_BINS is in force and
is rejected by Code Integrity; in AppX/MSIX packages the rejection
terminates the GPU process and flags the package for repair.

Fixes #52700

No-Verification-Needed: Windows-only Chromium patch; no runtime surface on Linux.
@codebytere
codebytere force-pushed the fix-win-preload-swiftshader-webgpu branch from 687b380 to 1fa743a Compare August 26, 2026 05:58
@codebytere
codebytere merged commit 0f23419 into main Aug 26, 2026
122 of 124 checks passed
@codebytere codebytere removed the new-pr 🌱 PR opened recently label Aug 26, 2026
@codebytere
codebytere deleted the fix-win-preload-swiftshader-webgpu branch August 26, 2026 08:44
@release-clerk

release-clerk Bot commented Aug 26, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed the GPU process being terminated in AppX/MSIX packaged apps on Windows when WebGPU fell back to SwiftShader.

@trop

trop Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #53197

@trop trop Bot added in-flight/43-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels Aug 26, 2026
@trop

trop Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53198

@trop

trop Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #53199

@trop trop Bot added in-flight/44-x-y in-flight/42-x-y merged/44-x-y PR was merged to the "44-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/44-x-y in-flight/43-x-y labels Aug 26, 2026
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Windows MSIX/AppX: Chromium GPU process can be killed when Code Integrity rejects vk_swiftshader.dll

3 participants