All Products
Search
Document Center

Container Service for Kubernetes:Configure a cGPU computing power allocation policy for GPU sharing

Last Updated:Oct 28, 2026

An ACK managed Pro cluster supports GPU sharing. Set the policy parameter of the GPU sharing add-on to select from different computing power allocation policies. The policy determines how a GPU divides its computing power among the containers that share it.

For more information about cGPU, see What is cGPU?.

Prerequisites

  • An ACK managed Pro cluster is created, and the Kubernetes version of the cluster is 1.18.8 or later. For information about how to upgrade Kubernetes, see Manually upgrade a cluster.

  • The cGPU version is 1.0.6 or later. For information about how to upgrade cGPU, see Upgrade the cGPU version of a node.

Usage notes

  • If a node already has the cGPU isolation module installed, you must restart the node after you install the GPU sharing add-on for the policy to take effect. For more information, see Restart an instance.

    Important

    A restart interrupts the workloads that run on the node, and the policy applies to all GPU-sharing nodes in the cluster. Change the policy and restart the nodes during off-peak hours, after you move or stop the GPU workloads on each node.

    Note

    Log on to the node and run the cat /proc/cgpu_km/version command to check whether the cGPU isolation module is installed. If a cGPU version number is returned, the cGPU isolation module is installed.

  • If the cGPU isolation module is not installed on your node or has been uninstalled, the policy takes effect immediately after you install the GPU sharing add-on.

  • All GPU-sharing nodes in the same cluster must use the same policy.

Step 1: Check whether the GPU sharing add-on is installed

When you configure a computing power allocation policy for GPU sharing, the procedure differs depending on whether the GPU sharing add-on is installed. Therefore, first check whether the add-on is installed in your cluster.

  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 Applications > Helm.

  3. On the Helm page, check whether ack-ai-installer is in the add-on list.

    If ack-ai-installer is present, the GPU sharing add-on is installed; if it is absent, the GPU sharing add-on is not installed.

Step 2: Configure a computing power allocation policy for GPU sharing

Select the tab that matches your cluster state.

GPU sharing add-on not installed

  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 Applications > Cloud-native AI Suite.

  3. On the Cloud-native AI Suite page, click Deploy.

  4. In the Scheduling section, select Scheduling Policy Extension (Batch Task Scheduling, GPU Sharing, Topology-aware GPU Scheduling), and then click Advanced.

  5. On the Parameters page, modify the policy field, and then click OK.

    cgpu:
      enabled: true
      image: acs/cgpu-installer
      tag: v1.5.3-8d3fc1b-aliyun
      financeCloudImageTag: v1.0.7-fin
      imagePullPolicy: IfNotPresent
      policy: 1
      nodeSelector: {}
      checkRegions: true

    The following table describes the valid values. For more information, see cGPU usage examples.

    Value

    Description

    0

    Fair-share scheduling. Each container occupies a fixed time slice. The time slice ratio is 1/max_inst.

    1

    Preemptive scheduling. Each container occupies as many time slices as possible. The time slice ratio is 1 divided by the number of current containers.

    2

    Weight-based preemptive scheduling. This policy is automatically used if you set ALIYUN_COM_GPU_SCHD_WEIGHT to an integer from 2 to max_inst when you create a container.

    3

    Fixed percentage scheduling. Allocates a fixed percentage of computing power. The percentage is the ratio of ALIYUN_COM_GPU_SCHD_WEIGHT to max_inst.

    4

    Soft scheduling. Provides weaker isolation than preemptive scheduling.

    5

    Native scheduling. The policy uses the GPU driver's own scheduling method.

  6. At the bottom of the page, click Deploy Cloud-native AI Suite.

GPU sharing add-on already installed

  1. Edit the DaemonSet that installs the cGPU isolation module in the GPU sharing add-on.

    kubectl edit daemonset cgpu-installer -nkube-system
  2. Modify and save the DaemonSet that installs the cGPU isolation module.

    1. Check the image version of the DaemonSet by using the image field.

      Make sure that the image version is v1.0.6 or later. The following example shows the image field:

       image: registry-vpc.cn-hongkong.aliyuncs.com/acs/cgpu-installer:<image_version>
    2. Modify the value.

      Under spec.template.spec.containers, set the POLICY value to the target policy value.

      # Other fields are omitted.
      spec:
        template:
          spec:
            containers:
            - env:
              - name: POLICY
                value: "1"
      # Other fields are omitted.

      value: The following table describes the valid values.

      Value

      Description

      0

      Fair-share scheduling. Each container occupies a fixed time slice. The time slice ratio is 1/max_inst.

      1

      Preemptive scheduling. Each container occupies as many time slices as possible. The time slice ratio is 1 divided by the number of current containers.

      2

      Weight-based preemptive scheduling. This policy is automatically used if you set ALIYUN_COM_GPU_SCHD_WEIGHT to an integer from 2 to max_inst when you create a container.

      3

      Fixed percentage scheduling. Allocates a fixed percentage of computing power. The percentage is the ratio of ALIYUN_COM_GPU_SCHD_WEIGHT to max_inst.

      4

      Soft scheduling. Provides weaker isolation than preemptive scheduling.

      5

      Native scheduling. The policy uses the GPU driver's own scheduling method.

  3. Restart the GPU-sharing node instances. For more information, see Restart an instance.

    Important

    A restart interrupts the workloads that run on the node. Move or stop the GPU workloads on the node before you restart it.