Skip to content

Handling of GPU crashes on wasm: wgpu panics on WebGL2 but continues on WebGPU #5545

@maximetinu

Description

@maximetinu

Hi !

I am experiencing inconsistent behavior between WebGL2 and WebGPU in the event of a GPU crash, and I'm unsure if it's expected

When a GPU crash occurs on wasm, wgpu apps using WebGPU keep working as usual, just without graphics, and the console logs a warning like ⚠️ GPU connection lost

However, wgpu apps using WebGL2 panic, usually by an Error in Queue::submit: Validation Error. Caused by: Not enough memory left (the actual panic depends on the reason they lost access to the GPU I presume.

Repro steps

  • This can can be reproduced using any wasm examples that support both WebGL2 and WebGPU
  • In Google Chrome, a GPU Crash can be simulated by writing chrome://gpucrash in the address bar (see debug section at chrome://about/ for reference)

I recorded a couple of videos showcasing this behaviour in the "Shadow" example of the repo, running on wasm with the command from the readme cargo xtask run-wasm --bin wgpu-examples ...

Describe the solution you'd like
So, in other web game engines using webgl2 rendering, like Babylon.js, they can keep working without graphics after a fatal error like this happens, and they can even recover from it. That means that, if such web game engines were using wgpu and webgpu, they would not have to implement this by themselves, which is great.

In the case of Babylon.js:

this is where they got this feature request:

and this is the PR that implemented it:

So, my question is:

Can wgpu implement a similar resilience for WebGL2 as well, or is this behaviour an inherent limitation of lower level actors like glow or WebGL2 itself?

If the latter, feel free to close the issue as won't do. Thx! 😄

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions