WebGPU

WebGPU is a modern, high-performance API that provides low-level access to modern Graphics Processing Unit (GPU) hardware directly from web browsers. This revolutionary API allows web applications to harness the incredible power of GPUs to perform tasks such as 3D rendering, image processing, physics simulation, machine learning, and more. This detailed guide aims to provide a comprehensive overview of WebGPU, its remarkable capabilities, and how you can effectively utilize it in your projects. We will also delve into practical use-cases and provide a step-by-step guide on setting up and getting started with the WebGPU API.

General
AuthorW3C
Repositoryhttps://github.com/gpuweb/gpuweb
TypeGraphics and Compute API

What is WebGPU and Why Does it Matter?

Historically, web browsers have relied on APIs such as WebGL and WebGL2 to gain access to GPU hardware. While these APIs have certainly been useful, they are built on the OpenGL ES graphics API which was introduced in the early 90s. With the rapid evolution of GPU hardware and the advent of new architectures like Vulkan and DirectX 12, the WebGL framework has become outdated.

Enter WebGPU, a modern alternative specifically designed to expose a GPU programming model tailored for the web. WebGPU aims to replace WebGL by offering an array of exciting features and improvements, including:

  • Cleaner API design free of legacy cruft.
  • Improved support for modern GPU features such as compute shaders.
  • Enhanced multi-threading and synchronization capabilities.
  • More refined control over GPU resources.
  • Wider browser support as WebGL gradually falls behind.

WebGPU holds immense potential for high-performance applications like 3D games, augmented reality/virtual reality (AR/VR), computer vision, and other graphics/compute-intensive tasks, by unlocking significant performance and capability improvements on the web. Even for simpler tasks like 2D rendering, the API design of WebGPU offers a more intuitive experience for developers familiar with modern best practices.

Current Browser Support and Status for WebGPU

Despite its numerous advantages, WebGPU support is still in its early stages across major browsers. Here's the current status of WebGPU support in various browsers as of mid-2023:

  • Chrome: Enabled by default since Chrome 102, offering the most complete WebGPU experience.
  • Firefox: Partial support enabled behind a flag since Firefox 99, with full support still under development.
  • Safari: No support yet.
  • Edge: The implementation of WebGPU support is under consideration.

Additionally, JavaScript polyfill libraries like gpuweb and dawn aim to provide WebGPU support by translating calls to WebGL/WebGL2. While these libraries are useful for development, their performance and capabilities are somewhat limited.

You can use the demo page on the webgpu.io site to test whether your browser supports WebGPU. However, as the technology landscape is evolving rapidly, expect to see broader adoption of WebGPU across various browsers in the near future.

Understanding the Core Concepts of WebGPU

To leverage the WebGPU API effectively, it's essential to grasp a few key concepts:

  • GPUAdapter: This represents a physical GPU device on the system.
  • GPUDevice: This is a logical device created from a GPUAdapter and manages resource creation and ownership.
  • GPUBuffer: This is a buffer of data (vertices, textures, etc.) that resides in GPU memory.
  • GPUTexture: This is image data (textures, render targets) that resides in GPU memory.
  • GPUSampler: This configures how textures are sampled.
  • GPUShaderModule: This is compiled shader code.
  • GPUBindGroup: This is a collection of resources that are bound together.
  • GPUPipeline: This is a collection of shaders and fixed function states defining a complete GPU pipeline.
  • GPUCommandEncoder: This records commands like draw calls that get submitted to the GPU.
  • GPUCommandBuffer: This is a bundled list of recorded commands for execution.
  • GPUQueue: This submits command buffers for execution on the GPU.

While this may seem overwhelming initially, as you work through examples, these concepts will become more comprehensible. The general flow is to create resources like buffers and textures in GPU memory, assemble these resources into pipelines, record commands into command buffers that reference the resources and pipelines, and then submit these command buffers to queues for execution.

Diving into WebGPU Use Case Examples

The power of WebGPU has already begun to manifest in a range of applications, demonstrating its potential for future development. Here are some compelling examples of how WebGPU has been used:

  • WebLLM + GitHub + NPM Package: A web version of a Language Model that uses WebGPU, available as an npm package.
  • WebSD: This is a web version of Stable Diffusion, an AI for generating images from text, which utilizes WebGPU.

These examples illustrate the potential of WebGPU in enabling more efficient and high-performance web applications, pushing the boundaries of what's possible on the web.

How to Set Up WebGPU: A Quick Start Guide

WebGPU is a new web standard for performing high-performance graphics and computations on the web. It allows developers to leverage the GPU directly from JavaScript without going through intermediate APIs like WebGL.

Setting up WebGPU requires a few steps:

Use a Browser with WebGPU Support

As of now, WebGPU support is still limited to certain browsers. Your options are:

  • Chrome Canary with the --enable-unsafe-webgpu flag enabled
  • Firefox Nightly
  • Safari Technology Preview

So you'll need to download and install one of these browser versions to start using WebGPU.

Detect WebGPU Support

Once you have a compatible browser, you can check for WebGPU support by:

if ('gpu' in navigator) {
  // WebGPU is supported!
} else {
  // WebGPU is not supported
}

This checks if the gpu object exists in navigator, which indicates WebGPU support.

Request a GPU Device

To start using WebGPU, you need to get a GPU device object:

async function initWebGPU() {
  // Request adapter
  const adapter = await navigator.gpu.requestAdapter();
  
  // Request device
  const device = await adapter.requestDevice();
}

This asynchronously requests the GPU adapter and then requests the actual WebGPU device.

Start Building WebGPU Code

With the WebGPU device, you can now start writing WebGPU code to perform operations like:

  • Creating buffers and textures
  • Building pipelines and bind groups
  • Running compute kernels
  • Rendering to a canvas

That's the basic setup! From here you can start writing WebGPU code to leverage the GPU.

WebGPU - Essential Resources

To better understand and utilize WebGPU effectively in your projects, here are some useful resources:

Conclusion

In conclusion, the advent of WebGPU has revolutionized the way we think about web applications and their capabilities. It's an exciting time to be a developer as we unlock more powerful and efficient ways to leverage GPU power on the web. With WebGPU, the web isn't just about browsing anymore, but an evolving platform for high-performance computing and graphics rendering. It's time to embrace the power of WebGPU and take our web applications to the next level!

WebGPU top builders

Explore the top contributors showcasing the highest number of WebGPU app submissions within our community.

WebGPU AI technology page Hackathon projects

Discover innovative solutions crafted with WebGPU, developed by our community members during our engaging hackathons.

 ProfitLens-AI — Shop Health Checker

ProfitLens-AI — Shop Health Checker

Small online shops drown in raw numbers — price, reviews, sales, refunds — but never get an answer to the only question that matters: "Is my shop healthy, and what should I fix first?" ProfitLens-AI answers it in one click. Paste in a shop's metrics, and the app returns a structured Health Report: an overall score from 0-100, a verdict badge (healthy / watch / critical), six weighted dimension scores (price competitiveness, review quality, 30-day sales trend, service, listing completeness, activity), a plain-language summary, and prioritized recommendations. The architecture is a Next.js dashboard feeding a deterministic scoring engine (rubric v0.2, fully auditable, validated 10/10 against the organizer's answer key). On top of that skeleton sits a dual-engine prose layer: when an AMD GPU endpoint is available, Qwen3-4B served by vLLM generates the summary, per-dimension comments and recommendations; when it is unreachable, the app transparently falls back to built-in rule-based prose with identical scores — it never breaks. The AI runs entirely on our own hardware: Qwen/Qwen3-4B served by vLLM (OpenAI-compatible API) on an AMD Radeon Pro W7900D (gfx1100, RDNA3) on the AMD Anrui ROCm notebook instance. Every report triggers real GPU inference — verifiable live with rocm-smi showing utilization and VRAM spikes on each request. Try it now: https://profit-lens-ai.vercel.app (demo account [email protected] / demo1234, pre-loaded with ten test shops). Source: https://github.com/zxy-666666Max/ProfitLens-AI

Trycanari

Trycanari

