Skip to content

Latest commit

 

History

569 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Mokka

Mokka

Simulate your GPU infrastructure on CPU nodes.

CI pipelines Documentation OpenSSF Scorecard OpenSSF Best Practices License

Mokka simulates the software contracts around NVIDIA devices rather than the devices themselves. The rule of thumb: reach for Mokka when your system reads hardware state and reacts to it, and for real hardware when it executes work, moves data, or measures performance.

That makes it a good fit for:

  • Kubernetes discovery and allocation through the device plugin or DRA — scheduling, ResourceClaims, CDI visibility, topology attributes.
  • Software that consumes NVML, nvidia-smi, DCGM or DCGM Exporter.
  • Monitoring dashboards, parsers, alerting, and remediation logic that cordons, drains, reschedules and recovers.
  • Repeatable fault injection — device loss, Xid errors, ECC errors, temperature, power, utilisation, clocks, and GPU-side NVLink errors.
  • Code that interprets declared PCI, NUMA, NVLink, fabric UUID or clique topology.
  • IMEX peer readiness and liveness over the pod network.

Use real hardware for CUDA execution, NCCL, GPUDirect and RDMA data paths, any throughput or thermal measurement, driver and firmware lifecycle, switch management planes, physically faithful fault timing, MIG partition lifecycle, and Confidential Computing.

Quick start

kind create cluster --name mokka

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

Every node now reports four mock GB300 GPUs. Swap in a100, b200, gb200, h100, l40s or t4 with --set gpu.profile=<name>.

Simulation depth by area breaks this down per surface — GPU and NVML, Kubernetes allocation, metrics, PCI and NUMA, NVLink, NVSwitch and Fabric Manager, and InfiniBand — with what each one does and does not prove.

Tested consumers

Consumer What works
Node Feature Discovery PCI vendor labels derived from the feature file Mokka writes
GPU Feature Discovery Node labels derived from NVML
NVIDIA Device Plugin Allocatable nvidia.com/gpu matches the profile, and workloads schedule against it
NVIDIA DRA Driver ResourceSlices report the right GPUs, and a ResourceClaimTemplate pod reaches Running
NVIDIA GPU Operator The full operand stack installs and its validator starts
DCGM / dcgm-exporter Telemetry, time-varying power, and injected Xid errors
Run:ai fake-gpu-operator Profile ConfigMaps published in the shape its discovery expects

Documentation

Visit our documentation website to find all details about how Mokka works.

Quick Start Install and see simulated GPUs
Architecture The moving parts and how the system behaves
Guides Device plugin, DRA, GPU Operator, failure injection, node-wide injection
Configuration Every profile knob
FAQ What Mokka simulates, and what it does not

Contributing

See the contributing guide for local development with Tilt, the test suites, and how to submit a change. Substantial changes start with a Mokka Enhancement Proposal.

Report vulnerabilities privately — see SECURITY.md, not the issue tracker.

Credits

  • Logo designed by Roman Hlushko with the assistance of OpenAI's ChatGPT.

License

Apache License 2.0 — see LICENSE.

About

Simulate NVIDIA infrastructure (e.g. GPU) on CPU nodes in Kubernetes ☕️

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

60 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages