-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Web] The ONNX model cannot be loaded via WASM in the IOS17 browser. #22086
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
Comments
We are also seeing this exact error with onnxruntime-web 1.19.0, running a tiny model in all browsers on iOS 17.6.1 as well as iPadOS 17.6.1. Works fine in all browsers including safari on macOS. Downgrading onnxruntime-web to 1.18.0 fixes this for us. |
The Out of Memory error was previously reported and fixed by rolling back Emscripten SDK upgrade, backe to 3.1.59. Did reproduce this error with the latest code on main branch? |
Thank you for your help. The issue indeed doesn't exist in version 1.18.0, it seems I carelessly missed this during my earlier attempts. I really appreciate your reminder. |
Hello, I tried using the latest code as per your suggestion. Unfortunately, the same error still occurs. |
@zyhhahah could you help to test whether the following versions work or not:
|
@fs-eire I tested these three versions on various platforms.
|
I think this is a known issue of Safari and it is fixed in iOS v18.0: emscripten-core/emscripten#19374 Screenshot from BrowserStack - https://jsfiddle.net/tpz1k9d7/3/ |
@fs-eire Thank you for your reminder. I have also tested it and confirmed that indeed in iOS 18 this issue does not occur, so my question can be closed. |
work for me important!!! yarn add [email protected] or npm install [email protected]
|
@ohnobug resource not found for wasmPath provided above - https://cdnjs.cloudflare.com/ajax/libs/onnxruntime-web/1.17.3/ |
Yes, you can use jsdelivr which still have version 1.17.3 available. By the way, onnxruntime-web no longer release webassembly artifacts for non-SIMD and non-MultiThread since version 1.18. While you can use onnxruntime v1.17.3 as a compatibility workaround for ios17. |
This issue has reoccurred in the 1.22.0 release |
@jbrough could you describe it more about "issue has reoccurred in the 1.22.0 release"? Is it v1.21.1 working but v1.22.0 not working on a specific iOS version ? |
@fs-eire yes, sorry I tried to find this thread again to provide more info. v1.21.1 worked. v1.22.0 does not on iOS (v18), when the cdn switched it out a few days ago, that's when I noticed the issue: OOM Range Error, as above. Compiling to wasm myself with these flags fixes it on Safair IOS18
I think if I went much above 196MB max shared memory the bug would re-occur but I didn't test that yet, |
to summarise, the shared memory max defaults are prob a hair too high for iOS - the initial memory isn't important, whatever the maximum memory is if ALLOW_MEMORY_GROWTH=1 is what safari takes into account. I have tested this and have it working again with SileroVAD after compiling the threaded wasm myself with those revised memory limits. |
Describe the issue
This is the encountered error, which only occurs in the web environment on the iPhone.

I initially thought this issue was caused by version differences, so I tried many versions. They all worked fine in the web environment on Android and Windows. Based on the error message, it seems to be caused by insufficient memory. I tried many different models, including some very small ones, but the issue persisted. However, I found that when using the WebGL backend, the issue does not occur. It only happens with the WASM backend.
To reproduce
In my project, the code is quite complex, so I simplified it following the official example to reproduce the issue. The model used can be any ONNX model. The devices I tested on include iPhone 13 Pro, iPhone 13 Pro Max, and iPhone 15 Pro Max, and the issue occurred on all of them.

Urgency
My project is currently at a standstill due to this issue, and I'm not sure whether it's a problem with my implementation or a version-related issue. I'm wondering if I'm the only one encountering this problem.
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
多版本都存在这个问题
Execution Provider
'webgl' (WebGL), 'wasm'/'cpu' (WebAssembly CPU)
The text was updated successfully, but these errors were encountered: