如何使用 NVIDIA Warp 與 MjWarp 加速機器人模擬與學習工作流程

2026年9月23日 18:41
站內 AI 整理稿

Back to Articles How to Use NVIDIA Warp and MjWarp to Accelerate Robotics Simulation and Learning Workflows Enterprise + Article Published September 23, 2026 Upvote - Johnny Nuñez Cano johnnynv Follow nvidia Asier Arranz asiernvidia Follow nvidia Rishabh Chadha rchadha-nv Follow nvidia Ben Oliveri BenOliveri Follow nvidia Classic MuJoCo provides fast CPU-based robot simulation for developing, testing, and controlling robots and it can parallelize sampling across CPU cores.

But as learning workloads grow, the question shifts from how quickly one world can run to how many worlds can run at once.GPU acceleration makes it possible to advance those worlds in large batches while keeping simulation and learning data close to the device.

MuJoCo Warp (MJWarp), built on NVIDIA Warp, takes compatible MuJoCo models into that GPU-scale regime.

In this article, we will move an SO-101 follower arm from a familiar MuJoCo workflow to as many as 2,048 parallel MJWarp environments and examine the technology and validation steps that make the transition possible.Figure 1.How MJWarp connects Python to GPU simulation.

MuJoCo loads and compiles the MJCF model; MJWarp implements the physics in NVIDIA Warp, which compiles CUDA kernels to advance simulation states on NVIDIA GPUs.This is the second article in our State of Simulation for Physical AI series.The first article mapped the robot-simulation landscape.

Here, we prepare and scale the simulation environment; we do not train a policy.The later Newton and Isaac Lab installments cover the next integration layers.

Putting it together Layer Role in the stack NVIDIA Warp Python kernel language: single instruction, multiple threads (SIMT), autodiff, PyTorch/JAX interop MJWarp MuJoCo physics on Warp: same MJCF, batched GPU throughput Your scene (SO-101) Familiar Menagerie / Robot Studio assets + task geometry Next (Newton / Isaac Lab) Multi-solver API, USD, sensors, managers, training loops Decision shortcut: If you need… Reach for… Single-robot MPC / teleop MuJoCo CPU Max throughput on raw MuJoCo physics MJWarp (or mjlab) JAX training recipes MuJoCo Playground / MJX (impl='warp') Multi-solver + Isaac Lab integration Newton — next post in this series Start with one useful Warp Kernel NVIDIA Warp is a Python framework for writing high-performance, GPU-accelerated kernels.

Warp lets developers author statically typed kernels in Python and compiles them for CPU or CUDA execution.The first launch builds and caches a native module; later launches reuse it.

The kernel language is a performance-oriented subset of Python, while ordinary Python remains responsible for configuration, allocation, and launch orchestration.This small robotics-oriented kernel advances point positions under gravity.

One logical thread handles one point, so the same code scales from two points to millions without introducing GPU terminology into the control flow.

The three value propositions of Warp are: Pillar What you get Performance Native-CUDA speed via JIT compilation, kernel fusion, and CUDA Graphs Ease of use Pure Python authoring with built-in vectors, matrices, quaternions, BVHs, hash grids, sparse matrices, and tile primitives Capability Differentiable kernels and DLPack-style interop so simulation can sit inside an ML training loop import numpy as np import warp as wp @wp.

kernel def integrate( positions: wp.array[wp.vec3], velocities: wp.array[wp.vec3], dt: float, ): i = wp.tid() velocities[i] += wp.vec3(0.0, 0.0, -9.81) dt positions[i] += velocities[i] dt wp.init() device = "cuda:0" if wp.iscudaavailable() else "cpu" start = np.array([[0.0, 0.0, 0.5], [0.2, 0.0, 0.

5]], dtype=np.float32) positions = wp.array(start, dtype=wp.vec3, device=device) velocities = wp.zeroslike(positions) wp.launch( integrate, dim=len(start), inputs=[positions, velocities, 0.01], device=device, ) wp.synchronizedevice(device) print(positions.

numpy()) Three properties make this useful in robotics: Explicit parallel work.wp.tid() identifies the point, contact, body, or world owned by the current logical thread.Explicit device arrays.An array lives on the selected device.Calling .

numpy() on a CUDA array synchronizes and copies it to CPU memory; it is not a zero-copy path.For a device-resident PyTorch or JAX pipeline, use Warp’s framework adapters or DLPack-compatible sharing instead.Composable kernel launches.

A program can launch a sequence of focused kernels and capture supported CUDA work into a graph to reduce repeated dispatch overhead.Graph capture replays launches against existing buffers; it does not fuse arbitrary kernels.Differentiability and Determinism.

Two further Warp capabilities are worth knowing, even though neither is used in the SO-101 workflow in this article.Warp kernels are differentiable: a wp.

