Skip to main content

libuipc

PyPI version Downloads Documentation Issues License

A Cross-Platform Modern C++20 Library of Unified Incremental Potential Contact — both C++ and Python APIs.

Website ➡️ spirimirror.github.io/libuipc-web ・ Samples ➡️ github.com/spiriMirror/libuipc-samples

teaser

Libuipc is a GPU-accelerated simulation library built around a unified Incremental Potential Contact framework. It couples rigid bodies (affine body dynamics), soft bodies (FEM), cloth, and threads in one scene with accurate, penetration-free frictional contact, and is designed to be naturally differentiable for ML, inverse dynamics, and robotics workflows. The whole pipeline — collision detection, contact assembly, and a fused-PCG linear solver with CUDA-graph replay and an optional MAS preconditioner — runs on the GPU.

We are actively developing Libuipc. Feedback and contributions are welcome!

Table of Contents

What is libuipc?

libuipc is organized in three layers: a friendly scene API on top, a reusable simulation core in the middle, and a fully-parallel CUDA backend underneath.

  • Simulation Interface — Python and C++ APIs for building scenes: geometry IO (OBJ/MSH/URDF/glTF), constitutions (SNK elasticity, Baraff-Witkin cloth, shell bending, ABD affine bodies, joint systems), contact tabulars, animation scripting, and a Polyscope-based GUI.
  • Simulation Core — scene/world/engine abstractions with the incremental-potential Newton solver: implicit time integration, line search with continuous collision detection, frictional contact with scene-adaptive tolerances, and a scene-adaptive kappa corridor.
  • CUDA Backend — GPU PCG linear solver with StiffGIPC MAS (Multi-Level Additive Schwarz) preconditioner, stackless-BVH collision detection, and per-constitution GPU kernels — all running without CPU round-trips in the solver loop.

Why libuipc

  • Easy & Powerful: an intuitive, unified way to create and drive vivid simulation scenes; objects and constraints compose freely.
  • Fast & Robust: fully GPU-parallel, with Stiff-GIPC-grade numerics and a contact model that stays penetration-free under stiff, frictional, coupled scenarios.
  • High Flexibility: Python and C++ APIs, Linux and Windows, PyPI wheels and source builds.
  • Fully Differentiable: differentiable simulation APIs for backward optimization (Diff-Sim, coming soon).

Catalogue

Runnable examples live in libuipc-samples/examples/ — each is a self-contained main.py with a GUI (run/stop) and most support --headless [N] benchmarking. Highlights:

Stiff-GIPC Benchmark Suite (88–93)

The reproducible headless cross-domain registry and current machine-specific reference are documented in Testing and Benchmarks.

Robotics

FEM & Cloth

Rigid Bodies, Joints & Coupling

Installation

Python (PyPI)

pip install pyuipc

The release pipeline builds Windows / Linux, Python 3.10–3.14, CUDA 12.8 runtime wheels. The immutable 0.0.26 release predates Python 3.14 support, so Python 3.14 users need the next release or a source build. The Windows wheel dynamically loads cublas64_12.dll; a CUDA 13-only install does not provide that versioned runtime. Use CUDA 12.8 side-by-side, or build from source for CUDA 13.

New wheels contain native code for compute capabilities 7.5, 8.0, 8.6, and 8.9, plus compute-8.9 PTX for forward JIT on newer GPUs. Diagnose an installation before running a scene:

python -m uipc doctor
python -m uipc doctor --probe-cuda

From Source

Prerequisites: CMake ≥ 3.26, Python ≥ 3.11, CUDA ≥ 12.4, and vcpkg (XMake ≥ 3.0.5 if you prefer that build path).

# 1) vcpkg (once): clone + bootstrap, then point CMake at the toolchain
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg && ./bootstrap-vcpkg.bat   # Linux: ./bootstrap-vcpkg.sh
# set CMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake

# 2) clone (samples come along as a submodule)
git clone https://github.com/spiriMirror/libuipc.git --recurse-submodules
cd libuipc && mkdir build && cd build

# 3) configure + build (NVCC is slow — use all cores)
cmake -S .. -DUIPC_BUILD_PYBIND=1
cmake --build . --config Release -j8   # Linux: add -DCMAKE_BUILD_TYPE=Release

With UIPC_BUILD_PYBIND=ON, the Python binding is built and installed into the active Python environment. If the install step fails, finish it manually with cd build/python && pip install .; to target a specific venv, pass -DUIPC_PYTHON_EXECUTABLE_PATH=<python.exe>.

On Linux, a conda environment is recommended: conda env create -f conda/env.yaml && conda activate uipc_env, then conda env config vars set CMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake before the build commands above.

XMake alternative: xmake f -c && xmake build -j8 (Python binding: xmake f --pybind=true --python_system=true --python_version=3.11.x -c).

