Skip to content

DRA: device class does not exist – pod stays Pending

GPUtested on kind v0.33.0 / Kubernetes v1.37.0, dra-driver-nvidia-gpu 0.5.1

A ResourceClaim refers to a DeviceClass via deviceClassName, for example gpu.nvidia.com. If the class does not exist, the scheduler cannot allocate anything and the pod waits – without any error when it was created.

Symptom

kubectl -n tag08 get pod tippfehler
NAME         READY   STATUS    RESTARTS   AGE
tippfehler   0/1     Pending   0          8s

Claim and pod (“typo”) were created without an error message, yet the pod stays Pending.

Diagnosis

First the scheduler's message, then the value in the claim.

kubectl -n tag08 describe pod tippfehler
0/3 nodes are available: request gpu: device class gpu.nvidia.de does not exist. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
kubectl -n tag08 get resourceclaim tippfehler -o jsonpath='{.spec.devices.requests[0].exactly.deviceClassName}{"\n"}'
gpu.nvidia.de

Causes

gpu.nvidia.deTypo in the DeviceClass name

The class is called gpu.nvidia.com. The API does not check on creation whether the class exists – the error only shows during scheduling.

field is immutableThe claim cannot be corrected

A ResourceClaim's spec is immutable. A patch is rejected.

kubectl -n tag08 patch resourceclaim tippfehler --type=json -p '[{"op":"replace","path":"/spec/devices/requests/0/exactly/deviceClassName","value":"gpu.nvidia.com"}]'
The ResourceClaim "tippfehler" is invalid: spec: Invalid value: null: field is immutable

Fix

Delete the claim and recreate it with gpu.nvidia.com. The pod waits until a claim with its name exists that can be allocated.
kubectl -n tag08 delete resourceclaim tippfehler
resourceclaim.resource.k8s.io "tippfehler" deleted from tag08 namespace

Don't: Delete the pod. It can stay – as soon as the claim with its name exists correctly, it starts.

▶
Break it yourself and find it – free
GPU infrastructure on Kubernetes, Day 8: Dynamic Resource Allocation with DeviceClass, ResourceClaim and the NVIDIA DRA driver.
Go to day 8 →

FAQ

Which DeviceClasses exist in the cluster?

kubectl get deviceclass lists them; the NVIDIA DRA driver creates gpu.nvidia.com among others.

Why does kubectl apply report no error?

The API only checks the claim's format, not whether the named DeviceClass exists. Only the scheduler notices.

Related error patterns

More