# vtk-wasm webgl crashes with latest vtk-wasm docker images

**URL:** https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492
**Category:** Web
**Tags:** vtkwasm
**Created:** [July 22, 2026, 5:48am UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492 "2026-07-22T05:48:35Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![RaMmer](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@RaMmer](https://discourse.vtk.org/u/RaMmer)
#### Post date: [July 22, 2026, 5:48am UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/1 "2026-07-22T05:48:35Z")

</div>

Hi,

I have been observing regular vtk-wasm crashes with webgl losing context because of bad memory allocation as shown in the below picture.

![image](https://discourse.vtk.org/uploads/default/original/2X/1/1a4d6679015828f1a2cb03952c8345d294afccbb.png)

This was never occurring with the older docker images with version tag 9.6, I am observing this behaviour ever since the vtk 9.7 tags are released.

My setup is similar to how the [Geometry Viewer](https://gitlab.kitware.com/vtk/vtk/-/tree/master/Examples/Emscripten/Cxx/GeometryViewer?ref_type=heads) example is setup, so i tried to replicate the same issue with the official example build.

I have observed that I get the same crash as the above picture when the camera orientation widget is on. If it is off or never used, I don’t see the crash happening.

I am uploading the example code with the sample vtp file to replicate the crash.

I have tested the uploaded code both for the latest version docker image and also the tag `9.6.20260522-05a3785034`, I have observed crash in latest tag but not in the 9.6 version tag.

[example.zip](https://discourse.vtk.org/uploads/short-url/wT65W8TrYZu8IjRQhP8MlarEJsI.zip) (390.7 KB)

After building example, load the vtp file and try to interact more to rotate, pan and zoom for the crash to occur.

Webgpu renderer does not have any crashes, however I face different issues with transparent actors, plane widgets there, I have also observed the webgpu renderer in vtk wasm doesnt render the surfaces generated by the `vtkRuledSurfaceFilter` class and my actors with opacity look so different when compared to the webgl background. I have setup webgpu similar to the GeometryViewer example as above so could you please let me know if there is wrong with the setup or the example? or since webgpu is still in experimental stage these isssues are common?

Thank you

---

<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: [July 22, 2026, 4:48pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/2 "2026-07-22T16:48:04Z")

</div>

this could be happening for similar reasons as [https://gitlab.kitware.com/vtk/vtk/-/work\_items/20121](https://gitlab.kitware.com/vtk/vtk/-/work_items/20121). Maybe the buffer cache keeps growing indefinitely.

---

<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: [July 22, 2026, 6:01pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/3 "2026-07-22T18:01:44Z")

</div>

I downloaded and built your example, cannot reproduce the context lost message. I still think it’s the cache issue. What GPU did you see this on?

---

<div class="post-metadata">

### Author: ![RaMmer](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@RaMmer](https://discourse.vtk.org/u/RaMmer)
#### Post date: [July 22, 2026, 6:08pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/4 "2026-07-22T18:08:09Z")

</div>

Its NVIDIA GeForce RTX 4060 Laptop GPU and I observe this error consistently only when the camera orientation widget is present, when it is turned off It never crashes. Another thing to note is the crash happens only after some interactions with the geometry

---

<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: [July 22, 2026, 6:09pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/5 "2026-07-22T18:09:47Z")

</div>

i’ve same gpu but desktop, and i tried interacting with the scene for upto 2 mins. didnt see that warning. is there another way to reproduce it?

---

<div class="post-metadata">

### Author: ![RaMmer](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@RaMmer](https://discourse.vtk.org/u/RaMmer)
#### Post date: [July 22, 2026, 6:12pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/6 "2026-07-22T18:12:05Z")

</div>

Not really sure, I have this behaviour in NVIDIA RTX 4050 too but that is a laptop GPU as well, I will try to reproduce with desktop GPUs but it will take some time. Apart from that the only thing that comes to mind is to load multiple vtk actors instead of the current example that only loads one vtp.

---

<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: [July 22, 2026, 6:17pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/7 "2026-07-22T18:17:23Z")

</div>

I want to know if this is related to texture buffer cache or not.

So can you add these lines in GeometryViewer::Initialize function? The `wasmOpenGLRenderWindow` is scoped inside an else-if statement.

```auto
auto* state = wasmOpenGLRenderWindow->GetState();
state->SetArrayTextureBufferCache(nullptr);

```

If you still see the crash, then it means the issue lies elsewhere.

---

<div class="post-metadata">

### Author: ![RaMmer](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@RaMmer](https://discourse.vtk.org/u/RaMmer)
#### Post date: [July 22, 2026, 6:28pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/8 "2026-07-22T18:28:33Z")

</div>

Yep, It is on the cache, I no longer see the error when I set the buffer cache to null and see the error again after commenting out these two lines.

---

<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: [July 22, 2026, 6:30pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/9 "2026-07-22T18:30:49Z")

</div>

Okay, that’s good to know. thanks for testing that.

i am working on capping the cache and evicting LRU vtkDataArray from the cache if the total size \>= some reasonable size.

---

<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: [July 22, 2026, 8:41pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/10 "2026-07-22T20:41:28Z")

</div>

[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/13494](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/13494) should address this problem.

---

<div class="post-metadata">

### Author: ![anderson\_f](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/35a633/32.png) [@anderson\_f](https://discourse.vtk.org/u/anderson_f)
#### Post date: [August 2, 2026, 8:57pm UTC](https://discourse.vtk.org/t/vtk-wasm-webgl-crashes-with-latest-vtk-wasm-docker-images/16492/11 "2026-08-02T20:57:45Z")

</div>

The camera widget being the specific trigger is pretty telling though—if it was just a cache issue you’d expect it to blow up eventually no matter what you’re doing. Might be worth checking if that widget’s code changed in 9.7, or if it’s doing something with memory/texture management differently now. And just to rule stuff out, does the crash happen faster if you crank up the geometry complexity? Wondering if it’s more about sustained GPU pressure on a laptop than an outright memory leak.
