skillfed

wgpu

WebGPU for Python

wgpu v0.32.0 129.1K downloads/30d#11,684 on PyPI693
Permissive license BSD 2-Clause License Copyright (c) 2019-2023, Almar Klein, Korijn van Golen All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted… (full text in the JSON record) Active released

What it is and what it does

wgpu-py is a Pythonic wrapper around wgpu-native, exposing the WebGPU API—a modern, higher-level GPU graphics standard designed to replace OpenGL. It abstracts over Vulkan, Metal, DX12, and OpenGL backends, providing a unified interface for GPU compute and graphics across platforms. The library ships with precompiled binaries for Windows, Linux (x86 and ARM), and macOS (Intel and M1), making installation straightforward on supported systems.

The package is used as the foundation for rendering engines like pygfx and supports both synchronous (blocking) and asynchronous function variants, allowing integration with asyncio or Trio. Test coverage is near complete, and the API surface is mature enough to power production visualization and compute libraries. Developers can render to screen via rendercanvas, which auto-detects available GUI backends (GLFW, Qt, wxPython, Jupyter), or use wgpu purely for headless GPU compute.

Use it for:

  • Build modern GPU-accelerated visualization and rendering engines as a foundation (e.g., pygfx)
  • Implement GPU compute kernels and data-parallel algorithms without low-level graphics API complexity
  • Create cross-platform graphics applications that run on Windows, Linux, and macOS with a single codebase
  • Embed GPU rendering in Qt/wxPython/Jupyter applications via rendercanvas integration
  • Port WebGPU JavaScript code to Python while maintaining API compatibility

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

wgpu-py provides a Python binding to WebGPU, a modern GPU graphics API that serves as the successor to OpenGL, enabling GPU compute and graphics rendering across Windows, Linux, and macOS.

Yes, if you need modern GPU graphics or compute in Python and can target Python 3.11+. The library is actively maintained, permissively licensed, has no known vulnerabilities, and offers a stable, well-tested API suitable for production visualization and compute work. Install friction is moderate due to platform-specific binaries, but precompiled wheels handle most systems. Not suitable if you require Python <3.11 or need to support older GPU drivers.

Install

wgpu on PyPI

pip

pip install wgpu

uv

uv add wgpu

poetry

poetry add wgpu

Installing wgpu

Before you install

Medium install friction due to platform-specific binary wheels (Windows, Linux x86/aarch64, macOS Intel/ARM) and three runtime dependencies including cffi and rendercanvas. Actively maintained with a release 26 days old; requires Python 3.11+.

License in practice

BSD 2-Clause License permits commercial and private use with minimal restrictions; you must retain copyright notice and disclaimer in distributions. No copyleft obligations.

Quickstart

pip install wgpu rendercanvas

import wgpu
from rendercanvas.auto import RenderCanvas, loop

# Access full WebGPU API via wgpu namespace
device = await wgpu.gpu.request_adapter().request_device()

Requires Python 3.11+. GPU hardware and appropriate drivers (Vulkan, Metal, DX12, or OpenGL) must be available on the target system.

Verify before relying

  • Whether async functions work reliably with standard asyncio/trio patterns in production
  • Performance characteristics compared to direct wgpu-native or other GPU frameworks
  • Stability of the WebGPU spec implementation as the standard continues to evolve

Package facts

License BSD 2-Clause License Copyright (c) 2019-2023, Almar Klein, Korijn van Golen All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.11)
Install friction medium — platform-specific wheel
Runtime dependencies 3 — cffi, rendercanvas, rubicon-objc
Maintenance actively maintained — 26 days since the last release
Last repo commit
First released
Downloads 129,092/month — #11,684 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: wgpu-0.32.0-py3-none-macosx_10_9_x86_64.whl; wgpu-0.32.0-py3-none-macosx_11_0_arm64.whl; wgpu-0.32.0-py3-none-manylinux_2_28_aarch64.whl; wgpu-0.32.0-py3-none-manylinux_2_28_x86_64.whl; wgpu-0.32.0-py3-none-win32.whl; wgpu-0.32.0-py3-none-win_amd64.whl; wgpu-0.32.0-py3-none-win_arm64.whl

Keywords: DX12, metal, opengl, vulkan, webgpu, wgpu

Tags

webgpu python bindinggpu graphics api pythonmodern gpu computevulkan metal dx12 wrappergpu rendering frameworkwgpu native pythoncross-platform gpu api
gpu-graphicswebgpucross-platform

More Graphics packages