Important constraints and configuration for Madrona MJX
mainWhen using Madrona MJX, adhere to the following technical requirements and constraints:
Data Requirements
- Camera Requirement: An MJCF file must include a camera; otherwise, the application will crash.
- Batching: The MJX Model passed to the Madrona Renderer must be batched such that arrays have the shape
[num_worlds, ...]. Non-domain-randomized MJX model attributes must be manually tiled to this shape. - World Count: The number of worlds must be known and initialized at the start. All worlds are rendered every time; you cannot disable rendering for specific worlds. This implies that training and evaluation must share the same batch size.
Resource and Lifecycle Constraints
- Renderer Singleton: Only one renderer instance can be initialized at a time. You cannot create two separate environments (e.g., one for training and one for evaluation) that each use their own batch renderer instance.
- Memory Management: Use the
MADRONA_MWGPU_DEVICE_HEAP_SIZEenvironment variable to adjust how much memory Madrona pre-allocates on the GPU. If you do not allocate enough memory for your use case, an error will be thrown.
Supported Features
- Rigid body rendering (position/rotation changes).
- Camera position and rotation changes.
- Light position and rotation changes.
- Geometry color, size, and texture domain randomization.
- Light parameter domain randomization.
Unsupported Features
- Deformable bodies.
- Particle systems.
- Muscles, Tendons, and Composites (except for rigid body components).