wgpudawn
WebGPU for Python, on Dawn.
See it run in your browser: the pygfx examples, live, on wgpudawn.
wgpudawn is the API of wgpu-py with
Dawn (Google's WebGPU implementation, the one in Chrome) as its backend,
instead of wgpu-native.
What this project is. It only aims to provide a Dawn reference implementation that follows the great architecture and design of wgpu-py, from the pygfx/wgpu-py project. All credit for the API, the design and most of the code goes to its authors. This project is maintained by AI agents instead of humans: the code, the ports of new wgpu-py releases and the releases themselves are made by an agent (see Versions and releases).
It is a standalone package:
- The wheels contain Dawn (statically linked); there is nothing else to install apart from the GPU drivers of the system.
- It is co-installable with wgpu-py: it only provides the
wgpudawnmodule. - One wheel per platform works for all supported Python versions (abi3).
pip install wgpudawn
import wgpudawn as wgpu
adapter = wgpu.gpu.request_adapter_sync(power_preference="high-performance")
device = adapter.request_device_sync()
print(adapter.summary)
The API is documented at https://wgpu-py.readthedocs.io; replace wgpu by
wgpudawn. wgpudawn.wgpu_py_version is the version of wgpu-py that this
version of wgpudawn mirrors.
In the browser
The gallery runs the examples of pygfx in your browser, on wgpudawn: Pyodide, the Pyodide wheel of wgpudawn (which uses the WebGPU of the browser through Dawn's Emdawnwebgpu) and pygfx (for now with a few fixes on top, see issue 2). It needs a browser with WebGPU and JSPI, such as a recent Chrome or Edge. Every example is run in headless Chrome when the site is built; the gallery shows what works and what does not.
Status
Early. The wgpu-py tests that do not depend on wgpu-native specifics pass, and so does the unit test suite of pygfx (see below).
Differences with wgpu-py:
- Shaders are compiled by Tint, which follows the WGSL spec strictly; naga (wgpu-native) accepts some shaders that Tint rejects.
- No wgpu-native extras (
wgpu.backends.wgpu_native.extras: GLSL shaders, pipeline statistics queries, multi-draw-indirect-count, ...), and no wgpu-native specific features and limits. Dawn has its own non-standard features, e.g.unorm16-texture-formats. - Devices always have the
core-features-and-limitsfeature. - The backends are Vulkan (Linux, Windows), Metal (macOS), and D3D12/D3D11 (Windows). There is no OpenGL backend.
- Validation errors are raised at the call that causes them, and
push_error_scope()/pop_error_scope_async(),get_compilation_info_async()and the device-lost promise are implemented.
Libraries that import wgpu
Libraries such as pygfx and rendercanvas import wgpu by name, so by default
they use wgpu-py, also when wgpudawn is installed. To run them on wgpudawn,
opt in before anything imports wgpu:
import wgpudawn
wgpudawn.install_as_wgpu()
import pygfx # `import wgpu` now gives wgpudawn, in this process
After that, wgpu and its submodules are wgpudawn's (the same module
objects), and wgpu.__version__ is wgpudawn.wgpu_py_version. wgpudawn never
installs a wgpu module on disk, so it stays co-installable with wgpu-py.
CI runs the unit tests of pygfx this way, using tests/wgpu_shim: a test-only
package named wgpu that calls install_as_wgpu(), and that takes the place
of wgpu-py so that pygfx's requirement on it is satisfied. It is not part of
the wgpudawn package.
Platforms
Wheels are built for:
| x86-64 | arm64 | |
|---|---|---|
| Linux (glibc >= 2.28) | yes | yes (includes Raspberry Pi 4/5 with a 64-bit OS) |
| macOS (>= 11) | yes | yes |
| Windows | yes | yes |
There is also a wheel for Pyodide (Pyodide 314, i.e.
Python 3.14): there, the same bindings run on the WebGPU of the browser, via
Dawn's Emdawnwebgpu. The gallery above uses it; website/ builds it.
Building from source
Dawn is not downloaded or built by pip install; build it first:
python tools/build_dawn.py --prefix /path/to/dawn # needs git, cmake, ninja, a C++20 compiler
DAWN_PREFIX=/path/to/dawn pip install -e ".[dev]"
pip install ./tests/wgpu_shim # optional: for the tests that use rendercanvas
pytest tests codegen
On Linux this needs the headers of X11, xcb and Wayland.
tools/build_dawn_manylinux.sh does the same in the manylinux image that the
wheels are built in. DAWN_PREFIX can also point to an extracted release
archive of Dawn (of the release in build_cffi.py), or to a prefix with a
shared libwebgpu_dawn.
How it works:
wgpudawn/_libis a cffi (API mode) extension. Its cdef (webgpu_cdef.h) is generated from Dawn'swebgpu.hbytools/gen_cdef.py.wgpudawn/backends/dawnimplements the API with it. It started as wgpu-py's wgpu-native backend.codegen/is wgpu-py's code generator: it writes the enums, flags and structs fromwebgpu.idl, and checks the backend against the IDL and against Dawn's header. Runpython codegenafter changing either.
Versions and releases
A version has four numbers, X.Y.Z.N: X.Y.Z is the version of wgpu-py that
it mirrors (same API), and N counts the releases of wgpudawn for that
version, which mostly are updates of Dawn. So wgpudawn~=0.32.0 is "the API of
wgpu-py 0.32.0, on the newest Dawn". (The first releases, 0.0.x, predate
this scheme.)
The version comes from the git tag; there is no version number in the source.
Pushing a tag builds and tests the wheels, and publishes them to PyPI.
upstream.json records the versions of wgpu-py and Dawn that the code
corresponds to.
Maintenance is done by AI agents, with Claude Code skills that are part of this repository:
claude "/update-dawn release" # to the latest Dawn release, verify, release X.Y.Z.N+1
claude "/sync-upstream release" # port a new wgpu-py release, verify, release X.Y.Z.0
claude "/update-website" # newer pygfx on the website; check every example; deploy
Without release, they stop before tagging. See .claude/skills/.
License
BSD 2-clause, see LICENSE. wgpudawn is derived from wgpu-py (Copyright
2019-2023 Almar Klein, Korijn van Golen). The wheels include Dawn and the
libraries that it is built with; see LICENSES/.
Metadata
Release files for wgpudawn 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wgpudawn-0.0.2.tar.gz | 219.4 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| wgpudawn-0.0.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl | CPython 3.14 | CPython 3.14 | PyEmscripten 2026.0+ WebAssembly | Details |
| wgpudawn-0.0.2-cp311-abi3-win_arm64.whl | CPython 3.11 | abi3 | Windows ARM64 | Details |
| wgpudawn-0.0.2-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| wgpudawn-0.0.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| wgpudawn-0.0.2-cp311-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 | Details |
| wgpudawn-0.0.2-cp311-abi3-macosx_11_0_x86_64.whl | CPython 3.11 | abi3 | macOS 11.0+ x86-64 | Details |
| wgpudawn-0.0.2-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 27.6 MB
Release files / wgpudawn-0.0.2.tar.gz
| Download URL | wgpudawn-0.0.2.tar.gz |
|---|---|
| Size | 219.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5d1df4c990c9cfb6091bbe960d1f21925715099222d715a4d53cab82ee89b03
|
|
BLAKE2b-256 checksum How to use checksums |
5f07c332c04162c208e8348088363f9b8a2632a3769719cb299bad196cd1c195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl
| Download URL | wgpudawn-0.0.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl |
|---|---|
| Size | 252.7 kB |
| Tags | CPython 3.14 PyEmscripten 2026.0+ WebAssembly |
|
SHA-256 checksum How to use checksums |
d6b9b5cef59d0cc18c9cfe94b3954313250a26b896c587048e231f3cd423237d
|
|
BLAKE2b-256 checksum How to use checksums |
09182ab2d35b7a612634bc4e1bb976498768e62999a7dfe31db2d9e402248bf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp311-abi3-win_arm64.whl
| Download URL | wgpudawn-0.0.2-cp311-abi3-win_arm64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.11 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f5f6896b6b6947aae4c73522cb232bf51807c57ecd3615d7e79eef87d5f38a6b
|
|
BLAKE2b-256 checksum How to use checksums |
5ca4779ce192a36b677d27f080d75724f5f12d6e01060971fa5e50a963a525dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp311-abi3-win_amd64.whl
| Download URL | wgpudawn-0.0.2-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fac91de7022813ffe0bb8dfc582d313291de9fcec8d15a13b1dc7b1dd328f179
|
|
BLAKE2b-256 checksum How to use checksums |
7783339d7a30f3b1451a158684535017b472218d22696aaa30feb37d6aae216e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | wgpudawn-0.0.2-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
19dd35fd7a69e7565eb40569eb37fcaa27cfdf478e1d63206fda7498e20c25ef
|
|
BLAKE2b-256 checksum How to use checksums |
4acb9849b1329c9cf956fa51b04cb0894e3e12bd96462ef2a20aa9d458413c77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp311-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | wgpudawn-0.0.2-cp311-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
0b92a48c1bd1fb01a35e0c11e63b9d62232369740ea0ab3f2725022b51c59de2
|
|
BLAKE2b-256 checksum How to use checksums |
55b2d0464c6b2582c740b3911091bac0eae9be99e12a8d6e81a723cbcdd846b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp311-abi3-macosx_11_0_x86_64.whl
| Download URL | wgpudawn-0.0.2-cp311-abi3-macosx_11_0_x86_64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
01d73a7378df2ee358d3898da5d976225ca0e84f611b1da44642bf6eef873b5b
|
|
BLAKE2b-256 checksum How to use checksums |
7640d72305d88ba374ee41971f52234df5648b580849a394fee88c11d38ea158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wgpudawn-0.0.2-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | wgpudawn-0.0.2-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5c6f75e9e46d8fa71ebd8e8a2fdca1bc482ade1d15ab5344a6558dd7db7d08bf
|
|
BLAKE2b-256 checksum How to use checksums |
b77d2808b5a495044eec590f58d2db20d91bad9e675c710f7b9e20066986c5a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency log