-
Notifications
You must be signed in to change notification settings - Fork 68
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
Question : Emscripten integration #98
Comments
I certainly don't, but having an emscripten build would be awesome! Feel free to open a draft PR with what you've tried so we can follow along. |
Wondering if this is possible with nvcc. Probably easier after switching to C++20 parallel algorithms? |
I think it's possible, this repo https://github.com/jstepien/boids seems to achieve it but i didn't try to compile it. |
It seems to me that the make file is compiling the cpu simulation to llvm IR using clang, and then use emscripten to compile the LLVM IR to JavaScript. I don't think nvcc can emit LLVM IR (at least I don't see an option for this). |
You can build this library without nvcc, as long as you're not targeting the CUDA backend. Thrust is just a header-only C++ lib. That may be a path forward. What I'd really love to see is emscripten taking C++20 parallel algorithms and converting them to GPU-accelerated WASM (WebGPU?). I would imagine someone somewhere is thinking about that, but I have no idea if/when it might ship. |
I've tried using the OpenMP backend and CUDA backend for some tests, it seems that CUDA is quite fast for some larger meshes comparing to OpenMP (which is expected). Wondering if GPU acceleration will be dropped if the goal is to switch to c++ 20 parallel algorithms later. |
Yes, GPU parallelization is definitely a goal of this library, and I should really be saying C++17, not C++20. |
OK I have successfully compiling and running the code with emscripten. You have to:
You may want to build with |
That's awesome! Fantastic work. It would be great to integrate that into our CMake scripts somehow, maybe even get it building/testing on our Github Actions CI? |
Yes this can be integrated into the CMake script and test it on GitHub Actions CI, but this requires some modifications:
Also, it will be nice if we can specify the gtest dependency as git a submodule rather than using CMake to download it. I can package this with NixOS for reproducible builds, but it forbids network connection for pure builds so CMake will not be able to download gtest from the web. I just tried building assimp with emscripten and it seems that it builds fine out of the box for v5.2.3. Will try to link against it and do some tests. |
Hi !
I'm trying to integrate the library with emscripten and i'm a bit struggling.
I tried a lot of stuff but nothing worked.
Does anyone know a proper way to do it ?
Thanks a lot
The text was updated successfully, but these errors were encountered: