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 Memory Out of Range Error on iPhone Devices #134

Open
deleayo535 opened this issue Sep 2, 2024 · 6 comments
Open

WASM Memory Out of Range Error on iPhone Devices #134

deleayo535 opened this issue Sep 2, 2024 · 6 comments

Comments

@deleayo535
Copy link

deleayo535 commented Sep 2, 2024

While trying to implement a voice activity detection feature using your vad-web library, I encountered a troublesome issue on iPhone devices. The application works as expected on other platforms, but when attempting to access it on an iPhone, I get the following error message:

Encountered an error while loading model file. Please make sure silero_vad.onnx, included with @ricky0123/vad-web, is available at the specified path: /silero_vad.onx.
Error: no backend found. ERR: [wasm] RangeError: out of memory, [cpu] Error: previous call to 'initWasm'()' failed.

Environment details:

I am using @ricky0123/vad-web to implement VAD in my sveltekit application, also tried CDN scripts too.
I attempt to run the program in real-time (non-file), hence the use of RealTimeVAD.
The application is deployed in a Docker container and hosted on an AWS ECS Fargate service.
All of it is orchestrated with an AWS CDK stack.

Furthermore, note that no constructor parameters seem to mitigate or alleviate this issue.

Any help regarding this issue would be appreciated. I would be happy to provide additional information if necessary. Thank you for your time and consideration.

@deleayo535 deleayo535 changed the title error on iphone in production, sveltekit project. Error: no backend found. ERR: [wasm] RangeError: out of memory, [cpu] Error: previous call to 'initWasm'()' failed. WASM Memory Out of Range Error on iPhone Devices Sep 2, 2024
@deleayo535 deleayo535 reopened this Sep 2, 2024
@murat-aksoy
Copy link

I have the same issue

@pvscreations
Copy link

I too had faced the same issue .... The error is more like vad is unable to find the worklet path or wasm path,
My assumption is like if we place the model files in root of the project directory, rather than explict mentioning the url might solve the error.

@clonecorp
Copy link

Same here. Tried everything (CDN scripts, adjusting the paths), nothing works on iPhone.

Has anyone found the solution? The website seems to work on iPhone but I suspect it uses the React npm package, while I'm on Svelte, like the OP.

@MurlocTW
Copy link

I am using vad-react: 0.0.17 and onnxruntime-web: 1.14.0, which can run on Safari for iOS versions below 18 (tested on iOS 17.1.1, iPhone XR). Since onnxruntime-web: 1.20.0 only provides ort-wasm-simd-threaded level WASM, while version 1.14.0 offers lower-level WASM options (ort-wasm-simd, ort-wasm-threaded, ort-wasm), I suspect that lower iOS versions can only handle ort-wasm.

@clonecorp
Copy link

Can confirm. I tested it as well in Svelte. I have to use the CDN version with the previous versions to make it work on iOS 17.6.1. Not sure about the previous Safari versions or new onnxruntime-web versions though.

This was tested on iOS 17.6.1:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ort.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@ricky0123/[email protected]/dist/bundle.min.js"></script>

@janzheng
Copy link

I am using vad-react: 0.0.17 and onnxruntime-web: 1.14.0, which can run on Safari for iOS versions below 18 (tested on iOS 17.1.1, iPhone XR). Since onnxruntime-web: 1.20.0 only provides ort-wasm-simd-threaded level WASM, while version 1.14.0 offers lower-level WASM options (ort-wasm-simd, ort-wasm-threaded, ort-wasm), I suspect that lower iOS versions can only handle ort-wasm.

Downgrading an alpine web app to https://cdn.jsdelivr.net/npm/[email protected]/dist/ort.min.js made it not crash for me

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

6 participants