tencent cloud

Tencent Kubernetes Engine

Using qGPU

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-11-20 09:30:28
Traduzido por IA

Usage Instructions

Supported Kubernetes Version
TKE version ≥ v1.14.x
Supported Node Type
Only supports native nodes. Native nodes incorporate the FinOps concept, and when used in conjunction with qGPU, can comprehensively improve GPU/CPU resource utilization.
Supported GPU Card Architecture
Supports Volta (such as V100), Turing (such as T4), Ampere (such as A100, A10), L40 (Pnv5i), L40s (Pnv5), PNV5b, H800, PNV6, HCCPNV6, 4090, 4090d, 4990d, H800, 5090, 5090d, 5090dv2, v800, and pro5000.
For pro5000, set the qgpu kernel version to v4.0.1 in component management.
Supported Driver Version
450/470/515/525/535/550/570/580 series. The specific minor versions are subject to the versions available in the console.
Supported CUDA
11.4/12.2/12.4/12.8. The specific minor versions are subject to the versions available in the console.
Sharing Granularity
Each qGPU can be allocated a minimum of 1G video memory, with a precision unit of 1G. The minimum compute allocation is 1 (representing 1% of a card), the maximum is 100 (representing one card), and the precision unit is 1.
Whole-Card Allocation
Nodes with qGPU capability enabled can allocate full cards in the format of tke.cloud.tencent.com/qgpu-core: 100 | 200 | ... (N * 100, where N is the number of full cards). It is recommended to use the node pools capability of TKE to distinguish NVIDIA allocation methods or switch to the qGPU usage mode.
Quantity Limit
A maximum of 16 qGPU devices can be created on a single GPU. It is recommended to determine the number of qGPU devices that can be deployed in a shared manner on a single GPU card based on the video memory requested by the container.
Attention:
If you have upgraded the Kubernetes Master version of your TKE cluster, please note the following:
For managed clusters, you do not need to reconfigure this plugin.
For independent clusters (where the Master is self-managed), upgrading the Master version resets the configurations of all components on the Master. This affects the configuration of the qgpu-scheduler plugin as a Scheduler Extender. Therefore, you must first uninstall the qGPU plugin and then reinstall it.
Update the qGPU component to the latest version in a timely manner. For details, see the qGPU (GPU isolation component) change log.

Kubernetes Objects Deployed in a Cluster

Kubernetes Object Name
Type
Requesting Resources
Namespace
qgpu-manager
DaemonSet
One per GPU node, Memory: 300M, CPU: 0.2
kube-system
qgpu-manager
ClusterRole
-
-
qgpu-manager
ServiceAccount
-
kube-system
qgpu-manager
ClusterRoleBinding
-
kube-system
qgpu-scheduler
Deployment
Single replica, Memory: 800M, CPU: 1
kube-system
qgpu-scheduler
ClusterRole
-
-
qgpu-scheduler
ClusterRoleBinding
-
kube-system
qgpu-scheduler
ServiceAccount
-
kube-system
qgpu-scheduler
Service
-
kube-system

qGPU Permissions

Note:
The Permission Scenarios section only lists the permissions related to the component's core features. For the complete permission list, see the Permission Definitions section.

Permission Description

The permissions for this component represent the minimum set of permissions required to implement the current feature.
To install the qgpu ko kernel file and create, manage, and delete qgpu devices, you must enable privileged containers.

Permission Scenarios

Function
Object Involved
Operation Permission Involved
Monitors pod status changes, obtains pod information, and cleans up resources such as qgpu devices when a pod is deleted.
pods
get/list/watch
Monitors node status changes, obtains node information, and adds labels to nodes based on gpu card driver and version information as well as qgpu version information.
nodes
get/list/watch/update
qgpu-scheduler is an extended scheduler for qgpu resources developed based on the Kubernetes scheduler extender mechanism. Its required permissions are the same as those of other community scheduling components (such as volcano), including monitoring and obtaining pod information, updating scheduling results to pod labels and annotations, monitoring and obtaining node information, monitoring and obtaining configured configmaps, and creating scheduling events.
pods
get/list/update/patch
nodes
get/list/watch
configmaps
get/list/watch
events
create/patch
gpu.elasticgpu.io is a custom CRD resource for qgpu that records gpu resource information (this feature is deprecated, but the resource definition is retained for compatibility with older versions). It is managed by qgpu-manager and qgpu-scheduler and requires all CRUD permissions.
gpu.elasticgpu.io and gpu.elasticgpu.io/status
all permissions