Check the install: cd python && python uipc_info.py.

Full guide (incl. Docker and CUDA/driver compatibility notes): Build & Install. For the samples' uv-based workflow, see the libuipc-samples README.

Quick Start (Python)

from uipc.core import Engine, World, Scene
from uipc.geometry import SimplicialComplexIO, ground, label_surface, label_triangle_orient, flip_inward_triangles
from uipc.constitution import StableNeoHookean, ElasticModuli

engine = Engine("cuda", "output")
world  = World(engine)
scene  = Scene(Scene.default_config())
scene.contact_tabular().default_model(0.2, 1e8)

mesh = SimplicialComplexIO().read("bunny.msh")
label_surface(mesh)
label_triangle_orient(mesh)
mesh = flip_inward_triangles(mesh)
StableNeoHookean().apply_to(mesh, ElasticModuli.youngs_poisson(1e6, 0.49), mass_density=1e3)

scene.objects().create("bunny").geometries().create(mesh)
scene.objects().create("ground").geometries().create(ground(-1.0))

world.init(scene)
for _ in range(100):
    world.advance()
    world.retrieve()

Optional: enable the MAS preconditioner for stiff FEM scenes with one config line — config["linear_system"]["fem_preconditioner"] = "mas".

Inspect the validated configuration contract (defaults, units, ranges, selectors, lifecycle, and backend consumers) with python -m uipc config-schema, or read the Scene Configuration Reference.

Contributing & Support

  • Bugs & features: file an Issue; questions and ideas go to Discussions.
  • Pull requests are welcome — CI runs the full simulation suite, please keep it green.
  • For maintainers: .cursor/ holds AI-assisted build/test/commit/PR commands and style rules; agent_docs/ documents the architecture.

News

2026-8-24: We preliminarily optimized the CUDA backend, improving the framework's simulation performance across the board — and Libuipc v1.0 will be ready soon!

2026-3-29: Thanks Genesis AI for contributing AL-IPC (Augmented Lagrangian IPC) integration, a Minimal Coordinate Articulated Joint System (ExternalArticulationConstraint) for affine bodies, and the CIBuildWheel cross-platform PyPI packaging pipeline.

2026-2-13: Cursor AI-assisted development support — see .cursor/ for built-in commands and rules.

2026-2-7: pip install pyuipc on PyPI (Win/Linux, Python 3.10–3.13, CUDA 12.8).

2025-11-01: The prototype implementation of Libuipc was open-sourced (Stiff-GIPC) as our performance benchmark reference.

2025-5-23: StiffGIPC presented at SIGGRAPH 2025.

2024-11-25: Libuipc v0.9.0 (Alpha) published — feedback welcome via Issues and PRs!

License & Acknowledgments

libuipc is released under the Apache License 2.0 (see LICENSE).

This project is led by Kemeng Huang and Professor Taku Komura (The University of Hong Kong), in collaboration with Professor Minchen Li (Carnegie Mellon University), with comprehensive support from TransGP. It builds upon the GPU IPC project, originally developed and continuously optimized by Kemeng Huang. We also thank the many open-source contributors, with special thanks to Xinyu Lu, who initially worked with us at TransGP and helped a lot in this project.

Citation

If you use Libuipc in your project, please cite our works:

@article{stiffgipc2025,
      author = {Huang, Kemeng and Lu, Xinyu and Lin, Huancheng and Komura, Taku and Li, Minchen},
      title = {StiffGIPC: Advancing GPU IPC for Stiff Affine-Deformable Simulation},
      year = {2025},
      publisher = {Association for Computing Machinery},
      volume = {44},
      number = {3},
      issn = {0730-0301},
      doi = {10.1145/3735126},
      journal = {ACM Trans. Graph.},
      month = may,
      articleno = {31},
      numpages = {20}
}
@article{gipc2024,
      author = {Huang, Kemeng and Chitalu, Floyd M. and Lin, Huancheng and Komura, Taku},
      title = {GIPC: Fast and Stable Gauss-Newton Optimization of IPC Barrier Energy},
      year = {2024},
      publisher = {Association for Computing Machinery},
      volume = {43},
      number = {2},
      issn = {0730-0301},
      doi = {10.1145/3643028},
      journal = {ACM Trans. Graph.},
      month = {mar},
      articleno = {23},
      numpages = {18}
}

Metadata

Release files for pyuipc 0.0.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyuipc 0.0.27
File
pyuipc-0.0.27-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pyuipc-0.0.27-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
pyuipc-0.0.27-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pyuipc-0.0.27-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
pyuipc-0.0.27-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyuipc-0.0.27-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
pyuipc-0.0.27-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pyuipc-0.0.27-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details
pyuipc-0.0.27-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pyuipc-0.0.27-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details

