Megaverse is a dedicated high-throughput rendering and simulation engine for Artificial Intelligence research. It features an optimized batched renderer that enables generation of up to 1M observations per second on a single machine.

Left: RL agent completing a TowerBuilding task. Right: human player solving a randomly generated obstacle course



Install from prebuilt binaries

pip install git+{37m,38,39}-cp{37m,38,39}-linux_x86_64.whl
pip install{37,38,39}-cp{37m,38,39}-macosx_10_15_x86_64.whl

Building from source

1) Install VulkanSDK from (download and unzip), or use the following commands:
$ wget
$ mkdir vulkansdk && tar -xzf vulkansdk-linux-x86_64- --directory vulkansdk

2) Add Vulkan SDK binaries to PATH:
$ cd vulkansdk/
$ source ./

3) Clone the repo
$ git clone

4) Init submodules
$ cd megaverse 
$ git submodule update --init --recursive

5) Setup environment
$ conda env create -f environment.yml
$ conda activate megaverse

6) Install megaverse
$ python develop
$ pip install -e .

Using Docker

1) Clone the repo 
$ git clone

2) Build the image
cd megaverse
docker build -t megaverse -f docker/Dockerfile.base .

3) Start megaverse
docker run --shm-size 8G --runtime=nvidia megaverse ./docker/

(Optional) 4) Launch bash in the container and enjoy
docker run -it --shm-size 8G --runtime=nvidia --entrypoint /bin/bash megaverse

RL Training

Example training script:

python -m megaverse_rl.train --train_for_seconds=360000000 --train_for_env_steps=2000000000 --algo=APPO --gamma=0.997 --use_rnn=True --rnn_num_layers=2 --num_workers=12 --num_envs_per_worker=2 --ppo_epochs=1 --rollout=32 --recurrence=32 --batch_size=2048 --actor_worker_gpus 0 --num_policies=1 --with_pbt=False --max_grad_norm=0.0 --exploration_loss=symmetric_kl --exploration_loss_coeff=0.001 --megaverse_num_simulation_threads=1 --megaverse_use_vulkan=True --policy_workers_per_policy=2 --learner_main_loop_num_cores=1 --reward_clip=30 --env=megaverse_TowerBuilding --experiment=test_cli

(more thorough documentation is coming)


  • A crash (segfault) on initialization can be caused by the incorrect initialization of Vulkan device interface. Possible fixes:
    • sudo apt remove mesa-vulkan-drivers (unless other packages you require depend on this package)
    • Set envvar export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json, point to the location of nvidia_icd.json in your system.


If you use this repository in your work or otherwise wish to cite it, please make reference to our ICML2021 paper.

  title={Megaverse: Simulating Embodied Agents at One Million Experiences per Second},
  author={Petrenko, Aleksei and Wijmans, Erik and Shacklett, Brennan and Koltun, Vladlen},