Skip to content

Quick Start

Install Mokka on a Kubernetes cluster and watch nvidia-smi report GPUs that do not exist. Five minutes, no NVIDIA hardware.

Prerequisites

  • Helm 3.8 or newer — the chart is served from an OCI registry.
  • kubectl, pointed at the cluster you want to use
  • Docker and Kind, only if you want a throwaway, local cluster

Install

kind create cluster --name mokka

helm install nvml-mock \
    oci://ghcr.io/nvidia/k8s-test-infra/chart/nvml-mock \
    --namespace mokka \
    --create-namespace

Already have a cluster? Skip the kind line. The chart prepares each node's containerd itself, so any cluster whose nodes run containerd 1.7 or later under systemd works; see the Amazon EKS guide for a managed one.

On the default gb300 profile each node also downloads NVIDIA's IMEX archive from developer.download.nvidia.com, for DRA ComputeDomains. A node that cannot reach it keeps working without IMEX; add --set featureGates.IMEXDownload=false to skip the download.

Verify

kubectl exec -n mokka ds/nvml-mock -- nvidia-smi -L
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-...)

That is the real nvidia-smi binary, unmodified, reading Mokka's driver instead of a physical one. nvidia-smi -q works too, and reports the full profile.

Change the GPU model

gb300 is the default. Every node in the cluster takes the same profile:

helm upgrade nvml-mock \
    oci://ghcr.io/nvidia/k8s-test-infra/chart/nvml-mock \
    --namespace mokka \
    --set gpu.profile=a100

Seven profiles ship with the chart: a100, b200, gb200, gb300, h100, l40s and t4. Configuration covers what each one defines and how to change individual values.

Clean up

helm uninstall nvml-mock --namespace mokka
kind delete cluster --name mokka          # if you created one above

Next steps

You have a node that looks like it has GPUs. The interesting part is pointing real software at it.

To do this Go to
Schedule GPU workloads with the device plugin, DRA or the GPU Operator Installation
Break a GPU and watch consumers react Failure injection
Check that GPU workloads get the mock driver Set up NRI injection
Change temperature, power or health on a running node Runtime control
Understand what is actually happening Architecture

The node daemon installs the NVIDIA container runtime on each node and makes it containerd's default handler, nvidia, with the Container Device Interface (CDI) on. That is the runtime setup the device plugin, DRA and GPU Operator paths use; see Container runtime setup.