TECHNOLOGY

WebGPU device loss invalidates the resource graph, not just one request

In this article
THE QUICK TAKE

A new device does not revive old buffers or pipelines; recover from retained application state and qualify the new resource graph before accepting work.

Retrying the same request can retain dead resources

A browser assistant’s generation stops after device loss. Its retry handler obtains a new device, then reuses the old weights buffer, pipeline and cached request bindings. The model download remains present, but the executable resource graph belongs to the lost device. Retrying only the last command does not repair that ownership boundary. Mark the interrupted request explicitly and distinguish retained application data from GPU objects that must be rebuilt before another request can produce a trustworthy result.

Loss has a device-wide ownership scope

The WebGPU specification makes a device the owner of its created objects and makes those objects unusable when the device is lost or destroyed. Listen for device.lost as a lifetime event rather than expecting ordinary validation-error reporting to describe every consequence. A normal-looking return from a later API call is not sufficient evidence of useful execution after loss. The application needs a coherent device-generation boundary across buffers, bind groups, pipelines and any runtime state referring to them.

Rebuild from application-owned evidence

Retain an explicit reconstruction description: model artifact identity, supported execution configuration and the inputs or history needed to restart an interrupted task under the application’s policy. Downloaded bytes may be reusable if still valid and available; GPU allocations are another category. Do not claim that reacquisition preserves an in-flight decoder cache or resumes from an arbitrary shader instruction. Whether to restart generation or preserve a completed prefix is a product-level correctness decision that needs a defined output contract.

Discovery can fail independently of reconstruction

The GPUWeb error-handling design explains restarting discovery after loss. Treat that document as design context alongside the current normative specification. A new adapter or device is not guaranteed, and its supported contract must be negotiated again. Use bounded, observable recovery with a truthful unavailable state rather than an endless loop promising imminent success. Recovery to another supported backend is a separate execution path whose input, numerical and privacy requirements still need review.

Test the application boundary without claiming every failure mode

A proposed fixture interrupts a disposable device lifecycle and checks that old-generation work cannot publish into a new request. Verify full resource reconstruction and a minimal known output before restoring readiness. Deliberate device destruction can test application ownership handling, but does not reproduce every driver or operating-system loss mechanism. Acceptance should record that limitation. No device was destroyed or GPU failure reproduced here; the procedure describes a controlled software-lifetime check, not a measured recovery rate.

Separate cache optimization from lifetime recovery

WebGPU allocation-cache behavior concerns reuse while resources remain valid. Browser budget audits concern capacity evidence. Device loss changes the prerequisite for both. Report retained artifacts, newly created resources, interrupted output and verified readiness independently. A browser assistant can recover responsibly without claiming that downloaded weights make GPU lifetime irrelevant or that a successful new-device request proves the previous generation continued intact.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles