All Products
Search
Document Center

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

Last Updated:Aug 25, 2026

Use NVIDIA DCGM to monitor GPU nodes across full-card, GPU-memory, and computing-power request modes.

Prerequisites

Background

GPU monitoring provides cluster-level, node-level, and Pod-level dashboards for GPU nodes. See Dashboard description.

  • The cluster-level dashboard shows cluster-wide or node-pool metrics, such as utilization, GPU memory usage, and XID errors.

  • The node-level dashboard shows per-node GPU details, utilization, and memory usage.

  • The Pod-level dashboard shows requested GPU resources and utilization per Pod.

The following sections demonstrate monitoring results for three GPU request modes.

image

Usage notes

  • GPU metrics are collected every 15 seconds, which may delay Grafana dashboard data. The dashboard might show no available GPU memory on a node while a Pod is still scheduled to it. This occurs when a Pod releases GPU resources between scrapes and the scheduler places a pending Pod before the next collection.

  • The monitoring dashboard tracks only GPU resources requested via the resources.limits field in a Pod specification. See Manage Resources for Containers.

    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 with docker run to run a GPU application.

    • Setting NVIDIA_VISIBLE_DEVICES, such as NVIDIA_VISIBLE_DEVICES=all or NVIDIA_VISIBLE_DEVICES=<GPU ID>, in the Pod's env section to request GPU resources.

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

    • Running a GPU program in a Pod without NVIDIA_VISIBLE_DEVICES set, where the container image defaults to NVIDIA_VISIBLE_DEVICES=all.

  • Allocated GPU memory differs from used GPU memory. For example, a card has 16 GiB total and you allocate 5 GiB to a Pod. If the Pod runs sleep 1000, it is Running but does not use the GPU — allocated memory is 5 GiB, used memory is 0 GiB.

Step 1: Create node pools

The GPU monitoring dashboard displays metrics for Pods that request GPU resources by full card, GPU memory, or computing power.

Create three node pools to demonstrate Pod scheduling and resource usage for each GPU request mode. For instructions, see Create a node pool. Configure the node pools as follows:

Parameter

Description

Example

Node Pool Name

First node pool name.

exclusive

Second node pool name.

share-mem

Third node pool name.

share-mem-core

Instance Type

Instance type. The TensorFlow Benchmark project requires 10 GiB of GPU memory, so the instance type must provide more than 10 GiB.

ecs.gn7i-c16g1.4xlarge

Expected Nodes

Number of nodes in the pool.

1

Node Labels

For full-card requests. No label required.

None

Requests GPU resources by GPU memory.

ack.node.gpu.schedule=cgpu

Requests GPU resources by GPU memory with computing power allocation.

ack.node.gpu.schedule=core_mem

Step 2: Deploy GPU applications

After you create the node pools, run GPU test jobs to verify that metrics are collected correctly. See Enable scheduling for label and scheduling details. 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.

      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.

      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.

      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. 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. Check the Pod status:

    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

    All Pods are in the Running state, confirming successful deployment.

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 dashboard shows the following information. See Cluster dimension monitoring dashboard.

    image

    No.

    Panel

    Description

    Total GPU Nodes

    3 GPU nodes.

    Allocated GPUs

    1.9 of 3 GPUs allocated.

    Note

    For full-card requests, the allocation ratio per card is 1. For shared GPU scheduling, the ratio equals allocated GPU memory divided by total GPU memory on the card.

    Allocated GPU Memory

    63.0% of GPU memory allocated.

    Used GPU Memory

    35.5% of GPU memory used.

    Average GPU Utilization

    Average utilization: 74%.

    GPU Memory Copy Utilization

    Average memory copy utilization: 43.7%.

    GPU Node Details

    GPU node details including node name, card index, 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 node. This example uses cn-hangzhou.10.166.154.xxx. The dashboard shows:

image

image

image

The GPU Process Details panel also 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

Shared mode: GPU resources requested by GPU memory and computing power.

NVIDIA Driver Version

GPU driver version: 535.161.07.

Allocated GPUs

0.45 of 1 GPU allocated.

GPU Utilization

Average GPU utilization: 26%.

Allocated GPU Memory

45.5% of GPU memory allocated.

Used GPU Memory

36.4% of GPU memory used.

Allocated Computing Power

30% of GPU card 0 computing power allocated.

Note

This panel shows data only when computing power allocation is enabled. In this example, only the node with the ack.node.gpu.schedule=core_mem label displays data.

Utilization

GPU Utilization

GPU card 0 utilization: min 0%, max 33%, avg 12%.

Memory Copy Utilization

GPU card 0 memory copy utilization: min 0%, max 22%, avg 8%.

Memory&BAR1

GPU Memory Details

GPU card details: UUID, index, and model.

BAR1 Used

BAR1 memory used: 4 MB.

Memory Used

GPU memory used: 8.17 GB.

BAR1 Total

Total BAR1 memory: 32.8 GB.

GPU Process

GPU Process Details

GPU process details: Pod namespace, name, and process information.

Advanced metrics are available at the bottom of the page. See GPUs - Nodes.

The six panel groups are GPU Process (2 panels), Profiling (12 panels), Temperature & Energy (4 panels), Clock (6 panels), Retired Pages (2 panels), and Violation (6 panels). They are collapsed by default; click to expand.

GPUs - application pod dimension

On the Prometheus Monitoring page, click the GPU Monitoring tab, and then click the GPUs - Pods tab. This table lists GPU metrics per Pod. Besides the fields below, columns include Pod Source, Allocated Mode (exclusive or share), SM Utilization, GPU Memory Copy Utilization, Decode Utilization, and Encode Utilization.

No.

Panel

Description

GPU Pod Details

Pod details: namespace, name, node, and used GPU memory.

Note
  • With GPU sharing, nodes report total GPU memory per card as an integer, rounded down. For example, a card with 31.7 GiB reports 31 GiB. If a Pod requests 10 GiB, the actual allocation is 31.7 × (10 / 31) = 10.2 GiB.

  • Shows computing power allocated to a Pod. Displays "-" if not requested. For example, tensorflow-benchmark-share-mem-core-k24gz has 30% computing power allocated.

Advanced metrics are available at the bottom of the page. See GPUs - Application Pod Dimension.

The 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).