Enabling WebGPU

Hello, I am writing an application with babylonjs and I am using React and @babylon/core module. I’d like to enable webGPU for my application but I can’t seem to access it’s constructor from the module. Is there a seperate module for this or is it not yet out for npm users? I am using 4.1.0 which I believe is the latest version as per this post of @babylon/core.

the latest version is 4.2 preview where we are actively developing webgpu (@Evgeni_Popov)


ahhh I see. Let me try this preview version then in a test branch.

@Deltakosh I am now using 4.2.0-beta.5 but still same issue, can’t seem to have access to the constructor when I try

const engine = new BABYLON.WebGPUEngine(canvas); // WebGPUEngine is not a constructor

Getting this:

"export 'WebGPUEngine' (imported as 'BABYLON') was not found in '@babylonjs/core'

Actually WebGPU is not exposed in the master branch yet, you will need to get the repo and work with the WebGPU branch to be able to test it. Note however that it’s a work in progress and some important features are not supported yet (like render target texture), but it’s coming!

We should merge the WebGPU branch into the master branch a few time after 4.2 is released.

1 Like

Hey @Evgeni_Popov thanks for the reply, I have tried to install with the WebGPU branch using npm install BabylonJS/Babylon.js#WebGPU. I find that the babylonjs script there doesn’t have the WebGPU constructor too. so when I tried to fork the branch and run a build, It fails with loads of error messages. I still haven’t figured out how to get a test of this webGPU feature.

It’s not available with NPM, if you want to test WebGPU you must get the Babylon repository (Start Contributing to Babylon.js - Babylon.js Documentation) and work with the WebGPU branch.

I would advise to wait after 4.2 is released, as we will merge the code into master and it will be a lot easier to test. Also, we will have more features working at that time.

1 Like

@DANIEL_S you can not npm i from our repo directly.

If you want to try out the best is to test directly by building the webgpu branch locally and then using the build output. This will soon not be necessary :slight_smile: right after 4.2

1 Like

Anyone have an update on when webGPU will be merged?

It will come just after 4.2 is released (normally a few week(s) after).

To be honest, this is not what I was looking for, as this will further delay things on our side, I was under the impression, that WebGPU will be merged before 4.2, at least as a Beta test, but now a few weeks after. This does through a spanner in the works. We were not looking for a stable version but just something we can test early! any ideas?

We need to wait after the release because there are too many changes, we could break some things and it’s not what we want so close to the release.

If you really want to start testing WebGPU you can download the repository and work with the WebGPU branch, I’m afraid there’s no other choices.


Thank you, no problem, I was just having a stress! :wink: but also, I do value your stability :slight_smile: , so rather have this than a mess of a code base and end up with a cluster f’ck, thank you and looking forward to 4.2 and webGPU

Hi, is WebGPU now part of the main branch? i mean even in Alpha? just as we need to do some tests!


Yes it is, since yesterday :slight_smile:

We are currently performing some testing and monitoring to verify that the WebGL engine is still working as expected (the PR has affected a lot of files) and we are going to add support for WebGPU in the Playground afterwards. There are some caveats, though, that we will detail when we do the announcement.


Perfect timing hahha :slight_smile: ok we will wait for more news, then we will deploy this to a separate branch we have, and see if the WebGPU version works as expected in our application :slight_smile:

1 Like

Hi guys,

Hows the WebGPU thing coming along? any updates? is it merged into master yet so we can test it?

Yes it is merged in the main branch, we did not advertise it yet because we need to do a bit of optimization first but it is usable if you want to test it!

1 Like

Thank you @Evgeni_Popov great stuff, I will do some tests and see if it will work in our application