The WebGPU API is only accessible from within Durable Objects. The WebGPU API cannot be used from within Workers.
To use the WebGPU API in local development, enable the
webgpu compatibility flags in the
wrangler.toml configuration file of your Durable Object.
compatibility_flags = ["experimental", "webgpu"]
The following subset of the WebGPU API is available from within Durable Objects:
The following subset of the WebGPU API is not yet supported:
- workers-wonnx — Image classification, running on a GPU via the WebGPU API, using the wonnx model inference runtime.