Here are the most common ways to check how many GPUs a Kubernetes node “advertises” (Capacity) and how many are still free to schedule (Allocatable / in–use).
1. Quick one-liner with kubectl get (jsonpath)
# Capacity (= total) and Allocatable (= free for scheduling)
kubectl get node <NODE_NAME> \
-o jsonpath='{.metadata.name}{"\t"}{.status.capacity.nvidia\.com/gpu}{"\t"}{.status.allocatable.nvidia\.com/gpu}{"\n"}'
# └──────────────┘ └───────── total GPUs ───────┘ └── allocatable ──┘
Example output
gpu-worker-01 8 8
gpu-worker-02 4 2
Tips
• Replace nvidia.com/gpu with whatever resource name your device-plugin uses (e.g. amd.com/gpu).
• You can list all nodes at once:
kubectl get nodes -o custom-columns=NAME:.metadata.name,\
CAP:.status.capacity.nvidia\.com/gpu,\
FREE:.status.allocatable.nvidia\.com/gpu
2. Human-readable view with kubectl describe node
kubectl describe node <NODE_NAME> | grep -A5 "Allocated resources"
Look for the “Capacity” and “Allocatable” blocks near the top; they will include a line like:
nvidia.com/gpu: 8
Farther down, under “Allocated resources”, you’ll see how many GPUs current pods are using.
3. kubectl top node (only if GPU metrics are exported)
kubectl top needs the Metrics-Server plus a GPU metrics exporter (DCGM, Prometheus adapter, or the latest NVML-based metrics-server forks). If set up:
kubectl top node --use-protocol-buffers
This can show per-GPU utilization, memory, temperature, etc. depending on your adapter.
4. Cluster-wide dashboard (Prometheus + Grafana)
If you run the NVIDIA DCGM exporter or kube-state-metrics you can build a Grafana dashboard that visualizes:
• Total GPUs per node (from kube_node_status_capacity metric)
• Allocatable GPUs (from kube_node_status_allocatable)
• In-use GPUs per pod / namespace (from kube_pod_resource_request & DCGM metrics)
Nice for multi–tenant clusters.
5. Old-fashioned SSH (nvidia-smi)
When you have node shell access:
ssh <NODE>
nvidia-smi -L # List GPUs
nvidia-smi -q | grep -E "Attached GPUs|UUID"
Remember: this shows physical devices, not what Kubernetes thinks is schedulable. Always check through the API for authoritative cluster data.
Why “nvidia.com/gpu”?
• Kubernetes treats GPUs as “extended resources”.
• The vendor-prefixed name (e.g. nvidia.com/gpu) is injected by a Device Plugin (NVIDIA device-plugin, AMD GPU-operator, etc.).
• Your pods request GPUs by adding:
resources:
limits:
nvidia.com/gpu: 2 # ask for 2 GPUs
If you don’t see the key, verify the device-plugin DaemonSet is running.
Happy scheduling! 🚀