Skip to main content

A Python framework for high-performance simulation and graphics programming

Project description

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.

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 contains the current, actively maintained set of Warp tutorials:

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

Additionally, several notebooks in the notebooks directory provide additional examples and cover key Warp features:

Notebook Colab Link
Warp Core Tutorial: Basics Open In Colab
Warp Core Tutorial: Generics Open In Colab
Warp Core Tutorial: Points Open In Colab
Warp Core Tutorial: Meshes Open In Colab
Warp Core Tutorial: Volumes Open In Colab
Warp PyTorch Tutorial: Basics Open In Colab
Warp PyTorch Tutorial: Custom Operators 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

diffray fluid checkpoint particle repulsion navier-stokes perturbation

warp/examples/tile

mlp nbody mcgp

Learn More

Please see the following resources for additional background on Warp:

Support

See the FAQ for common questions.

Problems, questions, and feature requests can be opened on GitHub Issues.

For inquiries not suited for GitHub Issues, please email warp-python@nvidia.com.

Contributing

Contributions and pull requests from the community are welcome. Please see the Contribution Guide for more information on contributing to the development of Warp.

License

Warp is provided under the Apache License, Version 2.0. Please see LICENSE.md for full license text.

This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use.

Building from Source

When building Warp from source using the build_lib.py script, the build process automatically downloads NVIDIA libmathdx. Pre-built Warp packages (e.g., from PyPI) already include libmathdx statically linked into the library binaries. In both cases, libmathdx is governed by the NVIDIA Software License Agreement.

NOTICE AND DISCLAIMER: This software automatically retrieves, accesses or interacts with external materials. Those retrieved materials are not distributed with this software and are governed solely by separate terms, conditions and licenses. You are solely responsible for finding, reviewing and complying with all applicable terms, conditions, and licenses, and for verifying the security, integrity and suitability of any retrieved materials for your specific use case. This software is provided "AS IS", without warranty of any kind. The author makes no representations or warranties regarding any retrieved materials, and assumes no liability for any losses, damages, liabilities or legal consequences from your use or inability to use this software or any retrieved materials. Use this software and the retrieved materials at your own risk.

Publications & Citation

Research Using Warp

Our PUBLICATIONS.md file lists academic and research publications that leverage the capabilities of Warp. We encourage you to add your own published work using Warp to this list.

Citing Warp

If you use Warp in your research, please use the "Cite this repository" button on the GitHub repository page or refer to the CITATION.cff file for citation information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

warp_lang-1.13.0-py3-none-win_amd64.whl (121.6 MB view details)

Uploaded Python 3Windows x86-64

warp_lang-1.13.0-py3-none-manylinux_2_34_aarch64.whl (139.8 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ ARM64

warp_lang-1.13.0-py3-none-manylinux_2_28_x86_64.whl (138.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

warp_lang-1.13.0-py3-none-macosx_11_0_arm64.whl (24.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file warp_lang-1.13.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: warp_lang-1.13.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 121.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for warp_lang-1.13.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 47975ea07252d45a4d09d2d1a6cffc55002fa7fbde771c8dceb1baf4b32d4fb8
MD5 3ef917f6b85614148c95f85f711a29f7
BLAKE2b-256 1e79e4117177b88df67d7967c993a2234a3888d0e388076652e1f2a50551f95a

See more details on using hashes here.

File details

Details for the file warp_lang-1.13.0-py3-none-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for warp_lang-1.13.0-py3-none-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 476b54f0dcf6767f23305a328660a9a74d01e371b6b7c3d77e03e18b4a1bb1a5
MD5 f973b8e67d1dfde595d009a988034c9f
BLAKE2b-256 531987b3a3a1a5e07ad34a3886ec38e96b6865359fd17a2511e78e5430c6bace

See more details on using hashes here.

File details

Details for the file warp_lang-1.13.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for warp_lang-1.13.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac2479c70ad410d58deb088c2a64168792be588efc1bec22dc51f92238e8c8c3
MD5 c3fe517a7ca3f88b59247bb04c986dbf
BLAKE2b-256 588eb42f0ddeaca25251e5bbf7db6a89351a0722432ce075ebcdece9118e955a

See more details on using hashes here.

File details

Details for the file warp_lang-1.13.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for warp_lang-1.13.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4375f572301991fe0fbf0af29fc84d76cd27d531432d6df8452b25088c21ea5a
MD5 2e51c8828dc0e6d1137a089c3fd1ea8f
BLAKE2b-256 94beb79000cb5b551803416bc10c4fa43a37d31b48062683662a6c134d7452bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page