Skip to main content
SDK Version: 2.5.0

Kubernetes Quickstart

New to Kubernetes? Start with the Kubernetes Beginner Guide, which explains each piece with a classroom analogy and hands-on examples.

Run DEEPX DX-M1 NPUs as native Kubernetes resources: request deepx.ai/dx-m1: 1 in a Pod spec and the scheduler places the Pod on an NPU node, with the device node and runtime libraries injected automatically.

Architecture​

host (per NPU node) k3s cluster
───────────────────── ─────────────────────────────────────────
dx-runtime/install.sh ──► driver (dxrt-driver-dkms) + firmware + dxrtd
containerd CDI enabled (enable_cdi=true, cdi_spec_dirs incl /etc/cdi)

Helm: dx-npu ──► NodeFeatureRule (PCI 1ff4 → deepx.ai/dx-m1.present)
└► device-plugin DaemonSet → advertises deepx.ai/dx-m1
├─ writes /etc/cdi/deepx.json (device node + libs + dxcli)
├─ writes NFD feature file → fw/driver version node labels
└─ serves deepx_npu_* Prometheus metrics on :9400
Pod requests deepx.ai/dx-m1: 1 → containerd injects /dev/dxrtN + runtime libs

Components (mirroring the proven NVIDIA stack layout):

ComponentRole
dx-k8s-device-pluginAdvertises deepx.ai/dx-m1, health checks, Pod allocation
CDI spec (generated by the plugin)Injects /dev/dxrtN, runtime libs, and dxcli into containers
NFD integrationNode labels: presence, count, product, firmware/driver versions
dx-npu Helm chartOne-command install/upgrade of all of the above

Prerequisites​

  1. Cluster tools. Skip this step if you already have a Kubernetes cluster plus kubectl and helm.

    # k3s — a single-binary Kubernetes; installs kubectl too
    curl -sfL https://get.k3s.io | sh -

    # use kubectl without sudo
    mkdir -p ~/.kube
    sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
    sudo chown "$USER" ~/.kube/config
    # k3s's kubectl reads /etc/rancher/k3s/k3s.yaml (root-only) unless KUBECONFIG is set
    echo 'export KUBECONFIG=~/.kube/config' >> ~/.bashrc
    export KUBECONFIG=~/.kube/config

    # helm
    curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

    # jq — only used by the check commands in these docs
    sudo apt-get install -y jq

    kubectl get nodes # STATUS Ready
    helm version

    On vanilla Kubernetes, install kubectl from the official guide and helm from helm.sh.

  2. Each NPU node — host driver, firmware, and runtime:

    cd dx-runtime && ./install.sh --runtime-only
    dxcli -s # must list the NPU(s)
    # NPU pods run their own dxrtd; a host dxrtd on the same card makes them hang
    sudo systemctl disable --now dxrt.service

    The device plugin allocates each card to one Pod, and that Pod runs its own dxrtd. Keep the host dxrt.service stopped on NPU nodes — two dxrtd instances on one card leave in-Pod inference hanging. This makes the node Kubernetes-only for the NPU: host-side apps that need dxrtd will not run while the service is off.

    The CDI spec mounts the host libdxrt.so.3 and libonnxruntime.so.1 into every NPU Pod, so the node's DX-RT must be the same build as the DX-RT in the Pod image (dxcli --version on the host and in the image). A mismatch fails with undefined symbol errors.

  3. containerd CDI enabled. containerd 2.x turns CDI on by default (enable_cdi = true, spec dirs /etc/cdi and /var/run/cdi), so there is nothing to do. Check the version:

    sudo k3s ctr version | grep -m1 Version # v2.x → done

    Only containerd 1.7 needs CDI switched on. On k3s, do not create config.toml.tmpl with just the CDI lines — k3s uses the template instead of its generated config, so the rest of the containerd settings would disappear. Start from the generated file and append:

    cd /var/lib/rancher/k3s/agent/etc/containerd
    sudo cp config.toml config.toml.tmpl
    sudo tee -a config.toml.tmpl <<'EOF'
    [plugins."io.containerd.grpc.v1.cri".cdi]
    enable_cdi = true
    cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"]
    EOF
    sudo systemctl restart k3s

    Either way, the smoke test below proves it: if /dev/dxrt0 shows up inside the pod, CDI works.

Install​

helm install dx-npu oci://ghcr.io/deepx-ai/charts/dx-npu \
-n dx-system --create-namespace --set nfd.enabled=true

Leave nfd.enabled=false (default) if the cluster already runs node-feature-discovery.

Verify the NPU is schedulable and labeled:

kubectl get node -o json | jq '.items[].status.allocatable' | grep deepx.ai/dx-m1
kubectl get node --show-labels | grep -o 'deepx.ai[^,]*'
# deepx.ai/dx-m1.present=true, .count, .product, .fw-version, .driver-version

Run a workload​

Smoke test (thin image — everything arrives via CDI):

kubectl apply -f deploy/k8s/samples/test-pod.yaml
kubectl logs -f dx-m1-test
# shows /dev/dxrt0 and full `dxcli -s` device status from inside the Pod

Real inference with the suite runtime image. An init container fetches one model into an emptyDir, then dxrun reports NPU time, latency, and FPS:

kubectl apply -f deploy/k8s/samples/inference-pod.yaml
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/dx-m1-inference --timeout=300s
kubectl logs dx-m1-inference -c inference

Any Pod becomes an NPU Pod with just a resource request:

resources:
limits:
deepx.ai/dx-m1: 1

Metrics​

The device plugin serves Prometheus metrics on :9400 (headless Service dx-npu-metrics): deepx_npu_up, deepx_npu_device_healthy, and per-core deepx_npu_core_{temperature_celsius,voltage_millivolts,clock_mhz}. Set metrics.serviceMonitor.enabled=true when prometheus-operator is present.

Troubleshooting​

SymptomCause / fix
deepx.ai/dx-m1 missing from allocatableDevice plugin Pod not running — check kubectl get pods -n dx-system and that the node carries deepx.ai/dx-m1.present=true
No deepx.ai/* node labelsNFD not installed — set nfd.enabled=true or install NFD; without NFD, label manually: kubectl label node <n> deepx.ai/dx-m1.present=true
Pod scheduled but /dev/dxrt* missingcontainerd CDI not enabled — apply the config.toml.tmpl change and restart k3s
dxcli reports no devices on hostDriver/firmware not installed — rerun dx-runtime/install.sh, then cold-boot if device init fails
Device reported unhealthyCard present in sysfs but absent from dxcli -s — usually needs a host power cycle
Inference Pod stays Running, dxrun never exitsHost dxrt.service is running on the node — sudo systemctl disable --now dxrt.service (Prerequisites, step 1)
dxrun: symbol lookup error: undefined symbol in a PodNode DX-RT and Pod image DX-RT differ — CDI mounts the host libdxrt.so.3; install the same DX-RT build on the node and in the image
GLIBC_2.xx not found running dxcli in a podThe Pod image's glibc is older than the host DX-RT that CDI injects — use ubuntu:24.04 or newer as the base (see the note below)
glibc required by the host DX-RT

CDI mounts the node's dxcli and libdxrt.so.3 into the Pod, so the Pod image needs at least the glibc those binaries were built against:

  • Prebuilt libdxrt-bin package: glibc ≥ 2.27
  • DX-RT built from source on the node: follows the node's glibc (e.g. GLIBC_2.38 on Ubuntu 24.04)

Check the actual requirement on the node with objdump -T /usr/local/bin/dxcli /usr/local/lib/libdxrt.so.3 | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1.

Full chart values and details: deploy/k8s/README.md.