Regard3D icon indicating copy to clipboard operation
Regard3D copied to clipboard

WebAssembly and distributed computing

Open lastmjs opened this issue 7 years ago • 8 comments

This is pretty awesome! I might like to get involved with this project. I'm especially interested in getting it to run in the browser. Have you considered compiling to WebAssembly? WebAssembly is out as an MVP in Firefox and Chrome now. Compiling to the web could have some major advantages, including ease of use and potential distributed computing across arbitrary peers. We could also look into easily taking advantage of hardware acceleration through the GPU with WebGL. I'd like to explore these ideas and see how they could fit in with one of my other projects that is a prototype for distributing computing completely peer-to-peer in the browser: https://github.com/lastmjs/browser-based-super-grid

Anyway, I would love any thoughts or direction on these ideas, and especially to see if this is a direction Regard3D would like to go.

lastmjs avatar Apr 20 '17 03:04 lastmjs

Hi @lastmjs if you want we can play and try to run some part of the OpenMVG pipeline on the web. Please tell how I can help. We could think about using the super-grid to compute features and matches on the cloud ;-)

pmoulon avatar Apr 20 '17 05:04 pmoulon

That's where I was headed, getting OpenMVG compiled. So, the biggest barrier for me in getting started is where to start, or what to compile first. I don't know much about how OpenMVG works, the pipeline, or anything. Is there a simple command-line task that OpenMVG performs that we could start with?

lastmjs avatar Apr 20 '17 06:04 lastmjs

Also, if you want to start getting setup for WebAssembly, it's​ pretty simple to get started with, they've done a good job: http://webassembly.org/getting-started/developers-guide/

lastmjs avatar Apr 20 '17 06:04 lastmjs

For the build instruction you can find some here: https://github.com/openMVG/openMVG/blob/master/BUILD

For running the pipeline I advise first people to play with the python tutorial that launch the pipeline http://openmvg.readthedocs.io/en/latest/software/SfM/SfM/#openmvg-sfm-pipelines-demo

It checkout a tiny image dataset and process it with the lib.

pmoulon avatar Apr 20 '17 06:04 pmoulon

That will be a great place to start, thanks. I'm pretty busy this next week or so, but I'd love to dig into this soon. Seems pretty straightforward so far, we'll need to figure out how emscripten compiles large C++ applications. We'll also have to figure out how WebAssembly handles file IO, or somehow port over those Python scripts as well. I might rewrite the Python scripts in JS and call into the compiled WebAssembly, not sure yet without digging into it.

lastmjs avatar Apr 20 '17 06:04 lastmjs

Could you please describe your experiences with WebAssembly and distributed computations? Did you combine WebAssembly with your peer-to-peer in the browser project?

stefaneidelloth avatar Dec 19 '19 16:12 stefaneidelloth

I did not use WebAssembly for that project, it was a university demo project, and thus didn't need great performance. The project used WebRTC very effectively though, and did its simple computations in JavaScript. I still stand behind WebAssembly as a great way (if not the only viable way) to Port something like OpenMVG to the browser. Though, I don't have much interest in doing it

lastmjs avatar Dec 19 '19 17:12 lastmjs

Ok, thank you for your reply and the hint to WebRTC. I just found following project: https://distributed.computer Unfortunately they don't seem to provide their code as open source. If you hear about some active open source project on distributed computation with browsers, please let me know.

stefaneidelloth avatar Dec 20 '19 08:12 stefaneidelloth