NES EMULATOR
NeSLE
NeSLE is an open-source, GPU-native NES emulator and reinforcement-learning stack that runs many independent NES environments inside a single CUDA kernel for large-scale training (includes a vectorized SB3-compatible environment and an on-device PPO implementation).

WHY IT MATTERS
What it is
NeSLE emulates the NES (6502 CPU, PPU, bus, OAM DMA) entirely on CUDA so thousands of independent NROM consoles can be stepped in parallel on a single GPU. It is aimed at reinforcement learning workflows and provides device-resident observations, a Stable-Baselines3-compatible VecEnv, and a GPU-resident PPO implementation.
BEST FOR
Notable strengths
Extreme parallel throughput for RL (benchmarks in the repository show hundreds of thousands to millions of NES frames per second on modern CUDA GPUs), device-resident observations and rollouts to avoid host round-trips, and built-in training utilities (reset snapshots, curated action spaces, reward shaping, and example training scripts).
The people behind NeSLE
History & status
NeSLE is actively maintained in its GitHub repository. The project contains source for the CUDA emulation kernel, a reference C++ CPU backend, Python interfaces, examples, and documentation. The README and docs include benchmark re-measurements and a frozen requirements snapshot dated in 2026; the project lists active issues and recent commits. The repository is the authoritative source for current status and install instructions.
What NeSLE supports
- Linux (CUDA GPU; preferred for large training runs)
- Windows 11 (CUDA GPU; supported but notes a WDDM driver throughput ceiling)
- macOS (builds CPU core only)
- Requires CUDA Toolkit 12.x and a C++20 toolchain for CUDA builds
- Python 3.10+
Download and availability
OFFICIAL DOWNLOADS
Get NeSLE
Official releases and source are distributed via the project's GitHub repository and its Releases page. Source can be cloned from the GitHub repo and pip-installed as an editable package; prebuilt binary wheels are not provided by the project (follow the releases page or build steps in docs for platform-specific assets).
Get NeSLE ↗DOCUMENTATION
Official documentation
Read the official configuration, compatibility, and troubleshooting material before changing advanced options.
Read official documentation ↗NeSLE setup guide
Setup note: This setup guide follows the project's own instructions: you build the Python package, ensure a CUDA-capable PyTorch wheel is installed, then compile the CUDA extension for your GPU architecture. NeSLE does not include ROMs — supply a legally obtained iNES-format ROM (mapper 0) such as Super Mario Bros. for example workflows.
- 1) Clone the repository and create a virtual environment: git clone https://github.com/hbofz/NeSLE.git cd NeSLE python -m venv .venv && source .venv/bin/activate (Windows: .venv\Scripts\activate)
- 2) Install the package and development extras: Install the project in editable mode with the RL extras: python -m pip install -e '.[dev,rl]'. This pulls project dependencies but installs the CPU build of PyTorch by default (see next step).
- 3) Install a CUDA-capable PyTorch wheel (required for training on GPU): Because the 'rl' extra installs a CPU-only torch from PyPI, force-reinstall the CUDA wheel matching the project's expected CUDA toolchain. Example from the docs: python -m pip install –force-reinstall torch –index-url https://download.pytorch.org/whl/cu126. Verify with: python -c "import torch; print(torch.__version__, torch.cuda.is_available())" — expect a +cu126-style version and True for CUDA availability.
- 4) Build the CUDA extension: Run the included build script to compile the CUDA extension: python scripts/build_cuda_extension.py. The script auto-detects nvcc, MSVC, and the local GPU architecture via PyTorch. To override the target architecture, set NESLE_CUDA_ARCH (examples in docs: sm_80 for A100, sm_90 for H100). Rebuild after changes under cpp/; a stale compiled core may cause silent failures.
- 5) Windows and toolchain notes: On Windows use PowerShell-friendly command forms (join multi-line commands, adjust backslashes). If the build script cannot locate the MSVC toolchain, follow the project's build-windows.md guidance. The docs call out a Windows training-throughput ceiling under WDDM drivers — prefer Linux for large long-running training jobs.
- 6) Optional: use Docker: The repository includes a docker/cuda.Dockerfile for a CUDA build and test image; use this to avoid local toolchain complexity.
- 7) Run examples and training: The README contains usage examples for single environments and the vectorized VecEnv (nesle.make and nesle.make_vec), plus example training scripts: examples/native_ppo_train.py and examples/sb3_train.py. Use reset-state snapshots shipped under docs/data for curriculum-style training and fast auto-reset.
- 8) ROMs and legality: NeSLE does not distribute ROMs. Provide a legally obtained Super Mario Bros. ROM in iNES (mapper 0) format, typically named as the examples expect (e.g. "Super Mario Bros. (World).nes").
Software reminder: NeSLE requires a CUDA-capable GPU, CUDA Toolkit 12.x, a C++20 toolchain for building the extension, Python 3.10+, and a CUDA build of PyTorch for full GPU training. Follow the project's install.md precisely for architecture overrides and Windows adjustments.
Sources and further reading
Detailed guides and tutorials
Explore step-by-step guides for NeSLE as they are published.
Retro Replay Retro Gaming History, Reviews & Emulation
