How to Validate an AI Factory Software Stack Before Hardware Arrives
AI factory infrastructure combines advanced data center components, but validating all software layers traditionally requires access to the physical cluster. NVIDIA Mokka and th...
By Hardware Team
AI factory infrastructure combines advanced data-center components, but validating all software layers traditionally requires access to the physical cluster. NVIDIA Mokka and the NVIDIA DSX Air simulation platform provide a way to test much of the Kubernetes GPU stack before hardware delivery.
Operations teams can use simulation to answer questions such as:
- Can GPU Operator install and validate against a specific driver version and GPU profile?
- Does each node report the NVLink domain required for topology-aware scheduling?
- When a GPU reports Xid 79, is the correct GPU identified on the correct node?
- Do ResourceClaims allocate and release as expected?
NVIDIA Mokka is an open source project that simulates NVIDIA GPU infrastructure on CPU nodes in Kubernetes. When combined with NVIDIA DSX Air, it can simulate an AI factory, allowing teams to rehearse cluster bring-up, validate configurations, and test failure handling before production deployment.
The approach is useful for software that discovers, schedules, or monitors GPUs, including device plugins, DRA drivers, health monitors, and remediation controllers. Simulated GPUs can be used in continuous integration environments or shared laboratories.
What Is NVIDIA Mokka?
NVIDIA Mokka simulates GPUs, SuperNICs, and switch fabrics on ordinary CPU nodes. The project source is available in the NVIDIA/k8s-test-infra repository, with documentation at nvidia.github.io/k8s-test-infra.
Mokka is not a GPU emulator. It does not run CUDA kernels or move data. Instead, it simulates the interfaces between GPUs and higher-level software, allowing that software to run without modification and without being aware of the simulation.
How Mokka Simulates a GPU Node
GPU software discovers and monitors hardware through NVML, sysfs, device nodes, and kernel-module state. Mokka serves these interfaces from a GPU profile, allowing the same software to run on a CPU node and respond to simulated GPU state.
On each CPU node, the Mokka node agent stages:
- A mock
libnvidia-ml.sothat answers NVML calls using a GPU profile instead of a physical driver - A PCI tree and
sysfshierarchy containing simulated GPUs - Driver and kernel-module footprints under
/procand/sys, includingnvidia,nvidia_uvm, andmlx5_core - CDI specifications, device nodes, NVLink and Fabric Manager state, IMEX for multi-node NVLink, and InfiniBand devices
The unmodified nvidia-smi can therefore run on a CPU node and report four NVIDIA GB300 NVL72 Blackwell GPUs. These represent one compute tray of a GB300 NVL72 rack, including matching NVLink topology and rack position.
The NVIDIA device plugin, DRA driver, DCGM, node feature discovery, topograph, Slurm through Slinky, NVSentinel, and GPU Operator interact with the same files and libraries they use on physical nodes.
Running Mokka on NVIDIA DSX Air
Mokka alone can turn a laptop or CI runner into a small simulated GPU cluster. Some failures, however, require a network fabric, realistic topology, and more hosts than can conveniently run on a local machine. NVIDIA DSX Air provides that broader simulation environment.
DSX Air logically simulates a complete AI factory ecosystem. It models NVIDIA Spectrum-X network topology, ecosystem software, and server images. The environment can be controlled through a Python SDK or REST API.
Adding Mokka to DSX Air introduces simulated GPUs to the environment. DSX Air maps servers to switches, while Mokka assigns each node's GPUs to NVLink domains and cliques, driving IMEX and DRA ComputeDomains. When both systems describe the same racks, schedulers can use realistic placement distances.
Network teams using DSX Air for fabric validation can add Mokka to server nodes and create a GPU cluster in the same simulation. File-based and API-driven simulations can be checkpointed before destructive tests, shared with other users, expanded through topology edits, and managed by CI. They also provide an isolated environment for remediation practice and training.
Key benefits include:
- Repeatable tests: Define topology and GPU profiles in files, then use checkpoints to return to a known state.
- Shared environments: Give colleagues, partners, and support engineers access to the same simulated configuration.
- Simulation reuse: Add Mokka to server nodes in an existing DSX Air network lab to test GPU software alongside the fabric.
- Larger test fleets: Expand simulated topologies on CPU-backed infrastructure and compare profiles such as H100 and GB300 without reserving physical GPUs.
- Training and fault testing: Practice remediation, onboarding, and qualification workflows in an isolated environment.
- Pipeline automation: Create a simulation, install the software stack, inject faults, and remove the environment through APIs in a CI workflow.
Example Use Cases for Mokka on DSX Air
Mokka on DSX Air can be used to rehearse failures, identify scale limits, test Day 2 changes in a pipeline, and compare infrastructure designs.
Rehearsing Failures
Teams can set a GPU to lost, fallen_off_bus, or ecc_uncorrectable, queue an Xid, and verify that remediation controllers cordon or drain the affected node, or generate the expected page. DCGM, dcgm-exporter, Prometheus, and Grafana can run without modification, allowing alerts and dashboards to be tested with the remediation controller.
Finding Scale Limits Early
Every stack component has a scale limit. Expanding a simulated fleet from 36 nodes to 288, 1,152, and 2,304 can reveal which processes grow with the environment. The bottleneck may be a single-replica labeler, a MongoDB memory limit, or a conntrack table rather than Kubernetes itself.
Testing Day 2 Changes in a Pipeline
Remediation policies, configuration changes, and topology edits can affect a running cluster. Because each simulation step can be performed through an API, these changes can be tested in a pipeline instead of being grouped exclusively into maintenance windows:
- A pull request proposes a change, such as an NVSentinel policy, a device plugin setting, or a topology edit.
- DSX Air builds the fleet from the committed topology, Mokka stages GPUs on every node, and the current production stack is installed.
- The pipeline applies the change and verifies that health monitoring detects an injected Xid 79 on the correct node, GPU claims allocate and release correctly, and nodes have the expected labels.
- The simulation is deleted.
The Mokka CI setup uses standard CPU runners and includes jobs for DRA, ComputeDomains, GPU Operator, multinode, NRI injection, NFD, MIG, and vGPU.
Comparing Designs
Rack layouts and NVLink domain boundaries can be expensive to change after cabling. Simulated topologies make it possible to compare scheduler placement and rack-failure effects while the designs remain simple file edits.
Getting Started with NVIDIA Mokka
The basic workflow has four steps. The first three run on a local Kind cluster and require no NVIDIA hardware: installing Mokka, checking the simulated GPUs, and injecting a failure. The fourth step launches a Mokka lab in NVIDIA DSX Air and does not depend on the first three steps.
Step 1: Install Mokka on a Local Cluster
The local setup requires Helm 3.8 or later and kubectl. Creating a Kind cluster also requires Docker and Kind.
Create a Kind cluster and install the chart:
kind create cluster --name mokka
helm install nvml-mock \
oci://ghcr.io/nvidia/k8s-test-infra/chart/nvml-mock \
--namespace mokka --create-namespace
Any cluster whose nodes run containerd 1.7 or later under systemd can also be used.
Step 2: Check the Simulated GPUs
Check the simulated GPUs with:
kubectl exec -n mokka ds/nvml-mock -- nvidia-smi -L
A result can look like this:
GPU 0: NVIDIA GB300 NVL (UUID: GPU-...)
GPU 1: NVIDIA GB300 NVL (UUID: GPU-...)
GPU 2: NVIDIA GB300 NVL (UUID: GPU-...)
GPU 3: NVIDIA GB300 NVL (UUID: GPU-...)
The chart includes eight profiles: a100, b200, gb200, gb300, h100, l40s, t4, and vrnvl72. Set gpu.profile to switch between them.
Step 3: Inject a Failure
nvml-mock-ctl changes GPU state on a running node without requiring a redeployment. The following command marks GPU 0 with an uncorrectable ECC error and delivers Xid 79:
kubectl exec -n mokka ds/nvml-mock -- \
nvml-mock-ctl fail --gpu 0 --mode ecc_uncorrectable --xid 79
The device plugin marks the GPU unhealthy, DCGM exports the Xid, and nvidia-smi displays the error. With Prometheus and Grafana installed, the fault also appears on the dashboards used for production monitoring.
Step 4: Move to DSX Air
The DSX Air integration is available through two DSX Air demo marketplace environments:
| Demo | Use |
|---|---|
| Kubernetes Intro: Mokka plus KWOK Configured | Explore a cluster that is already configured |
| Kubernetes Intro: Mokka plus KWOK Unconfigured | Complete the setup using the lab instructions |
Launching a demo creates a copy in the user's DSX Air account. The accompanying documentation covers credentials and cluster access.
Users sign in with an NGC account and need the Air User or Air Org Admin role in the organization. After launching a demo, they must wait until the simulation's Topology tab shows Active. They can then open the console of the node named in the lab instructions to inspect and build the digital twin.
The Mokka on DSX Air guide covers the remaining steps, including saving a checkpoint for later use.
Validating the AI Factory Software Stack
Combining NVIDIA Mokka with NVIDIA DSX Air allows teams to test GPU software, network topology, failure handling, and Day 2 changes in a simulated environment before physical infrastructure becomes available. Simulation does not replace testing on real hardware, but it moves important validation earlier, when problems can be addressed before deployment.
Relevant resources include:
- The NVIDIA/k8s-test-infra GitHub repository for NVIDIA Mokka
- The Mokka on DSX Air guide
- Documentation for GPU Operator, DRA driver, failure injection, NVSentinel, and CI/CD