WebGPU
WebGPU API ↗を使用すると、JavaScriptから直接GPUを利用できます。
WebGPU APIはDurable Objects内からのみアクセス可能です。Workers内からWebGPU APIを使用することはできません。
ローカル開発でWebGPU APIを使用するには、Durable Objectのwrangler.toml設定ファイルでexperimentalおよびwebgpuの互換性フラグを有効にしてください。
compatibility_flags = ["experimental", "webgpu"]以下のWebGPU APIのサブセットはDurable Objects内で利用可能です:
以下のWebGPU APIのサブセットはまだサポートされていません:
| API | Supported? | Notes |
|---|---|---|
GPU.getPreferredCanvasFormat ↗ | ||
GPURenderBundle ↗ | ||
GPURenderBundleEncoder ↗ | ||
GPURenderPassEncoder ↗ | ||
GPURenderPipeline ↗ | ||
GPUShaderModule ↗ | ||
GPUTexture ↗ | ||
GPUTextureView ↗ | ||
GPUExternalTexture ↗ |
- workers-wonnx ↗ — WebGPU APIを介してGPU上で実行される画像分類、wonnx ↗モデル推論ランタイムを使用。