WebGPU
Modern GPU access from the browser — compute shaders and fast graphics that make client-side medical imaging and on-device ML practical.
In one line
WebGPU is the successor to WebGL: a browser API exposing modern GPU pipelines — including general-purpose compute shaders, not just triangles — with safety and portability across vendors.
The problem it solves
The GPU is the workhorse for both 3D rendering and the matrix math behind ML — but the web's old WebGL was graphics-only and dated, forcing developers to abuse rendering tricks to do computation. WebGPU exposes the modern GPU properly, with compute as a first-class citizen, so heavy visual and numerical work can run in a browser tab at speed.
How it works
- JavaScript (or WASM) creates a device, uploads buffers/textures, and dispatches render or compute pipelines written in WGSL (the shading language).
- Unlike WebGL's graphics-only lineage, compute is first-class — matrix multiplication, the heart of neural-network inference, runs natively on the GPU.
- Browser ML runtimes increasingly use it as their fast backend.
Where it shows up in digital health
- Client-side volume rendering of CT/MRI in zero-install viewers (pairs with DICOM decoding in WASM).
- Real-time image processing for endoscopy/ultrasound streams.
- Privacy-preserving on-device inference — running a model on patient data in the browser so the data never leaves the machine (a powerful complement to edge/federated approaches).
Common pitfalls
- Uneven availability — still maturing across browsers/devices; feature-detect and fall back (to WebGL or CPU).
- Driver/vendor quirks — GPU behaviour varies; test across hardware.
- Assuming GPU = always faster — small workloads can be slower once upload/download overhead is counted.
Key takeaways
- WebGPU = modern GPU access in the browser, with compute shaders, not just graphics.
- Enables zero-install medical-image rendering and on-device ML inference.
- On-device inference keeps patient data local — a privacy win.
- Still emerging — feature-detect and degrade gracefully.
Check your recall
0 of 2 recalledActive recall beats re-reading — try to answer, then reveal.
What does WebGPU add over WebGL?
A privacy-relevant use of WebGPU in health?