Plan GPU Capacity with GPU Monitoring
This product is not supported for your selected
Datadog site. (
).
Join the Preview!
Capacity Planning in GPU Monitoring is in Early Access Preview. Complete the form to request access.
Request AccessOverview
When many teams share pools of expensive GPUs, it is hard to see which teams are underusing their devices. It is also hard to spot resource contention and to tell why jobs are stuck pending. The Capacity Planning page in GPU Monitoring gives platform teams and workload owners one shared view of GPU provisioning across queues. No manual filtering or querying is required. Use it to run workloads reliably and get more out of your GPU fleet.
With the Capacity Planning page, you can answer questions such as:
- Which teams or projects are over- or underusing their quota? Find unused quota and reallocate compute fairly across your organization.
- Which GPU types are oversubscribed? Identify where demand exceeds quota so you can add capacity.
- What is the current state of a workload? See whether each workload is admitted, pending, or evicted, and how many GPUs it uses.
- Why is a workload delayed or evicted? Correlate pending and preempted workloads with quota and contention in their queue.
Prerequisites
To use the Capacity Planning page, you must meet the following criteria:
Setup
The Capacity Planning page combines two sources of data:
- Kueue metrics, such as GPU quota and usage for each ClusterQueue. The Kueue integration collects these metrics.
- GPU Monitoring metrics tagged with Kueue metadata, such as the Kueue workload and resource flavor that each GPU is allocated to. The Cluster Agent collects this metadata.
Complete the following steps to collect both.
Collect Kueue metrics
- In the Kueue configuration, set
metrics.enableClusterQueueResources: true and restart the Kueue controller manager. Kueue reports ClusterQueue quota and usage metrics, such as kueue.cluster_queue.nominal_quota.gpu and kueue.cluster_queue.resource_usage.gpu, only when this setting is enabled. The Capacity Planning graphs require these metrics. - Install the Kueue integration and configure the Kueue check as a cluster check. For instructions, see the Kueue integration documentation.
- Confirm that the Kueue check runs successfully on its assigned Agent and reports quota and usage metrics before continuing. For steps to check discovery, dispatching, and Agent status, see Troubleshooting Cluster and Endpoint Checks.
The Cluster Agent reads Kueue ClusterQueue, LocalQueue, ResourceFlavor, and Workload resources. It tags GPU metrics with the Kueue workload, queue, and resource flavor that each GPU is allocated to. To collect this metadata, grant the Cluster Agent read access to Kueue resources, then enable Kueue metadata collection.
Grant the Cluster Agent access to Kueue resources
Find the name of the Cluster Agent service account. The Cluster Agent deployment name ends in -cluster-agent:
kubectl get deployments -n <DATADOG_NAMESPACE> -o custom-columns=NAME:.metadata.name,SERVICE_ACCOUNT:.spec.template.spec.serviceAccountName
Create a file named datadog-cluster-agent-kueue-rbac.yaml with the following content. Replace <CLUSTER_AGENT_SERVICE_ACCOUNT> with the service account name from the previous step, and <DATADOG_NAMESPACE> with the namespace where the Datadog Agent is installed.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: datadog-cluster-agent-kueue
rules:
- apiGroups:
- kueue.x-k8s.io
resources:
- clusterqueues
- localqueues
- resourceflavors
- workloads
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: datadog-cluster-agent-kueue
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: datadog-cluster-agent-kueue
subjects:
- kind: ServiceAccount
name: <CLUSTER_AGENT_SERVICE_ACCOUNT>
namespace: <DATADOG_NAMESPACE>
Apply the file:
kubectl apply -f datadog-cluster-agent-kueue-rbac.yaml
These examples enable cluster_agent.kueue.enabled through the equivalent DD_CLUSTER_AGENT_KUEUE_ENABLED environment variable.
Choose the tab that matches how you manage the Cluster Agent. Merge the example into your existing configuration, preserving its other settings.
In your DatadogAgent resource, set the DD_CLUSTER_AGENT_KUEUE_ENABLED environment variable on the Cluster Agent:
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
override:
clusterAgent:
env:
- name: DD_CLUSTER_AGENT_KUEUE_ENABLED
value: "true"
Apply your changes. The Datadog Operator redeploys the Cluster Agent with the new configuration.
kubectl apply -n <DATADOG_NAMESPACE> -f datadog-agent.yaml
In your datadog-values.yaml file, set the DD_CLUSTER_AGENT_KUEUE_ENABLED environment variable on the Cluster Agent:
clusterAgent:
env:
- name: DD_CLUSTER_AGENT_KUEUE_ENABLED
value: "true"
Upgrade your Helm release. Helm redeploys the Cluster Agent with the new configuration.
helm upgrade -n <DATADOG_NAMESPACE> -f datadog-values.yaml <RELEASE_NAME> datadog/datadog
In your existing Cluster Agent Deployment manifest, add the following entry to the Cluster Agent container’s env list under spec.template.spec.containers:
- name: DD_CLUSTER_AGENT_KUEUE_ENABLED
value: "true"
Apply the updated manifest. Replace cluster-agent-deployment.yaml with your manifest’s filename. Kubernetes rolls out the updated Cluster Agent pods.
kubectl apply -n <DATADOG_NAMESPACE> -f cluster-agent-deployment.yaml
Verify the setup
After Kueue-managed workloads start running on GPUs:
- In the Metrics Explorer, filter by
kube_cluster_name and kueue_cluster_queue for the cluster and ClusterQueue you configured. Query kueue.cluster_queue.nominal_quota.gpu and kueue.cluster_queue.resource_usage.gpu. If either metric has no data, check the Kueue check configuration and the metrics.enableClusterQueueResources setting. - Using the same filters, query
gpu.gr_engine_active grouped by kueue_workload and kueue_resource_flavor. Confirm that your running workload and its resource flavor appear. If either is missing, check that Kueue metadata collection is enabled. Also inspect the Cluster Agent logs for permission errors on kueue.x-k8s.io resources. - Open the Capacity Planning page and filter to the same cluster and ClusterQueue. Confirm that the queue and running workload appear.
Explore the Capacity Planning page
To get started, navigate to the Capacity Planning page in GPU Monitoring.
Filter by team and queue
Use the filters at the top of the page to scope the view. You can filter by Team, Cluster Name, Cluster Queue, Resource Flavor, Provider, Datacenter, and Environment. Save a filtered view to return to it later.
Quota and utilization
The graphs at the top of the page show how GPU quota is used across your fleet:
| Graph | Description |
|---|
| GPU Quota Unallocated - Count | Number of GPUs in quota that are not in use, grouped by ClusterQueue. |
| GPU Quota Unallocated - Percent | Percentage of GPU quota that is not in use, grouped by ClusterQueue. |
| Idle Allocated GPUs | Number of allocated GPUs that are not doing engine work, grouped by ClusterQueue. |
| Preemption Rate | Workloads evicted by preemption per admitted workload, grouped by ClusterQueue. |
| Fleet GPU Coverage | Allocated GPU quota split into active, idle, and unattributed devices across the fleet. |
| Saturation - GPUs Over Quota | ClusterQueue and ResourceFlavor pairs ranked by the number of GPUs used beyond their nominal quota. |
Queues with high unallocated quota or many idle allocated GPUs are candidates for reallocation. Queues that consistently run over quota, or have a high preemption rate, may need more capacity.
Queues and workloads
The table at the bottom of the page has two tabs:
- Queues: Lists each queue with its quota and usage.
- Workloads: Lists each workload with its team, cluster, ClusterQueue, GPU usage by resource flavor, and latest status, such as Admitted.
Use the Workloads tab to check the current state of a workload and to investigate workloads that are pending or were evicted.
Further reading
Additional helpful documentation, links, and articles: