AI lab, part 1: a GB200 NVL72-style cluster, scaled down to your laptop
A GPU cluster modelled on NVIDIA GB200 NVL72, scaled down to two compute trays and emulated on a single Linux machine: what it is, what you can practise with it, and how to set it up. Most of the work in AI infrastructure isn’t the GPUs themselves. It’s everything around them: For systems and software engineers, this is hard to learn: you can’t practise on a GB200 rack you don’t have, and cloud GPU instances hide exactly these layers. ai-lab is my attempt at a way around that. It’s a complete GPU cluster that runs on a single Linux machine. The GPUs are emulated, but everything around them is real: the scheduler, the frameworks and the tools are the real software, unmodified. They run against a model of what a GB200 NVL72 rack, scaled down to two compute trays, shows to software (its APIs, topology, telemetry, timing and failures), not against the silicon. This is called software-in-the-loop testing. I call the scaled-down version NVL8, which is the lab’s own name, not an NVIDIA product. That works because most of those layers never use a GPU for computation: All of that works against GPUs that answer the right API calls, whether or not GPU kernels ever actually execute. It’s like a stub in a unit test: the GPU stack is replaced with an implementation of the same APIs, and the rest of the cluster runs against it unchanged. What is real and what is modelled below has the details. The hardware side is one NVL8 NVLink domain: an 8-GPU slice of a GB200 NVL72-style domain, with two compute trays and one NVLink switch tray. NVLink is NVIDIA’s GPU-to-GPU interconnect, and an NVLink domain is a set of GPUs that can all reach each other over it, even across trays, without going through the network. It’s the unit a scheduler has to respect when it places a multi-GPU job. The lab’s domain has: On top of that hardware runs the software of a real GPU cluster: Everything runs in Incus containers, set up by Ansible behind a The emulated hardware is set by variables. The lab’s size (trays, GPUs per tray, switches) is fixed. “Hardware parameters” in the lab’s Each GPU tray has The hardware and NVIDIA’s software are modelled: Timing is a behavioural model, not a prediction. Durations come from NVIDIA’s published GB200 figures (dense compute rates per precision, memory, NVLink and InfiniBand bandwidth) applied to each operation’s size. NVIDIA doesn’t publish an FP32 rate without tensor cores, so that one is an estimate. Jobs take a plausible time and put a plausible load on the GPUs and links, but the figures aren’t calibrated against hardware and don’t predict real GB200 performance. The full list is under “What is real and what is modelled” in the lab’s README. Read it as a table: each row and each column is one of the tray’s four GPUs, and each cell says how that pair is connected. The table shows the lab’s current state, so it changes when the hardware does. Disable two of a GPU’s NVLinks through the BMC, and A change travels through the whole stack the way it would on a real cluster. This is what happens when one tray is moved into an NVLink partition of its own (Part 5): The times come from the timing model, so what matters is the chain of effects and their direction, not the exact numbers. You don’t need a GPU, an NVIDIA driver or a cloud account. Clone the repository and check the host first: If something is missing, Prepare the host side (Ansible venv, secrets, Go builds, and your settings file Choose the scheduler. Then build the cluster: To switch the scheduler on a built cluster, run The containers install their packages from Ubuntu’s main mirror. If it’s slow or times out from your network, set a closer Ubuntu mirror in If you use an AI coding agent such as Claude Code, Codex or Cursor, you can ask it to set up the lab. The repository’s When These map one to one onto the overview picture: the two GPU trays are The lab has one regular user, The repository’s A tray looks like any other GPU node: All of these values come from the stub NVML, including the driver version, the 189,471 MiB of memory and the 1,200 W power limit. The trays idle at about 140 W and 32 °C. Start a job and those numbers climb, and the same values show up in Prometheus ( Part 2: Slurm covers the scheduler: how Slurm is configured for GPUs, running jobs from All parts
Table of contents
Overview
CUDA_VISIBLE_DEVICES for each job.
What the lab is made of
Makefile. These are the same components a real cluster runs, except the Kubernetes device plugin, which the lab replaces with its own (Part 3).inventory/group_vars/all.yml has the defaults, the GB200 values used throughout this series. To change one, add it to local.yml and run make configure, which applies it without rebuilding the lab:docs/platform.md links to every variable.What is real and what is modelled
/dev/nvidia0-3 and stub versions of NVIDIA’s software: the CUDA driver, NVML, cuBLAS, cuDNN, NCCL and nvidia-smi. The stubs implement the real APIs, so PyTorch and Ray run unmodified on top of them. Everything above the stubs is real:--segment and BlockSizes). And k3s gets its GPUs from the lab’s own device plugin rather than NVIDIA’s.nvidia-smi report the GPU’s identity, NVLink state, NVLink partition, NUMA layout and processes, and support GPU reset. Utilisation, power and temperature follow a model of the load, not measured curves.scontrol show node reports Arch=x86_64 where a GB200 tray would report aarch64.nvidia-smi topo -m shows how the GPUs in one tray are connected to each other. Here it runs on the first GPU tray, sched-worker1:$ bin/ssh sched-worker1 nvidia-smi topo -m
GPU0 GPU1 GPU2 GPU3 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X NV18 NV18 NV18 0-1 0 2
GPU1 NV18 X NV18 NV18 0-1 0 10
GPU2 NV18 NV18 X NV18 6-7 1 18
GPU3 NV18 NV18 NV18 X 6-7 1 26X: the GPU itselfNV18: the two GPUs are connected through 18 NVLinks, which carry their traffic together. At 50 GB/s per link, that’s 900 GB/s in each directionCPU Affinity: the CPU cores closest to the GPU. The lab splits each tray’s cores between its two emulated Grace CPUs, so GPUs 0-1 get the first half and GPUs 2-3 the second; the numbers depend on which host cores the tray was givenNUMA Affinity: the NUMA node of the CPU closest to the GPU. A GB200 tray has two Grace CPUs, so GPUs 0-1 sit next to node 0 and GPUs 2-3 next to node 1GPU NUMA ID: the NUMA node of the GPU’s own memory (2, 10, 18 and 26). On GB200, the Grace CPU and the GPU can read and write each other’s memory directly, so Linux treats each GPU’s memory as another NUMA node: memory without CPUs, further from the CPU than its ownNV18 becomes NV16 for that GPU (Part 4).nvidia-smi --query-gpu=fabric.cliqueId).
What you can practise
topology/block) or a real Kubernetes setup (device plugin, GPU Feature Discovery, Kueue topology-aware scheduling, JobSet).make up && make test builds and verifies the whole cluster from scratch.Requirements
make, Python 3, Go, jq and gitincus-admin groupmake up gives each GPU tray cores of its own, so the trays don’t slow each other down)/var/lib/incus, including a 5.6 GB PyTorch/Ray virtualenvSetup
git clone https://github.com/arkady-emelyanov/ai-lab.git && cd ai-lab
make checkmake check prints the command for you to run. Usually that’s adding your user to a group, an AppArmor rule for Incus DNS, or raising a couple of kernel limits. Run make check again until it passes:$ make check
host readylocal.yml):make initlocal.yml holds your settings, and one line in it picks the scheduler:scheduler: slurm # or: k3smake up # create and configure the cluster (~15 minutes)
make frameworks # PyTorch + Ray on the shared volume (optional, several GB)
make test # end-to-end checksmake down, change the line, then make up. Volumes survive the rebuild, so homes, the frameworks venv and object data are kept. The two modes never run side by side, but everything below the scheduler (GPUs, BMCs, fabric, storage, monitoring) is identical.local.yml and run make up again. It continues where it stopped:apt_mirror: http://mirrors.ocf.berkeley.edu/ubuntuAGENTS.md tells it how: check the host without changing it, ask you once for the commands that need root and why, then build. For a running lab, the ai-lab skill teaches the agent to run jobs, check GPUs, change NVLink partitions and query metrics, and to leave the lab as it found it. Claude Code picks the skill up automatically in the repository.First contact
make up finishes, you have nine containers, each with a pinned address:$ incus list --all-projects -c ns4 -f compact
NAME STATE IPV4
sched-control RUNNING 10.107.111.10 (eth0)
sched-login RUNNING 10.107.111.11 (eth0)
sched-nvswitch RUNNING 10.107.111.34 (eth0)
sched-nvswitch-bmc RUNNING 10.107.111.33 (eth0)
sched-storage RUNNING 10.107.111.12 (eth0)
sched-worker1 RUNNING 10.107.111.21 (eth0)
sched-worker1-bmc RUNNING 10.107.111.31 (eth0)
sched-worker2 RUNNING 10.107.111.22 (eth0)
sched-worker2-bmc RUNNING 10.107.111.32 (eth0)sched-worker1 and sched-worker2, the switch tray is sched-nvswitch, and every tray has its own -bmc container.joe, an OpenLDAP account that works on every node. The rest of the series uses joe for everything a cluster user would do.bin/ folder has small helper scripts for working with the lab from the host. bin/ssh logs in to a container with the lab’s SSH keys, and bin/redfish sends a request to a tray’s BMC. They find each container’s address in Incus, so you never type an IP address:bin/ssh login # login node as joe
bin/ssh root@sched-worker1 # any instance as root, with the generated admin key
bin/redfish sched-worker1 /redfish/v1/Systems/System_0 # a tray's BMC over Redfish (Part 4)$ bin/ssh sched-worker1 nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.95.05 Driver Version: 580.95.05 CUDA Version: 13.0 |
+-----------------------------------------+------------------------+----------------------+
…
| 0 NVIDIA GB200 On | 0000:18:00.0 Off | 0 |
| N/A 32C P8 138W / 1200W | 512MiB / 189471MiB | 0% Default |
…http://10.107.111.10:9090) and Grafana (http://10.107.111.10:3000, user admin, password in .secrets/grafana.pass). Keep the Lab overview dashboard open while you work through the rest of the series.Next in the series
srun up to PyTorch DDP across both trays, draining and resuming nodes, and watching it all in Prometheus.