Attach an NPU to a KubeVirt VM¶
Attach one ATOM™ or Rebel100™ NPU to a KubeVirt VM and verify it with rbln-smi inside the guest.
Use the VM passthrough configuration and complete the KubeVirt setup. If the Operator is not installed, follow Installing the NPU Operator.
1. Create the VM¶
Select the NPU family to use.
Adapt the node and PVC names to your environment. Set <VM_PASSWORD> to the password for console login as ubuntu.
Complete the permitted device configuration, then request an NPU by setting hostDevices.deviceName to the selected $NPU_RESOURCE.
Create a ResourceClaim requesting one NPU of the selected product through the vfio-npu.rebellions.ai DeviceClass. Reference the claim in the VM's resourceClaims and hostDevices.
Wait for the VM to become ready, then check its running state.
$ kubectl wait -n npu-tutorial --for=condition=Ready vm/npu-vm --timeout=300s
virtualmachine.kubevirt.io/npu-vm condition met
$ kubectl get vm -n npu-tutorial npu-vm \
-o 'custom-columns=NAME:.metadata.name,STATUS:.status.printableStatus,READY:.status.ready'
NAME STATUS READY
npu-vm Running true
Verify NPU allocation for the selected method.
Confirm that the virt-launcher Pod's compute container requests one NPU.
Check the NPU allocated to the vm-npu claim. Pool and device names depend on your environment.
Once the VM is Running and one NPU is allocated through the selected method, check the device inside the guest.
2. Verify the device in the guest¶
Connect to the guest console with virtctl console from a terminal on the management host.
| Management host | |
|---|---|
At the login prompt, sign in as ubuntu with the password set when creating the VM. Press Enter if the screen is blank.
The remaining steps assume that you have installed a supported kernel and the RBLN Driver for the selected NPU family inside the guest by following the driver installation guide.
Check the passed-through PCI device, driver version, and NPU inside the guest.
The check passes when the guest reports the driver version and one NPU.
Clean up¶
Log out of the guest, then press Ctrl+] to exit the console. Delete the VM from a terminal on the management host.
| Management host | |
|---|---|
If you used DRA, also delete the claim that was attached to the VM.