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

Cannot enlarge memory #512

Open
harrycollin opened this issue Mar 27, 2023 · 12 comments
Open

Cannot enlarge memory #512

harrycollin opened this issue Mar 27, 2023 · 12 comments
Assignees
Labels

Comments

@harrycollin
Copy link

I'm working with rhino3dm JS in Node with the wasm module. I'm trying to work with a 1gb file but have been getting this error from the wasm.

Cannot enlarge memory, asked to go up to 2830614528 bytes, but the limit is 2147483648 bytes!

Is there a way around this?

@fraguada
Copy link
Member

fraguada commented Mar 28, 2023

Currently the maximum memory is set to the default heap size of 2GB (the 2147483648). We can try to increase this in subsequent builds but need to study the consequences. I'll try to compile something with 4GB ceiling and link the result here for you to try.

@fraguada fraguada self-assigned this Mar 28, 2023
@fraguada fraguada added the js label Mar 28, 2023
@harrycollin
Copy link
Author

Thank you @fraguada!

@fraguada
Copy link
Member

@harrycollin please check this build (available for 15 days): https://github.com/mcneel/rhino3dm/suites/11870654063/artifacts/620806777

I've raised the maximum memory heap to 4GB from the default 2GB. I'd be curious to know if this makes any difference in your case.

@harrycollin
Copy link
Author

harrycollin commented Mar 28, 2023

@fraguada Thank you! I just tested this but the module is still requesting more memory beyond the limit :/
Which options do you think I have for this? I'd be interested to see a MEMORY64 build of the wasm in the future for these big models.

@fraguada
Copy link
Member

I'll take a look.

@fraguada
Copy link
Member

fraguada commented Mar 29, 2023

Not sure what is needed, but a MEMORY64 build doesn't seem to be building. Where are you using the library? Seems MEMORY64 support across browsers is only on nightly builds and node with special flags.

@harrycollin
Copy link
Author

harrycollin commented Mar 29, 2023

I would be using the library server-side with Node, so the browser support isn't a concern for me. It can be enabled with the --experimental-wasm-memory64 flag.

@fraguada
Copy link
Member

@harrycollin after our meeting in Barcelona I think I will add nodejs as a platform and build it with the --experimental-wasm-memory64 and see how that works for you. FWIW I have brought back the max memory in the js build.

@harrycollin
Copy link
Author

Great to hear @fraguada! It was a pleasure discussing this with you. I'll test it as soon as it's ready :)

@fraguada
Copy link
Member

fraguada commented Oct 30, 2023

Note, getting errors on compilation:

[ 69%] Linking CXX executable rhino3dm.js
em++: warning: -sMEMORY64 is still experimental. Many features may not work. [-Wexperimental]
cache:INFO: generating system asset: symbol_lists/4e0764ba4c2b370d82d769cdd9dca3fefe4949cb.txt... (this will be cached in "/home/ubuntu/emsdk/upstream/emscripten/cache/symbol_lists/4e0764ba4c2b370d82d769cdd9dca3fefe4949cb.txt" for subsequent builds)
cache:INFO:  - ok
wasm-ld: error: CMakeFiles/rhino3dm.dir/lib/opennurbs/zlib/adler32.c.o: wasm32 object file can't be linked in wasm64 mode
em++: error: '/home/ubuntu/emsdk/upstream/bin/wasm-ld @/tmp/emscripten_lwq1lfq1.rsp.utf-8' failed (returned 1)
make[2]: *** [CMakeFiles/rhino3dm.dir/build.make:5031: rhino3dm.js] Error 1
make[1]: *** [CMakeFiles/Makefile2:162: CMakeFiles/rhino3dm.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
emmake: error: 'make' failed (returned 2)

@fraguada
Copy link
Member

fraguada commented Mar 4, 2024

TODO: Need to test this as Chrome has fixed a bug related to this, and it should be available in node

@fraguada fraguada added this to the 8.5.0-beta milestone Mar 4, 2024
@harrycollin
Copy link
Author

Hey @fraguada, is there any news on this? :)

@fraguada fraguada removed this from the 8.6.0-beta milestone May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants