-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
WebAssembly maximum memory 2GB causes Out of Memory error on iOS Safari 16.2 #70621
Comments
Even if doing these workaround, sometimes page crash occurs while loading indicator. Maybe related to #67949. |
I'm getting the same error, posted a screen shot for reference. I think this is related to #67949 as well. |
@TyounanMOTI I tried following your steps and I still could not get my project to run. |
@stefano-elysium Here is the debug template for web built by myself.
That exception is caused by lack of WASM-SIMD implementation of iOS Safari 16.3 or earlier. Excluding module raycast while build by option |
I will try recompiling with module_raycast_enabled=no, but just as a fyi I tested with the templates I have made for now and was unable to run on ios16.4 (although I couldn't figure out how to check if the browser updated too) |
Unfortunately, at least from my testing, the only realiable way to have web exports that run on most platforms is to use godot 3 |
@dyegoaurelio the issue is the same if you attempt to run godot 3 with multithreading on. |
The support for godot 3 web exports is better than godot 4 even with multithreading on (which is an optional feature) For multithreading to work, the browser just needs to support Shared Array Buffer |
Have you tried running a multithreaded godot 3 version on the iphone? I receive the same issue as with godot 4 |
@akien-mga Should we use As a bonus, it'll make web export templates smaller as Embree could possibly be excluded at the same time. We just need to update the documentation accordingly to mention occlusion culling won't work in web exports. |
Yeah we can probably disable the raycast module by default on Web, directly in I hadn't really considered the memory footprint from including everything that can compile, so we might want to review other optional features to see if some would make sense to disable by default if we think that they're very unlikely to be used for Web projects. This would need to be documented of course as some users can be taken aback when a feature that works on PC seems broken/missing on Web. |
In my testing WASM_MEM_MAX=256MB and module_raycast_enabled=no does allow Godot 4 games to start on iOS Safari. They seem to crash after a while though, but this could easily be a problem with Safari and not Godot. At least the games will start now :-) |
@akien-mga I think github accidentally closed this issue, could you reopen it? This issue was originally about Godot starting with a too high web assembly memory requirement, which hasn't been fixed by the linked PR. While disabling the ray cast module due to the lack of simd support in wasm is also necessary, it isn't a full solution to this problem. |
This means no CPU occlusion culling (and not compiling Embree), unless you compile custom export templates with `module_raycast_enabled=yes`. This reduces the memory footprint significantly, and binary size. Fixes godotengine#70621. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro> (cherry picked from commit 8c40edf)
On Godot 4.2 dev 6 still doesn't work. Did I still need to rebuild the engine with the "WASM_MEM_MAX=256MB" parameter? I've tested on iPhone 11 Pro Max and iPhone 12 Pro. IMG_2515.MP4Edit: |
That is as far as I have gotten as well. With 256MB it loads and looks fine for a few seconds, then it crashes. |
Should probably open an issue upstream: https://bugs.webkit.org/ |
Did someone already reproduce the issue with the upstream Webkit? This is how to build it from source: https://trac.webkit.org/wiki/BuildingGtk#BuildingWebKitGTKfromgit If it could be reproduced there, it would be easier to debug, both for us and for the WebKit developers. |
This means no CPU occlusion culling (and not compiling Embree), unless you compile custom export templates with `module_raycast_enabled=yes`. This reduces the memory footprint significantly, and binary size. Fixes godotengine#70621. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Monkey testing stuff around I found a trick.
I have not tested this in a large game, so maybe Godo choke on the smaller max memory. Also the value should be 256MB, it could be bigger than I tested it here. Maybe this code could detect iOS, and use the smaller max memory there instead of everywhere. |
I'm getting this issue on Firefox on Android 10 as well (Samsung Galaxy J6+ phone with 3GB RAM), on 4.3.stable, single-thread export. It doesn't always happen, but sometimes it's stuck on 100% in the loading screen, and the browser console (visible by connecting to Desktop Firefox USB debugger) logs an "Uncaught (in promise) InternalError: out of memory" after a long time. So, there's 2 issues. One is the memory issue itself. Second is the fact no feedback is shown to the user, so they could be waiting forever without knowing any sort of error happened. There should be some sort of error message if this out-of-memory issue happens. I haven't tried the solution of recompiling the engine, and couldn't find any obvious thing to replace in the JS to try to set that value (like in the comment above mine). |
Godot version
4.0.dev (f382a2b)
System information
iOS 16.2 Safari, iPhone 13 Pro
Issue description
When exporting for Web and running on iOS 16.2 Safari, out of memory error occurs at WebAssembly.Memory initialization.
This error comes because
maximum
argument is 2048MB which is quite bigger for iOS.When I changed
WASM_MEM_MAX
to 256MB for example at platform/web/detect.py: 197, the error disappeared.Steps to reproduce
module_raycast_enabled=no
to disable WebAssembly SIMD usage which seems to be not yet supported on iOS Safari 16.2.Minimal reproduction project
simple_rotating_white_cube.zip
The text was updated successfully, but these errors were encountered: