After years of development, the Chrome team released WebGPU, which allows high-performance 3D graphics and data-parallel computing on the web.
Posted on Thursday, April 6, 2023
The Chrome team is pleased to announce that WebGPU is now available by default in Chrome 113, currently in the Beta channel. WebGPU is a new web graphics API that offers significant benefits, such as significantly reduced JavaScript effort for the same graphics and more than three times improvement in machine learning model inference. This is possible because of more flexibility in GPU programming and access to advanced features not provided by WebGL.
Initial releases of WebGPU are available on ChromeOS, macOS, and Windows. Support for other platforms will be available later this year.
A new dawn for #Web graphics
WebGPU is a new Web API that exposes modern hardware capabilities and allows rendering and computing operations on the GPU, similar to Direct3D 12, Metal, and Vulkan. Unlike the WebGL family of APIs, WebGPU provides access to more advanced GPU features and provides first-class support for general computing on GPUs. The API was designed with the web platform in mind, with an idiomatic JavaScript API, integration with promises, support for importing videos, and a polished developer experience with plenty of error messages.
This initial release of WebGPU is the building block for future updates and enhancements. The API will provide more advanced graphics capabilities, and developers are encouraged to send requests for additional functionality. The Chrome team also plans to provide deeper access to shader cores to allow for more machine learning optimizations and additional ergonomics in WGSL (WebGPU Shading Language).
WebGPU is the result of a collaborative effort within the W3C's "Web GPU" community group, which includes contributions from major companies such as Mozilla, Apple, Intel, and Microsoft. After six years of development (90 contributors, 2000 commits, 3000 issues) from an initial design in 2017, the first implementation is now available in Chrome and is being supported in Firefox and Safari.
Chromium's Dawn library and Firefox's wgpu library are both available as standalone packages, providing excellent portability and ergonomics layers that abstract the operating system GPU API. Using these libraries in native applications also allows for easier porting to WASM via Emscripten and Rust web-sys.
#The initial release of browser support for
WebGPU is available on ChromeOS devices with Vulkan support, Windows devices with Direct3D 12 support, and Chrome 113 on macOS. Linux, Android, and expanded support for existing platforms are coming soon.
WebGPU is currently a work in progress in Firefox and Safari, in addition to an initial implementation in Chrome.
Library support
Many widely used WebGL libraries are already in the process of implementing WebGPU support or have already done so. This means that using WebGPU may only require making a single line change:
- Babylon.js has full WebGPU support already, see demo.
- PlayCanvas announced initial WebGPU support.
- TensorFlow.js supports WebGPU-optimized versions of most operators.
- Three.js WebGPU support is underway, see examples.
#Resources
WebGPU is a significant technology, and we recommend the following resources to learn more:
- Check out the W3C specifications for WebGPU and WGSL.
- Experiment with samples and explore WGSL with a tour.
- Look at the MDN documentation.
- Read the official explainer and best practices.
- Learn about GPU compute and more.
#Acknowledgments
Many thanks to all Chromium contributors and especially to Intel folks for their invaluable support in making this possible.