Total release size: 174.9 MB

Release files / pyuipc-0.0.27-cp314-cp314-win_amd64.whl

Download URL pyuipc-0.0.27-cp314-cp314-win_amd64.whl
Size 17.8 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
2b054b1e50b54bdac4033f180600045e302196ebb0accc0ff6b64452b7c9eb28
BLAKE2b-256 checksum
How to use checksums
3ae2e105d827c921012e11c7ac19935c2f6d7a63a3bfcbb74ac695ca6ed8cb96
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL pyuipc-0.0.27-cp314-cp314-manylinux_2_34_x86_64.whl
Size 17.4 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
282cb2e3150354f20b0e9271bad07c6e853531605c5888d6db22a09d5814cfe1
BLAKE2b-256 checksum
How to use checksums
45eee87fdcbe463d3eb5f8e394bc687a28efdfef0acfae163c22a608094dafaa
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp313-cp313-win_amd64.whl

Download URL pyuipc-0.0.27-cp313-cp313-win_amd64.whl
Size 17.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
0e119e1269cb203836190685f9c6da4eaf3470bb0686cb9984195c64a161b3c5
BLAKE2b-256 checksum
How to use checksums
ee22a1078113c12baa316e68ba84ec1359eb6ad03789fefd1a15d29bf4f7cdc2
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL pyuipc-0.0.27-cp313-cp313-manylinux_2_34_x86_64.whl
Size 17.3 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
c7cf85a58855aca0d1ba5dcedc1abaa9d35bfca77c2d32a45c6ef03435d59edf
BLAKE2b-256 checksum
How to use checksums
bf654e07d5e22a1435ec0049ebd34ee72abdce35383ed19ca0632bb4d61050b9
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp312-cp312-win_amd64.whl

Download URL pyuipc-0.0.27-cp312-cp312-win_amd64.whl
Size 17.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
000bbec621559e31ef5f053fc627748965ac46ed03cc1b66f4f4f21ae12a4008
BLAKE2b-256 checksum
How to use checksums
89e14aca18cedf44c6d74563484a69962d40c79ef854812c63ed926b9dddd1f0
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL pyuipc-0.0.27-cp312-cp312-manylinux_2_34_x86_64.whl
Size 17.3 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
7680e1fe2c5d2836f6160d4c6d70a91cb857ecf76d6499705ad2732030578b72
BLAKE2b-256 checksum
How to use checksums
cb4597f4e979510349c967ba4f0a1b36a54365c0918ff1f67b0f48923649ca01
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp311-cp311-win_amd64.whl

Download URL pyuipc-0.0.27-cp311-cp311-win_amd64.whl
Size 17.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6f26466934e06f7e2e4d92212c693a62741b256a7e537b79b5e442ea16aec429
BLAKE2b-256 checksum
How to use checksums
d08438adfcf8695e3281b37714f59b8cee7f8cc02019ecbcad9817a326dd8486
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL pyuipc-0.0.27-cp311-cp311-manylinux_2_34_x86_64.whl
Size 17.3 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
a145e825e75e88af86b4c81e7c09ea9a3f34ee3cbf613a43490060245ffe50c8
BLAKE2b-256 checksum
How to use checksums
9f5f11a9f7d722b406745dfb297ebebc68a5ae103430f07cdfc544d9ce3056b4
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp310-cp310-win_amd64.whl

Download URL pyuipc-0.0.27-cp310-cp310-win_amd64.whl
Size 17.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1abe9f01e5faa379f8869d78ffacf911aeeda956a3a5d17b82312e9e4f225c8e
BLAKE2b-256 checksum
How to use checksums
de4ceff7266ce3c81de30c08b7c00de4c99190e70e8100d30eeeb7a37eaaeb9e
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 Sep 1, 2026.

Transparency log

Release files / pyuipc-0.0.27-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL pyuipc-0.0.27-cp310-cp310-manylinux_2_34_x86_64.whl
Size 17.3 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
2c6cb17c6ff8b66d9a4b2518124a44bccdd962391315cd53ec6f9068d4a69624
BLAKE2b-256 checksum
How to use checksums
13e251b81e11d86e25e788703fd8d852455679445b4dc435f5042b4610023d4e
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 Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

1 release file

This release

0.0.27 This release

10 release files

0.0.26

8 release files

0.0.25

8 release files

0.0.24

8 release files

0.0.23

8 release files

0.0.22

8 release files

0.0.21

8 release files

0.0.20

8 release files

0.0.19

8 release files

0.0.18

8 release files

0.0.17

8 release files

0.0.16

8 release files

0.0.15

8 release files

0.0.9

8 release files

0.0.8

8 release files

0.0.7

8 release files

0.0.6

8 release files

0.0.5

8 release files

0.0.4

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page