Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

envpool

> 数据库
Open source

C++-based high-performance parallel environment execution engine (vectorized env) for general RL environments.

1.5K stars0 likes6 views
WebsiteGitHub

About

C++-based high-performance parallel environment execution engine (vectorized env) for general RL environments.


EnvPool is a C++-based batched environment pool with pybind11 and thread pool. It has high performance (~1M raw FPS with Atari games, ~3M raw FPS with MuJoCo simulator on DGX-A100) and compatible APIs (supports Gymnasium and dm_env, both sync and async, both single and multi player environment). Currently it supports:

  • Atari games
  • MuJoCo (Gymnasium)
  • Classic control RL envs: CartPole, MountainCar, Pendulum, Acrobot
  • Toy text RL envs: Catch, FrozenLake, Taxi, NChain, CliffWalking, Blackjack
  • ViZDoom single player
  • DeepMind Control Suite
  • DeepMind Control Locomotion and Soccer
  • Box2D
  • Google Research Football
  • Procgen
  • Minigrid
  • MarlGrid
  • Highway
  • MetaWorld
  • MyoSuite
  • PGX
  • Jumanji
  • Craftax and Craftax Classic
  • MuJoCo Playground
  • MJLab

Here are EnvPool's several highlights:

  • All-platform support: Linux, macOS, and Windows wheels for Python 3.12-3.14;
  • Built-in rendering with batched rgb_array output and human display mode;
  • Compatible with gymnasium APIs and DeepMind dm_env APIs;
  • Manage a pool of envs, interact with the envs in batched APIs by default;
  • Support both synchronous execution and asynchronous execution;
  • Support both single player and multi-player environment;
  • Easy C++ developer API to add new envs: Customized C++ environment integration;
  • Free ~2x speedup with only single environment;
  • 1 Million Atari frames / 3 Million MuJoCo steps per second simulation with 256 CPU cores, ~20x throughput of Python subprocess-based vector env;
  • ~3x throughput of Python subprocess-based vector env on low resource setup like 12 CPU cores;
  • Comparing with existing GPU-based solution (Brax / Isaac-gym), EnvPool is a general solution for various kinds of speeding-up RL environment parallelization;
  • XLA support with JAX jit function: XLA Interface;
  • Compatible with some existing RL libraries, e.g., Stable-Baselines3, Tianshou, ACME, CleanRL, or rl_games.
    • Stable-Baselines3 Pendulum-v1 example;
    • Tianshou CartPole example, Pendulum-v1 example, Atari example, MuJoCo example, and integration guideline;
    • ACME HalfCheetah example;
    • CleanRL Pong-v5 example (Solving Pong in 5 mins (tracked experiment));
    • rl_games Atari example (2 mins Pong and 15 mins Breakout) and MuJoCo example (5 mins Ant and HalfCheetah).

Check out our arXiv paper for more details!

Installation

PyPI

EnvPool is currently hosted on PyPI. It supports Python 3.12-3.14 on Linux, macOS, and Windows.

You can simply install EnvPool with the following command:

bash
$ pip install envpool

After installation, open a Python console and type

python
import envpool
print(envpool.__version__)

If no error occurs, you have successfully installed EnvPool.

Platform notes:

  • Linux MuJoCo wheels use the system EGL/OpenGL runtime. For Mesa on Ubuntu, install libegl1 libopengl0 libgl1-mesa-dri.
  • Linux Procgen wheels intentionally do not vendor Qt. If making a Procgen environment reports missing libQt5Core.so.5 or libQt5Gui.so.5, install the system Qt 5 runtime, for example with apt install qtbase5-dev or dnf install qt5-qtbase.
  • Windows Procgen wheels bundle the required Qt runtime DLLs (Qt5Core.dll and Qt5Gui.dll) next to the extension module.
  • Windows source/release CI validates MuJoCo rendering with Mesa software OpenGL. To reproduce that setup locally, point ENVPOOL_DLL_DIR at a Mesa DLL directory and set GALLIUM_DRIVER=llvmpipe plus MESA_GL_VERSION_OVERRIDE=4.5COMPAT.
  • Building from source still requires platform-local build dependencies, including Qt 5. The full per-platform setup is documented in Build From Source.

From Source

Please refer to the guideline.

Documentation

The tutorials and API documentation are hosted on envpool.readthedocs.io.

The example scripts are under examples/ folder; benchmark scripts are under benchmark/ folder.

Benchmark Results

The historical benchmark tables below were produced with ALE Atari environment PongNoFrameskip-v4 (with environment wrappers from OpenAI Baselines) and MuJoCo environment Ant-v3 on different hardware setups, including a TPUv3-8 virtual machine (VM) of 96 CPU cores and 2 NUMA nodes, and an NVIDIA DGX-A100 of 256 CPU cores with 8 NUMA nodes. The current scripts under benchmark/ use Gymnasium's ALE/Pong-v5 and Ant-v5. Baselines include 1) naive Python for-loop; 2) the most popular RL environment parallelization execution by Python subprocess, e.g., gym.vector_env; 3) to our knowledge, the fastest RL environment executor Sample Factory before EnvPool.

We report EnvPool performance with sync mode, async mode, and NUMA + async mode, compared with the baselines on different number of workers (i.e., number of CPU cores). As we can see from the results, EnvPool achieves significant improvements over the baselines on all settings. On the high-end setup, EnvPool achieves 1 Million frames per second with Atari and 3 Million frames per second with MuJoCo on 256 CPU cores, which is 14.9x / 19.6x of the gym.vector_env baseline. On a typical PC setup with 12 CPU cores, EnvPool's throughput is 3.1x / 2.9x of gym.vector_env.

Atari Highest FPS Laptop (12) Workstation (32) TPU-VM (96) DGX-A100 (256)
For-loop 4,893 7,914 3,993 4,640
Subprocess 15,863 47,699 46,910 71,943
Sample-Factory 28,216 138,847 222,327 707,494
EnvPool (sync) 37,396 133,824 170,380 427,851
EnvPool (async) 49,439 200,428 359,559 891,286
EnvPool (numa+async) / / 373,169 1,069,922
MuJoCo Highest FPS Laptop (12) Workstation (32) TPU-VM (96) DGX-A100 (256)
For-loop 12,861 20,298 10,474 11,569
Subprocess 36,586 105,432 87,403 163,656
Sample-Factory 62,510 309,264 461,515 1,573,262
EnvPool (sync) 66,622 380,950 296,681 949,787
EnvPool (async) 105,126 582,446 887,540 2,363,864
EnvPool (numa+async) / / 896,830 3,134,287

Please refer to the benchmark page for more details.

API Usage

The following content shows both synchronous and asynchronous API usage of EnvPool. You can also run the full script at examples/env_step.py

Synchronous API

python
import envpool
import numpy as np

# make Gymnasium env
env = envpool.make("Pong-v5", env_type="gymnasium", num_envs=100)
# or use envpool.make_gymnasium(...)
obs = env.reset()  # should be (100, 4, 84, 84)
act = np.zeros(100, dtype=int)
obs, rew, term, trunc, info = env.step(act)

Under the synchronous mode, envpool closely resembles Gymnasium and dm_env. It has the reset and step functions with the same meaning. However, there is one exception in envpool: batch interaction is the default. Therefore, during the creation of the envpool, there is a num_envs argument that denotes how many envs you like to run in parallel.

python
env = envpool.make("Pong-v5", env_type="gymnasium", num_envs=100)

The first dimension of action passed to the step function should equal num_envs.

python
act = np.zeros(100

Issues· 16 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++atari-gamesbox2dcpp17dm-control

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库