Skip to content

Run an NPU Pod

Request one NPU and verify that it is visible inside a container.

Use the Device Plugin configuration. If the Operator is not installed, follow Installing the NPU Operator.

Available NPU count

To check how many NPUs remain available on a node, run kubectl describe node <NODE_NAME> and compare Allocatable with Allocated resources. Allocatable includes NPUs that are already allocated.

1. Create the Pod

Create the npu-tutorial namespace and a Pod.

kubectl create namespace npu-tutorial --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: v1
kind: Pod
metadata:
  name: first-npu
  namespace: npu-tutorial
spec:
  containers:
  - name: ubuntu
    image: ubuntu:22.04
    command: ["sleep", "infinity"]
    resources:
      limits:
        rebellions.ai/npu: 1
EOF

The first line of the output depends on whether the namespace already exists.

Creation result
namespace/npu-tutorial configured
pod/first-npu created

Wait for the new Pod to become Ready.

$ kubectl wait -n npu-tutorial --for=condition=Ready pod/first-npu --timeout=180s
pod/first-npu condition met

2. Verify the device

Check the assigned node and the requested NPU count.

$ kubectl get pod -n npu-tutorial first-npu \
  -o 'custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,NPUS:.spec.containers[0].resources.limits.rebellions\.ai/npu'
NAME        NODE            NPUS
first-npu   node-rebel100   1

$ kubectl exec -n npu-tutorial first-npu -- rbln-smi -L
NPU 0 : RBLN-CR13 (UUID: NPU-34428712-d887-840b-a7b9-1c9e05807fc3)
$ kubectl get pod -n npu-tutorial first-npu \
  -o 'custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,NPUS:.spec.containers[0].resources.limits.rebellions\.ai/npu'
NAME        NODE        NPUS
first-npu   node-atom   1

$ kubectl exec -n npu-tutorial first-npu -- rbln-smi -L
NPU 0 : RBLN-CA25 (UUID: NPU-c5ba8327-5b18-847e-953e-4ca4b4daeb44)

The check passes when the container lists the one NPU requested by the Pod.

Pod creation fails

  • If the Pod stays Pending, check Events with kubectl describe pod -n npu-tutorial first-npu. Insufficient rebellions.ai/npu means no eligible node has enough available NPUs.
  • If rbln-smi is missing or shows no device, check the Container Toolkit and Device Plugin Pods on the assigned node. See Operator observability.

Clean up

$ kubectl delete pod -n npu-tutorial first-npu
pod "first-npu" deleted

Deleting the Pod makes the NPU available to other Pods.