Pulse Unity WebGL build

Hi everyone,

I’m trying to build the VitalsMonitor sample scene un WebGL using Unity 2020.1.5f. The scene is playing well in the editor, and the build process ends without errors.
But when i run the build inside a webbrowser, i have this error:

Invoking error handler due to
abort(“To use dlopen, you need to use Emscripten’s linking support, see githublink/emscripten/wiki/Linking”) at Error
at jsStackTrace ( localIP/Build/Build.framework.js:2:16333)
at stackTrace ( localIP/Build/Build.framework.js:2:16504)
at abort ( localIP/Build/Build.framework.js:2:747)
at _dlopen ( localIP/Build/Build.framework.js:2:163457)
at :wasm-function[37667]:0xc10bd8

Build.framework.js:2 DllNotFoundException: Unable to load DLL ‘PulseC’: The specified module could not be found.
(Filename: currently not available on il2cpp Line: -1)

Do you have any idea on how to solve this issue ?

Thank you in advance.
–Selim

Hi Selim,

I have not tried running the Vitals Monitor in a browser via WebGL build yet. But this is something that I am going to investigate in the next few months.

The scene should build with out issue as you see, but Pulse is a Native C++ library so there has to be a native something on disk for the the unity app to load to access Pulse.

I am not sure what that native something is for a WebGL build though.
I have build Pulse (I think…) using emscripten, which output a bunch of .a files (which are linux static libraries?) Even the shared objects were built as .a files… but I don’t know if that is just what emscripten is supposed to do or there is something I am missing in my build…

I have posted all of the build artifacts (.a files) and posted them here

I believe PulseC.a should have been a PulseC.wasm, but I am not really familiar with the emscripten native build chain…
The PulseC.a is only 30k… so it seems that the build is not producing a valid wasm binary…

Note that I am building with the dockcross web-wasm docker
I am I probably just not understanding the wasm build process yet…
But I am not sure when I am going to get around to doing this

But I can hep answer questions in the mean time if you take a stab at building a PulseC.wasm

I would also be interested in hearing how you run the build inside a webbrowser

Sorry there is no quick answer yet, but maybe we can investigate this together…

Thank you Aaron for your fast and clear answer.

We are actually evaluating the interest of using Pulse instead of developping a custom (lightweight) engine, for an ECMO simulation.
About that, If you have any feed back to give for this particular usecase, i will really appreciate.

Building Pulse to Wasm by ourself will probably be taken into account for this choice. But if we do, there is no restriction to share the result with the community.

About run the build inside a webbrowser, i was simply talking about starting a local host server on my computer and loading the build produced by Unity ( accessing this local website in Chrome )

I’m not a master neither with emscripten native build chain. I made a custom OpenCV build in wasm using docker few month ago. But the chain was almost pre-settled…

Anyway, i really appreciate your offer to help us in this task. I’m reporting these informations with my manager and I keep you in touch if we decide to dig deeper this option or if we implement a custom ECMO simulator engine by our own.

Best regards,
–Selim

Hello,

To answer your question about ECMO. We do not currently have an ECMO action in Pulse. However, I think there are some workarounds you could try.

  1. You will need to create a patient that has insufficient gas perfusion capabilities. You could do this in Pulse in a few ways.
  • You can give the patient a condition for Impaired Alveolar Exchange Exacerbation with a severity of between 0 and 1 and this will reduce the ability of the patient to exchange gases
  • You can use the Pulmonary Shunt condition with a severity between 0 and 1 to shunt blood away from the gas exchange
  • You could use a combination of these
  1. After you have a patient, you can create a hemorrhage on a compartment to represent the blood leaving to go to the ECMO device.

  2. You can then use IV administration with a blood compound to administer the blood back into the body.

  • for this, you may want to check the blood compound file in the repository and make sure the oxygen and hemoglobin (bound and unbound) have concentrations that represent ECMO. If not, you can adjust the values.

That is my first pass idea to use what already exists for ECMO. We are happy to talk about this further. If you want to set up a time to talk further, you can email me directly at rachel.clipp@kitware.com.

This sounds like a really interesting project. Let me know if you have any further questions.

Thanks,
Rachel

1 Like