-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Targetting wasm-32-wasmrt-webgpu seems to require native webgpu too? #8063
Comments
This should be covered in README_webgpu.md -- please take a look and let me know if that doesn't explain. |
Thanks. Yes, I was following that guide, for Emscripten, but this line always requires the presence of a native webgpu module it seems? When The project builds fine without it (although |
In general, this is not a good fix, because
Please try this and let me know if it solves your problem. |
This seemed to work, but when I actually schedule for the GPU, I get the error:
Somehow I need to tell cmake that I've create a fork: https://github.com/StronglyTypedSolutions/Halide/tree/pv/hello-webgpu/apps/HelloWasmWebGPU |
When configuring CMake, use |
Thanks! Sorry for these silly questions, I am completely new to Halide. Now indeed that step passes, but it fails further down the line with:
That seems logical, because it is caused by the So when disabling
it builds fine! But, it doesn't run, Chrome reports the following error:
I can't find any example of Halide using WebGPU in the browser, so I'm stuck a bit 😉 |
Adding @jrprice to see if he has any insight on why Dumb q: is WebGPU enabled in your browser? |
It looks like the I'll talk to the author of that PR and see if we can assert the contents of the descriptor instead of the whole descriptor itself. In the meantime you could either rollback Emscripten to before that change, or hack Halide to pass |
This indeed gets me one step in the right direction, but then the Javascript raises an exception because the
However, in Emscripten, the enum is different (off by one):
Emscripten however assumes the
The question is, who is right? In the webgpu-native repo, the enums are also In If will change the code by using the |
Emscripten is right and matches Dawn; webgpu-native hasn't caught up yet. I'll work on getting Halide's WebGPU APIs updated to match Dawn+Emscripten now, which will hopefully resolve all of these issues. Apologies for the problems - the WebGPU native API is still in flux but I'm hearing signals that it might be starting to stabilize soon. |
Let me know if you need assistance -- I can takepoint on upgrading emcc/dawn on all the buildbots if necessary. |
I am glad I could be of assistance, and thanks for the help! PS: My hobby project is https://vikid.net, and I was thinking about using Halide for high performance reactive systems, like particle systems. Just having fun. |
OK, with this Halide PR and this Emscripten PR, Halide+WASM+WebGPU should be working again. I've tested this with a modified version of the |
I've updated and restarted all our buildbots that test WebGPU, so the tests after this point should be valid. |
oh wait, do I need to wait for that EMCC change to land? |
(We may want to backport this fix to the recent Halide 17 release) |
Not sure. The API difference fixed by that change has been there a while so if the bots have been passing then maybe it's not necessary? Although that would suggest that the Emscripten path isn't being tested on the bots. In any case, the Emscripten PR has landed. |
You guys rock! |
Closing this, it works now. I still need to figure out how to do WebGPU interop between Javascript and wasm (e.g. "passing" a WebGPU buffer from JS to WASM), but that is emscripten stuff I guess, not related to Halide. Thanks! |
…elease (#8106) * Don't require Halide_WebGPU when using wasm (#8063) (#8065) * Don't require Halide_WebGPU when using wasm (#8063) * trigger buildbots * [WebGPU] Update to latest native headers (#8081) * [WebGPU] Update to latest native headers * Remove #ifdef for `requiredFeature[s]Count` * Pass nullptr to wgpuCreateInstance * Emscripten currently requires this * Dawn accepts it too * Use nullptr for another wgpuCreateInstance call --------- Co-authored-by: James Price <[email protected]>
* Don't require Halide_WebGPU when using wasm (halide#8063) * trigger buildbots
I was trying to modify the
HelloWasm
app to use WebGPU for running in a browser.But CMake fails:
Why is
Halide_WebGPU_NATIVE_LIB
required when targetting the web browser?The command that fails is:
After the following fix in
HalideGeneratorHelpers.cmake
, it worked:if ("${ARGN}" MATCHES "webgpu")
if ("${ARGN}" MATCHES "host-webgpu")
PS: However, the wasn't enough to actually make the app use
WebGPU
(how can I know?), so more help is appreciated 😉The text was updated successfully, but these errors were encountered: