TorchRL ships wrappers for more than a dozen external RL environment libraries. Every wrapper subclassesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pytorch/rl/llms.txt
Use this file to discover all available pages before exploring further.
EnvBase and exposes the identical reset / step / rollout / check_env_specs interface — the same code that works with GymEnv works unchanged with DMControlEnv, BraxEnv, or VmasEnv. All third-party libraries are optional dependencies: the wrapper module is imported lazily at construction time and raises a clear ImportError if the underlying package is not installed.
GymEnv / GymWrapper
GymEnv constructs a Gymnasium (or legacy OpenAI Gym) environment directly from its registered ID. GymWrapper accepts a pre-existing gym Env object. Both expose a fully TorchRL-compatible interface including spec translation, device casting, from_pixels support, and info dict integration.
DMControlEnv / DMControlWrapper
DMControlEnv wraps any task from DeepMind Control Suite. State and pixel observations, continuous and discrete action specs, and multi-environment parallelism are all supported out of the box.
BraxEnv / BraxWrapper
BraxEnv wraps Google Brax, a JAX-based differentiable physics engine. Brax uses JAX vmap for hardware-accelerated batched simulation; TorchRL converts JAX arrays to PyTorch tensors, preserving gradient flow.
batch_size and num_workers are orthogonal scaling axes. BraxEnv("ant", batch_size=[128], num_workers=4) creates 4 processes, each running 128 Brax environments, for 512 total.IsaacGymEnv / IsaacLabWrapper
TorchRL provides wrappers for both the legacy IsaacGym Preview (deprecated) and the actively maintained IsaacLab framework. IsaacLab envs run directly on GPU via NVIDIA Isaac Sim.- IsaacGym (legacy)
- IsaacLab
VmasEnv / VmasWrapper
VMAS (Vectorised Multi-Agent Simulator) provides differentiable multi-agent scenarios running in vectorised PyTorch. TorchRL’s wrapper exposes each agent’s observations and actions as nested TensorDict entries under each agent name.n_agents and other scenario-specific parameters (e.g. reward sparsity, collision penalties) are passed as extra keyword arguments directly to the VMAS scenario constructor, not as constructor params of VmasEnv itself. The available arguments vary by scenario — see the VMAS scenarios folder for details.PettingZooEnv / PettingZooWrapper
PettingZoo covers a wide range of multi-agent environments. TorchRL’s wrapper handles both AEC (alternating) and parallel APIs, mapping each agent to a nested TensorDict key according to aMarlGroupMapType.
JumanjiEnv / JumanjiWrapper
Jumanji provides JAX-based combinatorial and scheduling environments. TorchRL wraps the JAX outputs into PyTorch tensors via a jax-to-torch bridge.OpenSpielEnv / OpenSpielWrapper
OpenSpiel covers a large catalogue of board and card games for game-theoretic RL research. Each player maps to a nested TensorDict agent group.SMACv2Env / SMACv2Wrapper
SMACv2 (StarCraft Multi-Agent Challenge v2) is a standard cooperative multi-agent benchmark running on top of StarCraft II. Requires StarCraft II and the SMAC bridge library.SafetyGymnasiumEnv / SafetyGymnasiumWrapper
Safety-Gymnasium extends Gymnasium with cost signals for safe-RL research. The TorchRL wrapper surfacescost alongside reward in the output TensorDict.
MultiThreadedEnv / MultiThreadedEnvWrapper (EnvPool)
MultiThreadedEnv wraps EnvPool, a C++-backed multi-threaded environment that achieves extremely high throughput for Atari and MuJoCo environments.
MeltingpotEnv / MeltingpotWrapper
Melting Pot tests social learning and cooperation in multi-agent scenarios. TorchRL maps each player to a nested TensorDict entry.GenesisEnv / GenesisWrapper
Genesis is a GPU-accelerated physics simulation platform for robotics and embodied AI. The TorchRL wrapper exposes Genesis environments via the standard EnvBase interface with JAX-to-Torch tensor conversion.Summary Table
| Class | Library | Install | Multi-Agent | GPU-native |
|---|---|---|---|---|
GymEnv | Gymnasium / OpenAI Gym | pip install gymnasium | ❌ | ❌ |
DMControlEnv | DM Control | pip install dm_control | ❌ | ❌ |
BraxEnv | Brax (JAX) | pip install brax | ❌ | ✅ (via JAX) |
IsaacGymEnv | IsaacGym (legacy) | see NVIDIA docs | ❌ | ✅ |
IsaacLabWrapper | IsaacLab | see NVIDIA docs | ❌ | ✅ |
VmasEnv | VMAS | pip install vmas | ✅ | ✅ |
PettingZooEnv | PettingZoo | pip install pettingzoo | ✅ | ❌ |
JumanjiEnv | Jumanji (JAX) | pip install jumanji | ❌ | ✅ (via JAX) |
OpenSpielEnv | OpenSpiel | pip install open_spiel | ✅ | ❌ |
SMACv2Env | SMACv2 | pip install smacv2 | ✅ | ❌ |
SafetyGymnasiumEnv | Safety-Gymnasium | pip install safety-gymnasium | ❌ | ❌ |
MultiThreadedEnv | EnvPool | pip install envpool | ❌ | ❌ |
MeltingpotEnv | Melting Pot | pip install dm-meltingpot | ✅ | ❌ |
GenesisEnv | Genesis | pip install genesis-world | ❌ | ✅ |