All Products
Search
Document Center

Container Service for Kubernetes:Best practices for monitoring cluster GPU resources

Last Updated:Jun 25, 2026

GPU monitoring uses NVIDIA Data Center GPU Manager (DCGM) to monitor the GPU nodes in your cluster. This topic describes how to view the monitoring results for three different GPU request modes.

Prerequisites

Background

GPU monitoring provides comprehensive monitoring for GPU nodes in a cluster. It offers monitoring dashboards at the cluster level, node level, and Pod level. For more information, see Dashboard description.

  • On the cluster-level GPU monitoring dashboard, you can view information about the entire cluster or specific node pools, such as cluster-wide utilization, GPU memory usage, and XID error detection.

  • On the node-level GPU monitoring dashboard, you can view information about a specific node, such as GPU details, utilization, and GPU memory usage.

  • On the Pod-level GPU monitoring dashboard, you can view information about a specific Pod, such as its requested GPU resources and utilization.

This topic demonstrates the monitoring results for three different GPU request modes.

Usage notes

  • GPU metrics are collected at a 15-second interval. This may cause a delay in the data displayed on the Grafana monitoring dashboards. As a result, the dashboard might show no available GPU memory on a node, yet a Pod is still successfully scheduled to it. This can happen if a running Pod releases its GPU resources between scrapes (within a 15-second window), and the scheduler places a pending Pod on the node before the next metric collection.

  • The monitoring dashboard tracks only GPU resources requested by configuring the resources.limits field in a Pod specification. For more information, see Manage Resources for Containers.

    The monitoring dashboard data may be inaccurate if you use GPU resources in any of the following ways:

    • Running GPU applications directly on the node.

    • Starting a container to run a GPU application by using the docker run command.

    • Requesting GPU resources for a Pod by setting the NVIDIA_VISIBLE_DEVICES environment variable, such as NVIDIA_VISIBLE_DEVICES=all or NVIDIA_VISIBLE_DEVICES=<GPU ID>, in the Pod's env section and then running a GPU program.

    • Running a GPU program in a Pod with privileged: true configured in its securityContext.

    • Running a GPU program in a Pod that does not have the NVIDIA_VISIBLE_DEVICES environment variable set, but the Pod's container image sets NVIDIA_VISIBLE_DEVICES=all by default.

  • The allocated GPU memory for a GPU card is not always the same as the used GPU memory. For example, a card has 16 GiB of total GPU memory, and you allocate 5 GiB of it to a Pod. If the Pod's startup command is sleep 1000, the Pod is in a Running state but will not use the GPU for 1,000 seconds. In this case, the allocated GPU memory is 5 GiB, but the used GPU memory is 0 GiB.

Step 1: Create node pools

The GPU monitoring dashboard can display metrics for Pods that request GPU resources by Full card or by GPU memory, including requests for computing power.

In this example, you will create three node pools in the cluster to demonstrate Pod scheduling and resource usage for different GPU request modes. For detailed instructions on how to create a node pool, see Create a node pool. The configurations for the node pools are as follows:

Parameter

Description

Example

Node Pool Name

The name of the first node pool.

exclusive

The name of the second node pool.

share-mem

The name of the third node pool.

share-mem-core

Instance Type

The instance type for the nodes. This example uses the TensorFlow Benchmark project, which requires 10 GiB of GPU memory. The selected instance type must provide more than 10 GiB of GPU memory.

ecs.gn7i-c16g1.4xlarge

Expected Nodes

The total number of nodes to maintain in the node pool.

1

Node Labels

This node pool is for Full card requests. No specific node label is required.

None

The label for the second node pool. This indicates that GPU resources are requested by GPU memory.

ack.node.gpu.schedule=cgpu

The label for the third node pool. This indicates that GPU resources are requested by GPU memory and supports computing power requests.

ack.node.gpu.schedule=core_mem

Step 2: Deploy GPU applications

After you create the node pools, run GPU test jobs on the nodes to verify that GPU metrics are collected correctly. For more information about the labels and scheduling relationships for each job, see Enable scheduling. The details of the three jobs are as follows:

Name

Node pool

GPU resources

tensorflow-benchmark-exclusive

exclusive

nvidia.com/gpu: 1

Requests one GPU card.

tensorflow-benchmark-share-mem

share-mem

aliyun.com/gpu-mem: 10

