Instructions for Multi-GPU Usage in Single-GPU Containers
Updated at:2025-10-27
This document explains how to leverage the single-container multi-GPU feature of sGPU using resource descriptors. It covers two scenarios: simultaneous isolation of GPU memory and computing power, and memory-only isolation.
1. Simultaneous isolation of GPU memory and computing power
| Resource descriptor | Unit | Meaning |
|---|---|---|
| baidu.com/xxx_xxx_cgpu | Quantity | The number of GPU cards applied for. In this scenario, it refers to the number of shared GPU cards applied for |
| baidu.com/xxx_xxx_cgpu_core | Percentage | Total computing power applied by the container |
| baidu.com/xxx_xxx_cgpu_memory | GiB | Total memory applied by the container |
Resources for a single shared GPU card:
- Computing power resource per GPU card: baidu.com/xxx_xxx_cgpu_core / baidu.com/xxx_xxx_cgpu
- Memory resource per GPU card: baidu.com/xxx_xxx_cgpu_memory/baidu.com/xxx_xxx_cgpu
Example: In this case, the pod requests 50% computing power, 10 GiB memory, and 2 shared GPU cards. Each shared GPU card therefore provides 25% computing power and 5 GiB memory.
Plain Text
1 resources:
2 limits:
3 baidu.com/a10_24g_cgpu: "2"
4 baidu.com/a10_24g_cgpu_core: "50"
5 baidu.com/a10_24g_cgpu_memory: "10"
2. GPU memory isolation with shared computing power
| Resource descriptor | Unit | Meaning |
|---|---|---|
| baidu.com/xxx_xxx_cgpu | Quantity | The number of GPU cards applied for. In this scenario, it refers to the number of shared GPU cards applied for |
| baidu.com/xxx_xxx_cgpu_memory | GiB | Total memory applied by the container |
Resources for a single shared GPU card:
- Computing power resources per GPU card: Shares 100% computing power with other containers.
- Memory resource per GPU card: baidu.com/xxx_xxx_cgpu_memory/baidu.com/xxx_xxx_cgpu
Example: In this example, the pod requests 10 GiB memory and 2 shared GPU cards. Consequently, each shared GPU card provides 100% shared computing power and 5 GiB memory.
Plain Text
1 resources:
2 limits:
3 baidu.com/a10_24g_cgpu: "2"
4 baidu.com/a10_24g_cgpu_memory: "10"
Usage restrictions
- The memory/computing power allocation for a single GPU must be a positive integer (e.g., computing power: baidu.com/xxx_xxx_cgpu_core/baidu.com/xxx_xxx_cgpu; memory: baidu.com/xxx_xxx_cgpu_memory/baidu.com/xxx_xxx_cgpu).
- The memory/computing power allocation for a single GPU must meet or exceed the minimum unit requirement for memory/computing power.
- You cannot request _cgpu_core if you do not request _cgpu_memory or _cgpu_memory_percent
- The minimum unit for memory isolation is 1 GiB.
- The minimum unit for computing power isolation is 5%.
