# Help with WebGPU setup & test

**URL:** https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256
**Category:** Support
**Tags:** webgpu
**Created:** [February 10, 2025, 3:25pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256 "2025-02-10T15:25:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [February 10, 2025, 3:25pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/1 "2025-02-10T15:25:16Z")

</div>

Hi @jaswantp,

I am currently trying out WebGPU with VTK following the guide here [https://docs.vtk.org/en/latest/modules/vtk-modules/Rendering/WebGPU/README.html](https://docs.vtk.org/en/latest/modules/vtk-modules/Rendering/WebGPU/README.html)

I was able to setup dawn & build VTK using it. However I’m not quite sure of how to know if WebGPU is actually functioning under the hood. Note that I’m testing with a project that previously used ‘OpenGL’ as its `VTK_RENDERING_BACKEND`.

I would like to know

- How can I check to see if WebGPU is running as opposed to OpenGL
- besides the steps in the aforementioned guide above, are there specific flags that need be set in make when building VTK using dawn, perhaps there are things missing in my setup.
- I am running on a macOS, and previously used the following in my cmake `set (VTK_RENDERING_BACKEND "OpenGL2" )`, would the following be sufficient.?

> set (VTK\_ENABLE\_WEBGPU 1 CACHE BOOL )  
> set (VTK\_GRAPHICS\_BACKEND “WEBGPU”)

---

<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: [February 10, 2025, 3:28pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/2 "2025-02-10T15:28:07Z")

</div>

Hi @Seun

set `VTK_GRAPHICS_BACKEND` equal to “WEBGPU” in your shell environment, not in the cmake.

---

<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: [February 10, 2025, 3:29pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/3 "2025-02-10T15:29:14Z")

</div>

> How can I check to see if WebGPU is running as opposed to OpenGL

> - How can I check to see if WebGPU is running as opposed to OpenGL

VTK does not yet have a webgpu render window using Cocoa. It is being devloped.  
Normally, VTK will display Metal or Vulkan or D3D12 in the window title.

---

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [February 10, 2025, 3:30pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/4 "2025-02-10T15:30:13Z")

</div>

Thanks for the quick response, I’ll give this a shot.

---

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [February 10, 2025, 3:33pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/5 "2025-02-10T15:33:15Z")

</div>

Since rendering with cocoa isn’t ready yet, is it safe to assume that Metal is. If this is the case, does that mean that I’ll have to set

> set (VTK\_RENDERING\_BACKEND “Metal” )

---

<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: [February 10, 2025, 3:38pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/6 "2025-02-10T15:38:43Z")

</div>

Hi @Seun,

It should be sufficient for you to

1. `set (VTK_ENABLE_WEBGPU 1 CACHE BOOL )` in your CMake or pass `-DVTK_ENABLE_WEBGPU:BOOL=ON` when building VTK.
2. Set the environment variable `VTK_GRAPHICS_BACKEND` = “WEBGPU”. The other alternative is “OPENGL”.

To clarify, Cocoa is a window framework which provides a connection to Metal or OpenGL in macOS. If you’re familiar with linux, Cocoa serves a similar purpose to X or wayland.

Please ignore the cmake setting `VTK_RENDERING_BACKEND`. We don’t use that anymore as far as webgpu is concerned.

Even though the window stuff is a work-in-progress, you can still get a taste of webgpu compute pipelines because those do not require a window - [https://www.kitware.com/webgpu-compute-api-in-vtk/](https://www.kitware.com/webgpu-compute-api-in-vtk/)

---

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [February 10, 2025, 3:43pm UTC](https://discourse.vtk.org/t/help-with-webgpu-setup-test/15256/7 "2025-02-10T15:43:41Z")

</div>

Solid! I have the 2 bullet points setup, I’ll ignore that cmake setting and take a look at the link to get a feel for it, thanks a lot for the clarification.