Requests 10 GiB of GPU memory.

tensorflow-benchmark-share-mem-core

share-mem-core

  • aliyun.com/gpu-mem: 10

  • aliyun.com/gpu-core.percentage: 30

Requests 10 GiB of GPU memory and 30% of the computing power of one GPU card.

  1. Create the Job manifest files.

    • Create a file named tensorflow-benchmark-exclusive.yaml with the following YAML content.

      apiVersion: batch/v1
      kind: Job
      metadata:
        name: tensorflow-benchmark-exclusive
      spec:
        parallelism: 1
        template:
          metadata:
            labels:
              app: tensorflow-benchmark-exclusive
          spec:
            containers:
            - name: tensorflow-benchmark
              image: registry.cn-beijing.aliyuncs.com/ai-samples/gpushare-sample:benchmark-tensorflow-2.2.3
              command:
              - bash
              - run.sh
              - --num_batches=5000000
              - --batch_size=8
              resources:
                limits:
                  nvidia.com/gpu: 1 # Requests one GPU card.
              workingDir: /root
            restartPolicy: Never
    • Create a file named tensorflow-benchmark-share-mem.yaml with the following YAML content.

      apiVersion: batch/v1
      kind: Job
      metadata:
        name: tensorflow-benchmark-share-mem
      spec:
        parallelism: 1
        template:
          metadata:
            labels:
              app: tensorflow-benchmark-share-mem
          spec:
            containers:
            - name: tensorflow-benchmark
              image: registry.cn-beijing.aliyuncs.com/ai-samples/gpushare-sample:benchmark-tensorflow-2.2.3
              command:
              - bash
              - run.sh
              - --num_batches=5000000
              - --batch_size=8
              resources:
                limits:
                  aliyun.com/gpu-mem: 10 # Requests 10 GiB of GPU memory.
              workingDir: /root
            restartPolicy: Never
    • Create a file named tensorflow-benchmark-share-mem-core.yaml with the following YAML content.

      apiVersion: batch/v1
      kind: Job
      metadata:
        name: tensorflow-benchmark-share-mem-core
      spec:
        parallelism: 1
        template:
          metadata:
            labels:
              app: tensorflow-benchmark-share-mem-core
          spec:
            containers:
            - name: tensorflow-benchmark
              image: registry.cn-beijing.aliyuncs.com/ai-samples/gpushare-sample:benchmark-tensorflow-2.2.3
              command:
              - bash
              - run.sh
              - --num_batches=5000000
              - --batch_size=8
              resources:
                limits:
                  aliyun.com/gpu-mem: 10 # Requests 10 GiB of GPU memory.
                  aliyun.com/gpu-core.percentage: 30  # Requests 30% of the computing power of one card.
              workingDir: /root
            restartPolicy: Never
  2. Run the following commands to deploy the Jobs:

    kubectl apply -f tensorflow-benchmark-exclusive.yaml
    kubectl apply -f tensorflow-benchmark-share-mem.yaml
    kubectl apply -f tensorflow-benchmark-share-mem-core.yaml
  3. Run the following command to check the status of the Pods:

    kubectl get pod

    Expected output:

    NAME                                        READY   STATUS    RESTARTS   AGE
    tensorflow-benchmark-exclusive-7dff2        1/1     Running   0          3m13s
    tensorflow-benchmark-share-mem-core-k24gz   1/1     Running   0          4m22s
    tensorflow-benchmark-share-mem-shmpj        1/1     Running   0          3m46s

    The output shows that all Pods are in the Running state, which indicates that the Jobs were deployed successfully.

Step 3: View the GPU dashboard

GPUs - cluster dimension

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Operations > Prometheus Monitoring.

  3. On the Prometheus Monitoring page, click the GPU Monitoring tab, and then click the GPUs - Cluster Dimension tab. The cluster-level monitoring dashboard shows the following information. For more information, see Cluster dimension monitoring dashboard.

    image

    No.

    Panel

    Description

    Total GPU Nodes

    There are 3 GPU nodes.

    Allocated GPUs

    A total of 1.9 out of 3 GPUs are allocated.

    Note

    For Full card requests, the allocation ratio for one card is 1. For shared GPU scheduling, the allocation ratio is the ratio of the allocated GPU memory on a card to the total GPU memory of that card.

    Allocated GPU Memory

    63.0% of GPU memory is allocated.

    Used GPU Memory

    35.5% of GPU memory is used.

    Average GPU Utilization

    The average utilization of all cards is 74%.

    GPU Memory Copy Utilization

    The average memory copy utilization of all cards is 43.7%.

    GPU Node Details

    Information about GPU nodes in the cluster, including node name, GPU card index, GPU utilization, and memory controller utilization.

