-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Web] Which node.js version is supposed to be supported? #18078
Comments
node v18 should work, but my understanding is that not all browsers + platforms can support ort-web multithreading. If you are running in Node, the |
I want to use onnxruntime-web / WASM as a fallback for machines that are not running on x86, since onnxruntime-node only works on x86
I'm running in node, see above. Specifically, I'm running this file ( https://github.com/nextcloud/text2image_stablediffusion/blob/main/src/stablediffusion.mjs ) with onnxruntime-web instead of onnxruntime-node. My understanding is that it should be possible to simply switch out the import statement and it should work. |
Hello, where did you see that onnxruntime-node only works on x86 & that it would be possible to swap out the import statements? The npm registry package page indicates that onnxruntime-node supports x64. Since there is a "node" export in onnxruntime-web's package.json, it does look like onnxruntime-web can work in Node, but it looks like from the build script that the node export is built with multithreading disabled. You can try a custom build (modify the DISABLE_WASM_THREAD boolean to true for the ort.node.min.js build and then follow these build instructions), but I'm not sure if multithreading in onnxruntime-web in Node is supported yet. |
onnxruntime-node should have supported win/linux/mac on x64/arm64. @marcelklehr what exact OS/platform are you using? |
I can only use pre-built binaries
I'd like to use it on ARM and on machines that don't have glibc. On npm it is stated that onnxruntime-web supports node: https://www.npmjs.com/package/onnxruntime-web#compatibility |
Seems like the document is out of date. Currently we support 6: Win x64, Win Arm64, Linux x64, Linux Arm64, Mac x64 and Mac arm64 You can check from a CDN (eg. https://www.jsdelivr.com/package/npm/onnxruntime-node?tab=files&path=bin%2Fnapi-v3%2Fwin32) for the subfolder of "bin" |
I see... I think ONNX Runtime itself may not support this but I am not sure. Are you able to use a docker in your environment? |
No, that's the reason I'm looking for WASM support on node.js |
onnxruntime-node not MATTER with node version, |
WASM works on Node.js only when disabling the multi-thread features. They depends on creating web workers on Blob URL which is not supported in node.js |
Fixes #1374 A customer reported that the app fails to run on Windows ARM. The error is coming when trying to load ONNX. ONNX runtime supports Windows ARM, e.g. see - https://www.jsdelivr.com/package/npm/onnxruntime-node?tab=files&path=bin%2Fnapi-v3%2Fwin32 - microsoft/onnxruntime#18078 The issue then seems to be that we're not actually building for Windows ARM. I'm not sure about this (don't have a Windows ARM machine at hand), but my theory is that since we don't ask Electron Builder to build for win arm64, it doesn't copy the corresponding ONNX binary into the generated bundle. Other refs: - https://www.electron.build/cli.html
Fixes #1374 A customer reported that the app fails to run on Windows ARM. The error is coming when trying to load ONNX. ONNX runtime supports Windows ARM, e.g. see - https://www.jsdelivr.com/package/npm/onnxruntime-node?tab=files&path=bin%2Fnapi-v3%2Fwin32 - microsoft/onnxruntime#18078 The issue then seems to be that we're not actually building for Windows ARM. I'm not sure about this (don't have a Windows ARM machine at hand), but my theory is that since we don't ask Electron Builder to build for win arm64, it doesn't copy the corresponding ONNX binary into the generated bundle. Other refs: - https://www.electron.build/cli.html
Describe the issue
Which Node.js versions is the current version of onnxruntime-web supposed to be compatible with?
Using node v16
Using node v18 and v20
To reproduce
require('onnxruntime-web')
Urgency
No response
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.16.1
Execution Provider
Other / Unknown
The text was updated successfully, but these errors were encountered: