# vtkWASM

**URL:** <https://discourse.vtk.org/t/vtkwasm/13505>\
**Category:** Development\
**Created:** [March 11, 2024, 1:50pm UTC](https://discourse.vtk.org/t/vtkwasm/13505 "2024-03-11T13:50:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)\
**Post date:** [March 11, 2024, 1:50pm UTC](https://discourse.vtk.org/t/vtkwasm/13505/1 "2024-03-11T13:50:29Z")

</div>

I am trying to compile vtk-WASM on Windows. The description here [Building using emscripten for WebAssembly - VTK documentation](https://docs.vtk.org/en/latest/advanced/build_wasm_emscripten.html) is for sure not working fully on Windows. I get errors like

`C:/VTK/VTK-9.3.0/Rendering/WebGPU/vtkWebGPURenderWindow.cxx:164:16: error: no member named 'SetDeviceLostCallback' in 'wgpu::Device`

At home, I managed to compile vtk-wasm using the old VTK 9.2.6 (Debian 12). I can see that the weekly vtk-wasm docker build fails. What is the recommended way to compile vtk-wasm yourself. Should I replicated the Docker build scripts that you have made, @jaswantp

The thing is I am developing some new native widgets that I would like to expose in a vtk-wasm setup.

Thanks in advance  
Jens Munk

---

<div class="post-metadata">

**Author:** ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)\
**Post date:** [March 11, 2024, 1:52pm UTC](https://discourse.vtk.org/t/vtkwasm/13505/2 "2024-03-11T13:52:21Z")

</div>

What version of emscripten you use? The docker build fix is in the works. Try disabling webgpu with -DVTK\_ENABLE\_WEBGPU=OFF

---

<div class="post-metadata">

**Author:** ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)\
**Post date:** [March 11, 2024, 1:53pm UTC](https://discourse.vtk.org/t/vtkwasm/13505/3 "2024-03-11T13:53:32Z")

</div>

> [@jaswantp](#):
>
> x is in the works. Tr

I use `emsdk active latest`. This is probably too new. I will try disabling the `WEBGPU`. We only the need wasm anyway.

A little strange. Adding `-DVTK_ENABLE_WEBGPU=OFF` to the command line added `-DVTK_ENABLE_WEBGPU` to the command line. I only deleted the `CMakeCache.txt`. Will try to delete the full output folder.

Will try ` -DVTK_ENABLE_WEBGPU:BOOL=OFF`. Could be the `emcmake.bat` that is not propagating arguments correctly.

---

<div class="post-metadata">

**Author:** ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)\
**Post date:** [March 11, 2024, 2:30pm UTC](https://discourse.vtk.org/t/vtkwasm/13505/4 "2024-03-11T14:30:25Z")

</div>

Hi @jaswantp

My emsdk is the following. `emsdk activate latest`

```auto
Resolving SDK alias 'latest' to '3.1.55'
Resolving SDK version '3.1.55' to 'sdk-releases-f5557e3b7166d05bddb5977e363ec48cd06e9d32-64bit'
Setting the following tools as active:
   node-16.20.0-64bit
   python-3.9.2-nuget-64bit
   java-8.152-64bit
   releases-f5557e3b7166d05bddb5977e363ec48cd06e9d32-64bit

```

Which version are you current using on the `vtk-wasm` docker builds?

The same story, `em++.bat -DVTK_ENABLE_WEBGPU`. WebGPU is enabled even though I actively disable it.

After adding  
`VTK_MODULE_ENABLE_VTK_RenderingWebGPU=NO`  
everything compiles.

I think the best solution is to find a version emsdk that works together with VTK master

---

<div class="post-metadata">

**Author:** ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)\
**Post date:** [March 11, 2024, 3:20pm UTC](https://discourse.vtk.org/t/vtkwasm/13505/5 "2024-03-11T15:20:55Z")

</div>

> Which version are you current using on the vtk-wasm docker builds?

VTK CI and that docker build use 3.1.45
