Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle device lost on WebGPU #6171

Open
mvaligursky opened this issue Mar 15, 2024 · 4 comments
Open

Handle device lost on WebGPU #6171

mvaligursky opened this issue Mar 15, 2024 · 4 comments
Assignees
Labels
area: graphics Graphics related issue enhancement

Comments

@mvaligursky
Copy link
Contributor

related: #6170

  • We need to handle the device lost by properly destroying device objects, and recreating them when the device is restored.
  • This is complicated as I'm not sure how to trigger a device lost for testing
  • initially we need to at least handle this in the examples / application:
	pc.app.graphicsDevice.loseContext();
  	pc.app.graphicsDevice.restoreContext();

Which is the same code that executes during the context lost / restored, but without it actually being lost.

@mvaligursky
Copy link
Contributor Author

an attempt: #7032

@LeXXik
Copy link
Contributor

LeXXik commented Oct 14, 2024

You can lose the device, if you launch re-installing video drivers. Here, I am running an empty project with a single script (1.74.0) and launching drivers re-install from nvidia experience:

this.app.graphicsDevice.wgpu.lost.then((info) => { console.log(info) });

image

@mvaligursky
Copy link
Contributor Author

Lovely way :)
Not as useful on Mac.

I've seen chrome://gpucrash/ being mentioned too .. but after that I seem to not be able to get new device / adapter, at least on Mac, till I reload the tab.

@mvaligursky
Copy link
Contributor Author

something to read when I try again.
https://toji.dev/webgpu-best-practices/device-loss.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue enhancement
Projects
None yet
Development

No branches or pull requests

2 participants