MCPcopy
hub / github.com/NVIDIA/warp

github.com/NVIDIA/warp @v1.14.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.14.0 ↗
10,750 symbols 40,094 edges 472 files 2,850 documented · 27%
README

PyPI version License GitHub commit activity Downloads codecov GitHub - CI

NVIDIA Warp

Documentation | Changelog

Warp is a Python framework for GPU-accelerated simulation, robotics, and machine learning. Warp takes regular Python functions and JIT compiles them to efficient kernel code that can run on the CPU or GPU.

Warp comes with a rich set of primitives for physics simulation, robotics, geometry processing, and more. Warp kernels are differentiable and can be used as part of machine-learning pipelines with frameworks such as PyTorch, JAX and Paddle.

<img src="https://github.com/NVIDIA/warp/raw/main/docs/img/header.jpg">

A selection of physical simulations computed with Warp

Quick Start

Simulate one million particles under gravitational attraction, in 20 lines:

import warp as wp
import numpy as np

num_particles = 1_000_000
dt = 0.01

@wp.kernel
def gravity_step(pos: wp.array[wp.vec3], vel: wp.array[wp.vec3]):
    i = wp.tid()
    position = pos[i]
    dist_sq = wp.length_sq(position) + 0.01  # softened distance
    acc = -1000.0 / dist_sq * wp.normalize(position)  # gravitational pull toward origin
    vel[i] = vel[i] + acc * dt
    pos[i] = pos[i] + vel[i] * dt

rng = np.random.default_rng(42)
positions = wp.array(rng.normal(size=(num_particles, 3)), dtype=wp.vec3)
velocities = wp.array(rng.normal(size=(num_particles, 3)), dtype=wp.vec3)

for _ in range(100):
    wp.launch(gravity_step, dim=num_particles, inputs=[positions, velocities])

print(positions.numpy())

Installing

Python version 3.10 or newer is required. Warp can run on x86-64 and ARMv8 CPUs on Windows and Linux, and on Apple Silicon (ARMv8) on macOS. GPU support requires a CUDA-capable NVIDIA GPU and driver (minimum GeForce GTX 9xx).

The easiest way to install Warp is from PyPI:

pip install warp-lang

You can also use pip install warp-lang[examples] to install additional dependencies for running examples and USD-related features.

For nightly builds, conda, CUDA 13 builds, building from source, and CUDA driver requirements, see the Installation Guide.

Tutorial Notebooks

The NVIDIA Accelerated Computing Hub also hosts Warp tutorial notebooks that can be opened in Colab:

Notebook Colab Link
Introduction to NVIDIA Warp Open In Colab
GPU-Accelerated Ising Model Simulation in NVIDIA Warp Open In Colab

Running Examples

The warp/examples directory contains examples covering physics simulation, geometry processing, optimization, and tile-based GPU programming. Before running examples, install the optional example dependencies using:

pip install warp-lang[examples]

On Linux aarch64 systems (e.g., NVIDIA DGX Spark), the [examples] extra automatically installs usd-exchange instead of usd-core as a drop-in replacement, since usd-core wheels are not available for that platform.

Examples can be run from the command-line as follows:

python -m warp.examples.<example_subdir>.<example>

Most examples can be run on either the CPU or a CUDA-capable device, but a handful require a CUDA-capable device. These are marked at the top of the example script. Some examples generate USD files containing time-sampled animations in the current working directory. These can be viewed in Pixar's UsdView, Blender, or any USD-compatible viewer.

To browse the example source code, you can open the directory where the files are located like this:

python -m warp.examples.browse

warp/examples/core

dem fluid graph capture marching cubes
mesh nvdb raycast raymarch
sample mesh sph torch wave
2-D incompressible turbulence in a periodic box

warp/examples/fem

diffusion 3d mixed elasticity apic fluid streamlines
distortion energy taylor green kelvin helmholtz magnetostatics
adaptive grid nonconforming contact darcy level-set optimization elastic shape optimization

warp/examples/optim

Core symbols most depended-on inside this repo

array
called by 5867
warp/_src/types.py
numpy
called by 4667
warp/_src/types.py
launch
called by 2166
warp/_src/context.py
add_builtin
called by 617
warp/_src/context.py
reshape
called by 424
warp/_src/types.py
get
called by 392
warp/_src/fem/quadrature/quadrature.py
backward
called by 358
warp/_src/tape.py
dtype
called by 304
warp/_src/fem/field/field.py

Shape

Function 5,886
Method 3,813
Class 1,022
Route 29

Languages

Python100%

Modules by API surface

warp/_src/types.py495 symbols
warp/_src/context.py370 symbols
warp/_src/builtins.py246 symbols
warp/_src/codegen.py193 symbols
warp/tests/tile/test_tile.py167 symbols
warp/tests/test_array.py142 symbols
warp/_src/sparse.py124 symbols
warp/_src/fem/space/shape/cube_shape_function.py121 symbols
warp/tests/interop/test_jax.py116 symbols
warp/_src/render/render_opengl.py108 symbols
warp/_src/fem/space/shape/square_shape_function.py107 symbols
warp/_src/fem/domain.py107 symbols

Dependencies from manifests, versioned

For agents

$ claude mcp add warp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact