Skip to content

Conversation

alexreinking
Copy link
Member

@alexreinking alexreinking commented Aug 11, 2025

For a while, we've had the buildbots equipped with hand-built installations of Dawn. This has made our webgpu testing limited and brittle. This PR manages the Dawn dependency via vcpkg, encoding our knowledge of how to build Dawn just right into an executable format.

Update the WebGPU documentation to show how to build Dawn correctly. The old instructions didn't work and I have opened and upstream issue here: https://issues.chromium.org/issues/437859885

We also drop HL_WEBGPU_NODE_BINDINGS in favor of setting NODE_PATH, which is a standard variable, manually.

Forthcoming buildbot changes will move more dependency management to vcpkg and CMake presets (only for CMake-specific dependencies and builders, of course).

Fixes #8743

@alexreinking alexreinking marked this pull request as draft August 11, 2025 19:26
@alexreinking
Copy link
Member Author

This has turned into something much worse than what I thought it was. I've spent far too much time troubleshooting. I'm uploading this branch just to save my progress. Despite my best efforts, the code here does not work.

The current state is that there appears to be an ABI mismatch between the code in wgpuDevicePopErrorScope. The call site in ErrorScope::wait places the WGPUPopErrorScopeCallbackInfo in a way that appears correct. At least p pop_error_cb does the right thing in LLDB. The first argument is passed in register x0 correctly. But x1 points nowhere valid, so I assume the caller expects the callee to read the second argument from the stack pointer.

However, as soon as I step into wgpuDevicePopErrorScope (in gen/src/dawn/native/webgpu_dawn_native_proc.cpp), the result of p callbackInfo shows garbage.

I don't know if this has to do with our weird hack of compiling the runtime initially for wasm64 in the front-end and then trusting it to work when recompiled from bitcode to arm64.

We need to discuss WebGPU and potential runtime ABI issues at the next dev-meeting.

@alexreinking alexreinking added the dev_meeting Topic to be discussed at the next dev meeting label Aug 12, 2025
@alexreinking alexreinking changed the title Manage Dawn dependency via vcpkg Update webgpu.cpp for use with the latest Dawn Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev_meeting Topic to be discussed at the next dev meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtime/webgpu.cpp does not compile against the latest Dawn
1 participant