Skip to main content

DeepMind Lab with Bazel 8, Python 3.13, and Gymnasium/Shimmy support

Project description

dmlab-gym

A fork of DeepMind Lab updated for Bazel 8, Python 3.13, and wrapped with Gymnasium via Shimmy.

What This Is

DeepMind Lab is a 3D learning environment based on id Software's Quake III Arena. This fork modernizes the build toolchain so it compiles and runs on current systems:

  • Bazel 8 with --enable_workspace compatibility
  • Python 3.13 C extension and package support
  • Gymnasium/Shimmy wrapper for standard RL interfaces

The engine builds inside a container (Podman or Docker). The resulting wheel installs into a host-side uv environment.

Platform Support

Platform Status
Linux (x86_64) Supported
macOS Not supported
Windows Not supported

Prerequisites

  • uv (Python environment management)
  • Podman or Docker (container builds)
  • Python 3.13+
  • OSMesa (runtime dependency for headless rendering) — installed automatically by dmlab-gym build if missing
Manual OSMesa install
Distribution Command
Fedora / RHEL sudo dnf install mesa-libOSMesa or mesa-compat-libOSMesa
Bluefin / immutable sudo dnf install --transient mesa-compat-libOSMesa (resets on reboot)
Ubuntu / Debian sudo apt install libosmesa6
Arch sudo pacman -S mesa

Building

Quick Start

dmlab-gym build                        # build and install deepmind-lab
dmlab-gym build -o ~/my_output         # custom output directory
dmlab-gym build --no-install           # build only, skip install

This auto-detects Podman or Docker, builds the native extension inside a container, and installs the resulting wheel into your current environment.

Verify

python -c "import deepmind_lab; print('OK')"

Manual Build

If you prefer to run the steps yourself:

Podman:

podman build -t dmlab-builder -f Dockerfile.build .

mkdir -p /tmp/dmlab_pkg
podman run --rm \
    -v ./:/build/lab:Z \
    -v /tmp/dmlab_pkg:/output:Z \
    dmlab-builder \
    bash -c "
        bazel build -c opt //python/pip_package:build_pip_package \
            --define headless=osmesa && \
        ./bazel-bin/python/pip_package/build_pip_package /output
    "

Docker:

docker build -t dmlab-builder -f Dockerfile.build .

mkdir -p /tmp/dmlab_pkg
docker run --rm \
    -v ./:/build/lab \
    -v /tmp/dmlab_pkg:/output \
    dmlab-builder \
    bash -c "
        bazel build -c opt //python/pip_package:build_pip_package \
            --define headless=osmesa && \
        ./bazel-bin/python/pip_package/build_pip_package /output
    "

Project Structure

Directory Description
engine/ ioquake3 game engine (GPLv2)
q3map2/ Map compilation tools (GPLv2)
assets/ DeepMind Lab assets (CC BY 4.0)
assets_oa/ Open Arena assets (GPLv2)
game_scripts/ Lua game/level scripts
python/ Python C extension and pip package
deepmind/ Core DeepMind Lab code
public/ Public API headers
third_party/ Vendored dependencies
dmlab_gym/ Python package (CLI, utilities)
bazel/ Bazel build configuration
testing/ Test utilities
examples/ Example agent code

License

This project is a derivative work of DeepMind Lab and is distributed under the same licenses:

  • GPLv2 -- engine/, q3map2/, assets_oa/
  • CC BY 4.0 -- assets/
  • Custom academic license -- engine/code/tools/lcc/
  • BSD 3-Clause -- q3map2/libs/{ddslib,picomodel}

See LICENSE for full details.

Attribution

Based on DeepMind Lab by DeepMind.

If you use DeepMind Lab in your research, please cite the DeepMind Lab paper.

Upstream Sources

DeepMind Lab is built from the following open source projects:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmlab_gym-0.1.0.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmlab_gym-0.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file dmlab_gym-0.1.0.tar.gz.

File metadata

  • Download URL: dmlab_gym-0.1.0.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dmlab_gym-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8541d762f7eb6815349d9006681c18bb994e0ae20407d5aa968968bf443647ee
MD5 acf32080e7486bbae68713670a41637c
BLAKE2b-256 dba8312b038bb266382a19a430b23caed85506a9045492473d9c5cceb964eaa4

See more details on using hashes here.

File details

Details for the file dmlab_gym-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dmlab_gym-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dmlab_gym-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9bde9b467bc6aeafbad3c4e4466b923e5ec7adbfcb872ce8abf412e557e8336
MD5 d9d8ebd1f2530ee2f2648b2758de7561
BLAKE2b-256 6cfd2eb1961e7923eda5ce377a692c542d8adc31154aa9311c82d10d834f04b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page