Permission Definitions

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: qgpu-manager
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- update
- get
- list
- watch
- apiGroups:
- "elasticgpu.io"
resources:
- gpus
- gpus/status
verbs:
- '*'

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: qgpu-scheduler
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- update
- patch
- get
- list
- watch
- apiGroups:
- ""
resources:
- bindings
- pods/binding
verbs:
- create
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- "elasticgpu.io"
resources:
- gpus
- gpus/status
verbs:
- '*'

Operation Steps

Step 1: Install the qGPU Scheduling Component

1. Log in to the TKE console. In the left sidebar, choose Clusters.
2. In the cluster list, click the target cluster ID to go to the cluster details page.
3. In the left sidebar, choose Component Management. On the displayed page, click Create.
4. On the Create Component Management page, select QGPU (GPU isolation component).
5. Click Parameter Configuration to set the scheduling policy for qgpu-scheduler.
Spread: Multiple Pods are distributed across different nodes and GPUs. Nodes with more available resources are prioritized. This policy is suitable for HA scenarios, as it prevents placing replicas of the same application on the same device.
Binpack: Multiple Pods preferentially use the same node. This policy is suitable for scenarios aimed at improving GPU utilization.
6. Click Finish to create the component. After the installation is successful, you need to prepare GPU resources for the cluster.

Step 2: Prepare GPU Resources and Enable qGPU Sharing

1. In the cluster list, click the target cluster ID to go to the cluster details page.
2. On the Node Management page, select the Node Pools tab, and then click Create.
3. Choose Native Node and click Create.
4. On the Create page, select the corresponding GPU model and a driver version supported by qgpu.

5. In Ops Features Settings, click the toggle on the right side of qGPU Sharing. After the toggle is enabled, GPU sharing is enabled by default for all newly added GPU native nodes in the node pool. You can use a Label to control whether to enable the isolation capability.
6. In Advanced Settings > Labels, set a Label through the advanced configuration of node pools to specify the qGPU isolation policy:

Label key: tke.cloud.tencent.com/qgpu-schedule-policy
Label value: fixed-share (You can enter the full name or abbreviation for the Label value. For more values, refer to the table below.) Currently, qGPU supports the following isolation policies:
Label Value
Abbreviation
English Name
Chinese Name
Description
best-effort
(default value)
be
Best Effort
Best-effort mode
Default value. Pods are not limited in computing power and can use any remaining power on the card. If N Pods are started and each Pod is under heavy load, the final result is 1/N of the computing power.
fixed-share
fs
Fixed Share
Fixed quota
Each Pod has a fixed computing power quota and cannot exceed the fixed quota, even if the GPU has idle computing power.
burst-share
bs
Guaranteed Share with Burst
Guaranteed quota with burst capability
The scheduler guarantees a baseline computing power quota for each Pod, but any idle computing power on the GPU can be used by the Pod. For example, when the GPU has idle computing power (not allocated to other Pods), a Pod can use computing power exceeding its quota. Note that when this portion of idle computing power occupied by the Pod is allocated again, the Pod falls back to its computing power quota.
7. Click Create Node Pool.

Step 3: Allocate Shared GPU Resources to Applications

You can enable Pods to use qGPU by configuring the corresponding qGPU resources for containers. You can allocate GPU resources to applications through the console or YAML.
Note:
If your application requires integer GPU cards, you only need to specify the number of cards. You do not need to specify the video memory (all video memory on the allocated GPU cards is automatically used).
If your application requires fractional GPU resources (that is, sharing a single GPU card with other applications, with only single-card splitting supported), you need to specify both the number of cards and the video memory.
Setting via the Console
Setting via YAML
1. In the left sidebar of the cluster, choose Workloads. On any workload object type page, click Create. This document uses Deployment as an example.
2. On the Create Deployment page, select Container in the instance and specify GPU-related resources: 
Create the relevant qGPU resources through YAML:
spec:
containers:
resources:
limits:
tke.cloud.tencent.com/qgpu-memory: "5"
tke.cloud.tencent.com/qgpu-core: "30"
requests:
tke.cloud.tencent.com/qgpu-memory: "5"
tke.cloud.tencent.com/qgpu-core: "30"
Among them:
The qGPU-related resource values in requests and limits must be consistent. According to K8S rules, you can omit the qGPU settings in requests, in which case requests are automatically set to the same values as limits.
tke.cloud.tencent.com/qgpu-memory indicates the video memory (in GB) requested by the container. It is allocated in integer units and does not support decimals.
tke.cloud.tencent.com/qgpu-core indicates the computing power requested by the container. Each GPU card can provide 100% computing power. The value of qgpu-core should be set to less than 100. If the set value exceeds the remaining computing power ratio, the setting fails. After the value is set, the container can obtain n% of the computing power of a GPU card.


Ajuda e Suporte

Esta página foi útil?

comentários