Skip to content

Conversation

Harshdhall01
Copy link

Problem

When using MuJoCo MJX with Warp backend and JAX compilation, the second call to a compiled function fails with:
AttributeError: undefined symbol: wp_cuda_graph_launch. Did you mean: 'cuda_graph_launch'?

Root Cause

The Warp library exports the symbol as cuda_graph_launch but the MJX FFI code looks for wp_cuda_graph_launch (with wp_ prefix).

Solution

File: mjx/mujoco/mjx/third_party/warp/jax_experimental/ffi.py (line ~578)

Changed wp.context.runtime.core.wp_cuda_graph_launch to wp.context.runtime.core.cuda_graph_launch

Testing

  • ✅ Tested on WSL2 Ubuntu with NVIDIA GTX 1650, CUDA 12.6
  • ✅ MuJoCo 3.3.6, JAX 0.7.2, Warp 1.8.1
  • ✅ Both first and second calls to compiled functions now succeed
  • ✅ No more symbol errors

Fixes #2865

Copy link

google-cla bot commented Sep 21, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The Warp library exports cuda_graph_launch but MJX FFI code
was looking for wp_cuda_graph_launch (with wp_ prefix).
This caused AttributeError on second call to JAX-compiled functions.

Fixes: undefined symbol error in Warp backend with JAX compilation
@Harshdhall01 Harshdhall01 force-pushed the fix-warp-cuda-graph-symbol branch from db66919 to bb76189 Compare September 23, 2025 12:40
@Tadinu
Copy link

Tadinu commented Oct 6, 2025

@Harshdhall01 In Warp, it was originally added here and looks still so currently, so should the PR go there also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined symbol: wp_cuda_graph_launch raised when using the Warp MJX backend
2 participants