Request NPUs with DRA¶
Request one NPU through a Dynamic Resource Allocation (DRA) ResourceClaimTemplate and verify the allocated device inside a Pod. To specify a count, product name, PCIe topology, or UUID, see Specify NPU allocation conditions with DRA.
Use the DRA configuration. If the Operator is not installed, follow Installing the NPU Operator.
1. Create the claim template and Pod¶
Create the npu-tutorial namespace, a ResourceClaimTemplate, and a Pod.
Use npu as the name in both resources.claims and resourceClaims to link the container to its claim.
2. Verify the device¶
Wait for the Pod, then check the claim allocation and the device inside the container.
$ kubectl wait -n npu-tutorial --for=condition=Ready pod/dra-npu --timeout=180s
pod/dra-npu condition met
The check passes when the claim has an allocation and the container lists one NPU.
Clean up¶
Delete the Pod and ResourceClaimTemplate. The claim generated for the Pod is deleted automatically.