Tape records the forward kernel launches made inside its context and replays their adjoints in reverse when backward() is called, which is why teams build differentiable geometry, CFD, and custom physics in Warp, including CAE workflows for simulation and design optimization.

Warp also supports deterministic execution, introduced in Warp 1.

15: GPU atomics are scheduler-dependent by default, so repeated launches of the same kernel can differ slightly, and the opt-in deterministic modes trade some performance for reproducible ordering in simulation, validation, and regression tests.

These are Warp capabilities, not guarantees of differentiability or determinism for an entire MJWarp rollout.See the Warp documentation on differentiability and deterministic execution for the details.Try Warp: pip install warp-lang (≥ 1.15 for GPU determinism), then python -m warp.examples.

browse, or the tutorial notebooks.What is MuJoCo Warp (MJWarp)?A robot simulator repeatedly computes what happens next: given the current joint positions, velocities, controls, and contacts, it advances the scene by one small timestep.

In this article, a world means one independent copy of that scene and its state.One world might contain the SO-101 arm reaching for a cube; another can contain the same arm starting from a slightly different pose.

MuJoCo and MJWarp can run the same compatible robot and task, but they organize the work differently.MuJoCo naturally suits developing and inspecting one or a few CPU worlds.

MJWarp is a NVIDIA Warp implementation of MuJoCo’s physics pipeline that places the model and a batch of independent states on NVIDIA GPUs; one call to mjw.step advances the entire batch.MJWarp’s value is not necessarily a faster step for one world.

It is the ability to advance hundreds or thousands together, giving the GPU enough parallel work to improve aggregate throughput, the total world-steps completed per second.

That favors reinforcement learning and large-scale sampling, where collecting experience matters more than minimizing one environment’s latency.This blog covers the following: validate one MuJoCo world, move it to MJWarp, form a batch, verify it, and measure it correctly.

Solver tuning, Jacobian representation, and specialized multi-GPU or determinism topics are not required for this migration and can be covered separately.Then, the distinction is precise: Latency is wall-clock time for one simulation step.

Aggregate throughput is the total number of world-steps completed per measured wall-clock second.Basic usage: structs, batch sizes, and a minimal step The core API transition is small: MuJoCo host workflow MJWarp workflow mujoco.MjModel mjw.putmodel(mjm) creates a device model mujoco.MjData mjw.

putdata(mjm, mjd, ...) preserves and batches an existing state mujoco.mjstep(mjm, mjd) mjw.step(m, d) advances every world in d Host arrays such as mjd.ctrl Batched device arrays such as d.ctrl with shape (nworld, nu) Use mjw.makedata() when default/fresh state is intended.Use mjw.

putdata() when the exact initialized MuJoCo state must cross the migration boundary.

Allocating batched resources requires defining the following parameters (refer to Batch sizes): Parameter Meaning nworld Total number of parallel environments nconmax Expected contacts per individual world (overall capacity ≈ nconmax * nworld) naconmax Alternative setting: global maximum contacts across all environments combined (takes precedence if both are defined) njmax Hard upper limit on constraints per world Performance tuning 1.

CUDA graph capture:mjw.step is many kernel launches; capture once, replay often: with wp.ScopedCapture() as capture: mjw.step(m, d) wp.capturelaunch(capture.graph) 2.Size nconmax / naconmax / njmax tightly: memory and work scale with them.

Tune with mjwarp-testspeed: --measurealloc and watch overflows in mjwarp-viewer.Additional tuning considerations.After sizing contact and constraint buffers, test solver iteration limits without changing task behavior.

Meshes and CCD settings can increase memory use; nccdmax / naccdmax can reduce CCD buffer allocation when the measured contact counts allow it.MJWarp’s compact solver uses MuJoCo’s Newton constraint solver and sleeping, not the separate Newton physics-engine framework.

Compact-solver and multi-GPU configuration are beyond this walkthrough; consult the MJWarp performance-tuning documentation.

To train policies on MJWarp physics: Isaac Lab via Newton mjlab (manager API directly on MJWarp + PyTorch) MuJoCo Playground via MJX (impl='warp') Install / try: pip install mujoco-warp · mjwarp-viewer path/to/scene.

xml · Colab tutorial Workflow to migrate a MuJoCo scene to MjWarp Establish a MuJoCo CPU baseline The scene.Nothing here is MJWarp-specific yet: an SO-101 arm, a table, and two cubes to stack, written as ordinary MJCF.Figure 2.SO-101 pick-and-place scene, rendered from the MuJoCo CPU simulation.

The task is to grasp the red 44 mm cube and stack it on the blue cube; the same robot and scene are used for MJWarp validation.For an MJCF box, the size values are half-extents: size=”0.022 …” defines a cube with 44 mm edges.The task uses this size for its success thresholds.

The arm base is at the origin, its reach is along +X, and the cubes are arranged along Y.In the companion repository this file is generated rather than hand-written: resolvepickplacescene() copies the Menagerie arm into .

generated/, fills the table and cube coordinates from a robot profile, and writes scenepickplace.xml.The walkthrough uses the SO-101 profile; the optional reBot variant is described below.Loading it.Compilation and stepping are ordinary MuJoCo: import mujoco mjm = mujoco.MjModel.

fromxmlpath("scenepickplace.xml") mjd = mujoco.MjData(mjm) fps = 50 # controller rate simsubsteps = 10 # physics steps per control frame framedt = 1.0 / fps mjm.opt.

timestep = framedt / simsubsteps controller = PickPlaceController(spec=spec) # waypoints + damped-least-squares IK for in range(600): # 600 control frames ctrl = controller.step(mjm, mjd, framedt) for in range(simsubsteps): mjd.ctrl[: mjm.nu] = ctrl mujoco.

mjstep(mjm, mjd) Keep that shape in mind: compute controls once per frame, step physics simsubsteps times.Gate 2 changes only the inner loop, which is what makes the migration easy to review.Match the simulation and control rates.At 50 control frames per second and 10 p

Related

相關文章

IT之家AI Agent

YouTube 推出全新 AI 智能體,能幫創作者“翻紅”老視頻

首頁 IT圈 最會買 設置 日夜間 隨系統 淺色 深色 主題色 黑色 投稿 訂閱 RSS訂閱 收藏 軟媒應用 App客戶端 要知App 軟媒魔方 業界 手機 電腦 測評 視頻 AI 蘋果 iPhone 鴻蒙 軟件 智車 數碼 學院 遊戲 直播 5G 微軟 Win10 Win11 專題 搜索 首頁 > 智能時代>人工智能 YouTube 推出全新 AI 智能體,能幫創作者“翻紅”老視頻 2026/9/23 23:06:51 作者:清源 責編:清源 評論: 9 月 23 日消息,在今天(23 日)的年度創作者活動 Made on YouTube 上,YouTube 宣佈升級 2025 年推出的 AI 創作工具。

剛剛
量子位AI Agent

聯想亮相阿里雲棲大會:聯想天禧AI把超級組織落地到端側

聯想天禧AI於阿里雲棲大會展示全場景多端產品,並提出「人+Agent」的超級組織概念,認為最小生產單元已從團隊轉變為個人與AI代理的組合。大會上也發布天禧AI 4.3的「超能模式」,強調端側智慧體框架與跨裝置協作,並與阿里Qoder合作,加速生態發展。

2 小時前
AIbaseAI Agent

杭州一小夥3天搓出100個作品衝擊百萬大獎,支付寶:別急

這個消息迅速在個人開發者社群引起關注。杭州一位張姓95後小夥看到消息後,在家閉關了3天,一口氣提交了100多個參賽作品,創意來源幾乎全是網友在賽事官網投遞的願望。有網友調侃:“AI 界出了個雞排哥,搓完你的搓你的”,更有人發出疑問,“我許願、他幹活,得獎了這一百萬我們怎麼分?

3 小時前
IT之家AI Agent

Meta 測試真人代 Muse 撥打電話,引發內部隱私爭議

作者:遠洋 責編:遠洋 評論: 感謝網友 xxy171070、不一樣的體驗、補藥吖 的線索投遞!9 月 23 日消息,據路透社看到的 Meta 公司內部帖子顯示,Meta 一直在為其新推出的個人 AI 助手 Muse 測試一項“人工禮賓”服務,即由人類承包商在後臺悄悄處理部分通過該數字助手撥出的電話。

6 小時前
IT之家AI Agent

大力投入 AI 未必真能省錢,麥肯錫報告稱智能體或讓企業面臨更高成本

作者:清源 責編:清源 評論: 9 月 23 日消息,據《商業內幕》今天(23 日)上午報道,麥肯錫提醒企業,隨著智能體越來越普及,AI 支出可能進一步增加。與文本類 AI 工具相比,智能體需要實際完成任務,或將帶來高得多的運行成本。這類任務往往包含多個步驟,同一目標有不同的實現方式,成本也可能相差懸殊。

6 小時前
AIbaseAI Agent

最高折扣 50%:微軟推 AI 替你“幹活”,Copilot 變身超級應用

在 AI 助手競爭白熱化的當下,微軟試圖用“降價 + 升級”雙管齊下,把 Copilot 從辦公輔助工具推向能直接替企業幹活的自動化平臺。企業訂閱最高打五折,10 月或落地在折扣方面,消息稱微軟已告知銷售團隊,將為企業客戶的 Copilot AI 訂閱提供更高力度的優惠,幅度約為 30% 至 50%。

6 小時前