---
description: Use the WebGPU API for GPU access from within Durable Objects in local development.
title: WebGPU
image: https://developers.cloudflare.com/og-docs.png
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/durable-objects/llms.txt  
> Use this file to discover all available pages before exploring further.

# WebGPU

Last updated Sep 1, 2026|Copy as Markdown| [View as Markdown](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/durable-objects/api/webgpu/index.md)| [Agent setup](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/agent-setup/)

Caution

The WebGPU API is only available in local development. You cannot deploy Durable Objects to Cloudflare that rely on the WebGPU API. See [Workers AI](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/workers-ai/) for information on running machine learning models on the GPUs in Cloudflare's global network.

The [WebGPU API ↗](https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API) allows you to use the GPU directly from JavaScript.

The WebGPU API is only accessible from within [Durable Objects](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/durable-objects/). You cannot use the WebGPU API from within Workers.

To use the WebGPU API in local development, enable the `experimental` and `webgpu` [compatibility flags](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/workers/configuration/compatibility-flags/) in the [Wrangler configuration file](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/workers/wrangler/configuration/) of your Durable Object.

```plaintext
compatibility_flags = ["experimental", "webgpu"]
```

The following subset of the WebGPU API is available from within Durable Objects:

| API | Supported? | Notes |
| --- | --- | --- |
| [`navigator.gpu` ↗](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/gpu) | ✅ | |
| [`GPU.requestAdapter` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPU/requestAdapter) | ✅ | |
| [`GPUAdapterInfo` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo) | ✅ | |
| [`GPUAdapter` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter) | ✅ | |
| [`GPUBindGroupLayout` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroupLayout) | ✅ | |
| [`GPUBindGroup` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUBindGroup) | ✅ | |
| [`GPUBuffer` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer) | ✅ | |
| [`GPUCommandBuffer` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer) | ✅ | |
| [`GPUCommandEncoder` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder) | ✅ | |
| [`GPUComputePassEncoder` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder) | ✅ | |
| [`GPUComputePipeline` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePipeline) | ✅ | |
| [`GPUComputePipelineError` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineError) | ✅ | |
| [`GPUDevice` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice) | ✅ | |
| [`GPUOutOfMemoryError` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUOutOfMemoryError) | ✅ | |
| [`GPUValidationError` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError) | ✅ | |
| [`GPUInternalError` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUInternalError) | ✅ | |
| [`GPUDeviceLostInfo` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo) | ✅ | |
| [`GPUPipelineLayout` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineLayout) | ✅ | |
| [`GPUQuerySet` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet) | ✅ | |
| [`GPUQueue` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue) | ✅ | |
| [`GPUSampler` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUSampler) | ✅ | |
| [`GPUCompilationMessage` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUCompilationMessage) | ✅ | |
| [`GPUShaderModule` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule) | ✅ | |
| [`GPUSupportedFeatures` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures) | ✅ | |
| [`GPUSupportedLimits` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits) | ✅ | |
| [`GPUMapMode` ↗](https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API#reading_the_results_back_to_javascript) | ✅ | |
| [`GPUShaderStage` ↗](https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API#create_a_bind_group_layout) | ✅ | |
| [`GPUUncapturedErrorEvent` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent) | ✅ | |

The following subset of the WebGPU API is not yet supported:

| API | Supported? | Notes |
| --- | --- | --- |
| [`GPU.getPreferredCanvasFormat` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPU/getPreferredCanvasFormat) |  | |
| [`GPURenderBundle` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundle) |  | |
| [`GPURenderBundleEncoder` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder) |  | |
| [`GPURenderPassEncoder` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder) |  | |
| [`GPURenderPipeline` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPipeline) |  | |
| [`GPUShaderModule` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule) |  | |
| [`GPUTexture` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture) |  | |
| [`GPUTextureView` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureView) |  | |
| [`GPUExternalTexture` ↗](https://developer.mozilla.org/en-US/docs/Web/API/GPUExternalTexture) |  | |

## Examples

- [workers-wonnx ↗](https://github.com/cloudflare/workers-wonnx/) — Image classification, running on a GPU via the WebGPU API, using the [wonnx ↗](https://github.com/webonnx/wonnx) model inference runtime.

Was this helpful?

YesNo

## On this page

[![](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://sync-log-fields-2026-09-01.previews.developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/durable-objects/api/webgpu/#page","headline":"WebGPU · Cloudflare Durable Objects docs","description":"Use the WebGPU API for GPU access from within Durable Objects in local development.","url":"https://developers.cloudflare.com/durable-objects/api/webgpu/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","dateModified":"2026-09-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