GPUs - nodes

On the Prometheus Monitoring page, click the GPU Monitoring tab, and then click the GPUs - Nodes tab. From the GPUNode drop-down list, select a target node. This example uses cn-hangzhou.10.166.154.xxx. The node-level monitoring dashboard shows the following information:

image

image

image

In addition to Pod information, the GPU Process Details panel includes columns for Container Name, Allocate Mode, Process Id, Process Name, Process Type, GPU Index, Used GPU Memory, SM Utilization, GPU Memory Copy Util, Decode Utilization, and Encode Utilization.

Panel group

No.

Panel

Description

Overview

GPU Mode

The node operates in Shared mode, which allows GPU resources to be requested by GPU memory and computing power.

NVIDIA Driver Version

The installed GPU driver version is 535.161.07.

Allocated GPUs

A total of 0.45 out of 1 GPU is allocated.

GPU Utilization

The average GPU utilization is 26%.

Allocated GPU Memory

The allocated GPU memory is 45.5% of the total GPU memory.

Used GPU Memory

The used GPU memory is 36.4% of the total GPU memory.

Allocated Computing Power

30% of the computing power of GPU card 0 is allocated.

Note

The Allocated Computing Power panel shows data only when computing power allocation is enabled on the node. In this example, only the node with the ack.node.gpu.schedule=core_mem label displays data in this panel.

Utilization

GPU Utilization

The utilization of GPU card 0 ranges from a minimum of 0% to a maximum of 33%, with an average of 12%.

Memory Copy Utilization

The memory copy utilization of GPU card 0 ranges from a minimum of 0% to a maximum of 22%, with an average of 8%.

Memory&BAR1

GPU Memory Details

Displays details of the GPU card, including its UUID, index, and model.

BAR1 Used

The used BAR1 memory is 4 MB.

Memory Used

The used GPU memory of the card is 8.17 GB.

BAR1 Total

The total BAR1 memory is 32.8 GB.

GPU Process

GPU Process Details

Displays details of GPU processes, including the namespace and name of the Pod containing each process.

You can also view more advanced metrics at the bottom of the page. For more information, see GPUs - Nodes.

The advanced metrics are organized into six panel groups: GPU Process (2 panels), Profiling (12 panels), Temperature & Energy (4 panels), Clock (6 panels), Retired Pages (2 panels), and Violation (6 panels). These panel groups are collapsed by default. Click a panel group to expand it.

GPUs - application pod dimension

On the Prometheus Monitoring page, click the GPU Monitoring tab, and then click the GPUs - Pods tab. This dashboard displays GPU metrics for each Pod in a table. In addition to the fields described below, the table includes columns such as Pod Source, Allocated Mode (exclusive or share), SM Utilization, GPU Memory Copy Utilization, Decode Utilization, and Encode Utilization.

No.

Panel

Description

GPU Pod Details

Displays information about Pods that request GPU resources, including their namespace, name, node, and used GPU memory.

Note
  • When GPU sharing is used, a node reports the total GPU memory of each card to the API server as an integer, rounded down from the actual value. For example, if a card has 31.7 GiB of total GPU memory, the node reports 31 GiB to the API server. If a Pod requests 10 GiB, the actual allocated memory is 31.7 * (10 / 31) = 10.2 GiB.

  • This field shows the computing power allocated to a Pod. If a Pod does not request computing power, this field displays "-". For example, the Pod named tensorflow-benchmark-share-mem-core-k24gz has requested 30% of the computing power.

You can also view more advanced metrics at the bottom of the page. For more information, see GPUs - Application Pod Dimension.

The advanced metric panel groups include: Pod Metrics (GPU Device) (6 panels), Pods Metrics (Host Resource) (8 panels), GPU Utilization (Associated with Pod) (4 panels), GPU Memory & BAR1 (Associated with Pod) (5 panels), GPU Profiling (Associated with Pod) (12 panels), GPU Temperature & Energy (Associated with Pod) (4 panels), and GPU Clock (Associated with Pod) (6 panels).