Registry / ai-ml / wgpu

wgpu

JSON →
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.

ai-mldata
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.

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 footguns
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()`.
breakingGUI canvas module restructured in v0.15.0: `from wgpu.gui import WgpuCanvas` no longer works; use `from wgpu.gui.auto import WgpuCanvas`.
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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
31 hits · last 30 days
petalbot
9
gptbot
4
ahrefsbot
4
amazonbot
4
claudebot
3
script
1
Resources