Skip to content
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

WASM Runtime Error on Safari #21

Open
sheley1998 opened this issue Dec 29, 2022 · 3 comments
Open

WASM Runtime Error on Safari #21

sheley1998 opened this issue Dec 29, 2022 · 3 comments

Comments

@sheley1998
Copy link

Thank you for your incredible work!

I've gotten everything to run on Chrome and Firefox. However, when I try execute PhysX() on Safari, I get the following error:

Unhandled Promise Rejection: RuntimeError: Aborted(CompileError: WebAssembly.Module doesn't parse at byte 5: can't get Function local's type in group 1, in function at index 4967)

I'm running Safari 16.2 on MacOS Ventura 13.1, Apple M1 chip

I'll try to build from source and see if there's anything I could change to get it to work. Would appreciate if you could look into it as well!

Cheers

@fabmax
Copy link
Owner

fabmax commented Dec 30, 2022

Hmm might be SIMD related. WASM SIMD support is still experimental, so Safari might not fully support it.

You can try to recompile the library with SIMD disabled by adding the following line to the physx/source/compiler/cmake/emscripten/CMakeLists.txt cmake file:

ADD_DEFINITIONS(-DPX_SIMD_DISABLED)

@sheley1998
Copy link
Author

Thanks for the tip. While that didn't seem to work, apparently the debug code path has SIMD disabled by default, which runs well in Safari. Unfortunately, debug build is 10mb larger than release build. I'll tinker with build settings some more, hopefully there's a better approach.

@May2nd
Copy link

May2nd commented Jun 17, 2024

I added ADD_DEFINITIONS(-DPX_SIMD_DISABLED=1) and remove -msimd128, it worked. Thanks.

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

No branches or pull requests

3 participants