Registry / ai-ml / wgpu
library0.31.0pypypiunverified

WebGPU for Python: a Python implementation of the WebGPU API, enabling modern GPU compute and rendering on multiple backends (Vulkan, Metal, D3D12, OpenGL). Current version 0.31.0. Requires Python >=3.10. Releases roughly monthly.

pip install wgpu
INSTALL
IMPORT
SIG · WGPU
W
wgpu
ai-mlpythonv0.31.0
Install
3.9s avg
Import
Disk
81MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.31.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 92.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.9s · import 0.000s · 98MB
81MB installed
● package 81MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

request_adapter
from wgpu import request_adapter
from wgpu import request_adapter

Initialize wgpu, request adapter and device. In real usage, provide a canvas from wgpu.gui.

import wgpu import wgpu.backends.wgpu_native # triggers auto backend selection adapter = wgpu.request_adapter(canvas=None, power_preference="high-performance") device = adapter.request_device(required_features=[]) print(f"Adapter: {adapter.summary}") print(f"Device: {device.summary}")
Debug
Known issues
breakingImport path changed in v0.10.0: previously `import wgpu.backend.wgpu_native` is no longer needed; use `import wgpu` and call `wgpu.request_adapter()`.
fix
Replace `from wgpu.backend.wgpu_native import ...` with `import wgpu` and use `wgpu.request_adapter`.
affects: >=0.10.0
breakingGUI canvas module restructured in v0.15.0: `from wgpu.gui import WgpuCanvas` no longer works; use `from wgpu.gui.auto import WgpuCanvas`.
fix
Change import to `from wgpu.gui.auto import WgpuCanvas`.
affects: >=0.15.0
gotchaThe `wgpu` library bundles wgpu-native binaries. On some platforms (e.g., Linux without Vulkan drivers) it may fall back to OpenGL or silently fail. Test on target hardware.
fix
Install appropriate GPU drivers or test with `wgpu.request_adapter` to see available adapters.
affects: all
Upgrade
Version history
0.31.0latest on PyPI · released Mar 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
50 hits · last 30 days
node
46
OpenAI (training)
1
Resources