AI agents now do real things — move money, read private data, call tools. The problem is they can be prompt-injected: tricked by cleverly worded text into doing something they were told never to do. Real wallets have been drained this way. Teams building these agents have no cheap, continuous way to find those holes. Canari is a bug-bounty marketplace built specifically for AI agents. A sponsor lists an agent and plants canaries — tripwires like “this secret must never appear in output” or “this tool must never be called with these arguments.” They lock a reward in escrow. Hunters (people or automated attacker agents) submit attacks. Your system replays each attack against a sandboxed copy several times, and a deterministic judge checks whether a canary tripped. If it did in at least 3 of 5 runs, the payout fires automatically and the sponsor gets the transcript as a regression test. Three things make it distinctive: no triage (a canary tripped or it didn’t, so nobody argues about whether a report is valid), self-serve (a two-person team can open a bounty in minutes), and private settlement (payouts are shielded on Zcash, so outsiders can’t see that an agent was broken, how often, or who was paid). How it works, as one loop Sponsor defines the target (prompt, tools, model) → plants canaries → funds the reward → it goes live → hunters attack → the harness replays each attack on a fresh sandboxed copy → the judge checks for a tripped canary → on a verified break, the reward auto-pays and the bounty pauses → sponsor gets the transcript, patches the agent, and the old attack is replayed to confirm it now fails → bounty re-arms.

Goose! Goose! Cook! - Your Voice Sous-Chef

Goose! Goose! Cook! - Your Voice Sous-Chef

Goose! Goose! Cook! treats a recipe as a graph of steps and a kitchen as a set of limited resources (burners, woks, pots, people). It works out the fastest plan for what you actually have, then runs that plan live, by voice, so nobody has to touch a screen with wet, garlicky hands. Say what you want for dinner and Goose builds the whole session from there: an LLM drafts a step graph per dish, a second model reviews it, and each cook reads a line aloud to bind their voice. The plan itself comes from a branch-and-bound solver, not just a checklist, and it plays out one of two ways. Co-op is one shared timeline, replanned live every time someone says "done." Versus deals out an opening hand and turns the rest of dinner into a real game: steps are up for grabs, cooks claim them by voice, and points are scored by difficulty. Either way it ends in a keepsake summary card with a photo and the night's stats. AssemblyAI's Streaming STT runs the entire pipeline end to end, from the first conversation through the live cook to the summary card, so every stage is navigable hands-free. Mid-cook, "Goose, done with the onion" goes through the LLM Gateway to a tool-calling agent (GPT- 4.1), and the server checks every proposed action against the live run before it applies, so a bad guess never corrupts the plan. Gemini and Claude split the rest of the gateway's work: drafting each dish's step graph, reviewing it, writing the closing summary. A local keyword grammar keeps commands working if the agent itself is slow or down. Goose replies with a local Kokoro TTS voice on WebGPU, with a Web Speech fallback, and an optional speaker-ID sidecar tells two cooks apart on one shared mic. It starts from three enrolled lines and keeps learning from turns it's already sure about, so it gets better as the dinner goes on.

Askolo: Your Voice-Powered Life Operating System

Askolo: Your Voice-Powered Life Operating System

Askolo started from a simple frustration: managing your life shouldn't mean juggling ten apps that don't talk to each other. Most productivity tools solve one problem well and ignore everything else. Askolo takes a different position: your calendar, habits, goals, tasks, and notes belong together, and the AI that helps you should see all of them at once. The voice layer removes the overhead of managing the system itself. You talk, Askolo listens, and things get done. Create a task, reschedule a meeting, log a habit, and capture a thought, all through a normal conversation. That's not a novelty feature; it's the whole point. Every morning, Askolo gives you a spoken briefing: what's due, what's slipping, and what actually deserves your attention today. Voice notes get transcribed and organized automatically, so nothing gets lost between the thought and the task. Where Askolo differs from a standard productivity app is the AI coach. It doesn't just surface reminders. It connects your daily habits to your longer-term goals, spots patterns in what you're consistently missing, and adjusts your plan based on how things are actually going, not how you intended them to go. That context, spanning your whole life rather than one slice of it, is what makes the coaching useful rather than generic. Most AI assistants are built around a single domain: your inbox, your calendar, and your to-do list. Askolo is built around you. When your goals shift, your plan shifts. When your schedule tightens, your priorities get re-evaluated. The system carries the coordination load that usually lives in your head and quietly drains your focus. Askolo is under active development. The core experience, voice interaction, unified workspace, and AI coaching are functional and reflect a straightforward bet: the best productivity tool is one that understands the full picture.