MuJoCo Warp (MJWarp)
MJWarp is a GPU-optimized version of the MuJoCo physics simulator, designed for NVIDIA hardware.
MJWarp uses NVIDIA Warp to circumvent many of the sharp bits in MuJoCo MJX. MJWarp is integrated into both MJX and Newton.
MJWarp is maintained by Google DeepMind and NVIDIA.
Getting started
There are a few ways to jump into using MuJoCo Warp:
- For a quick overview of MJWarp's API and design, please see our colab that introduces the basics.
- For more details and advanced topics on using MJWarp, see the MuJoCo Warp documentation.
If you would like to train robot policies using MJWarp, consider using a robotics research toolkit that integrates it:
- MuJoCo Playground integrates MJWarp via MJX
- Isaac Lab integrates MJWarp via Newton
- mjlab integrates MJWarp directly
Installing
From PyPI:
pip install mujoco-warp
From source:
git clone https://github.com/google-deepmind/mujoco_warp.git cd mujoco_warp uv sync --all-extras
To make sure everything is working:
uv run pytest -n 8
If you plan to write Warp kernels for MJWarp, please use the kernel_analyzer vscode plugin located in contrib/kernel_analyzer.
Please see the README there for details on how to install it and use it. The same kernel analyzer will be run on any PR
you open, so it's important to fix any issues it reports.
Compatibility
The following features are implemented:
| Category | Feature |
|---|---|
| Dynamics | Forward, Inverse |
| Transmission | All |
| Actuator | All except PLUGIN |
| Geom | All |
| Constraint | All |
| Equality | All |
| Integrator | All except IMPLICIT |
| Cone | All |
| Condim | All |
| Solver | All except PGS, noslip |
| Fluid Model | All |
| Tendon Wrap | All |
| Sensors | All except PLUGIN |
| Flex | All except flex-flex collisions, selfcollide, mjEQ_FLEXVERT, and mjEQ_FLEXSTRAIN |
| Mass matrix format | Sparse and Dense |
| Jacobian format | DENSE only (row-sparse, no islanding yet) |
Differentiability via Warp is not currently available.
Viewing simulations
Explore MuJoCo Warp simulations using an interactive viewer:
mjwarp-viewer benchmarks/humanoid/humanoid.xml
This will open a window on your local machine that uses the MuJoCo native visualizer.
Batch Rendering
MJWarp includes a high-throughput GPU batch renderer designed for simultaneous rendering of cameras across many parallel simulation worlds. The renderer uses ray-tracing to render MuJoCo primitives using Warp's BVH API.
Key capabilities:
- Mesh rendering
- Texture support
- Heightfield rendering
- Flex deformable rendering
- Heterogeneous multi-camera support (different resolutions/FOV/intrinsics for each camera)
- Lighting and shadow support
Benchmarking
Benchmark as follows:
mjwarp-testspeed benchmarks/humanoid/humanoid.xml
To get a full trace of the physics steps (e.g. timings of the subcomponents) run the following:
mjwarp-testspeed benchmarks/humanoid/humanoid.xml --event_trace=True
mjwarp-testspeed has many configuration options, see mjwarp-testspeed --help for details.
Benchmark rendering with:
mjwarp-testspeed benchmarks/primitives.xml --function=render