With the NVIDIA GPU Operator, how do the MIG single and mixed strategies change the resource a pod requests, and how do you repartition a node?
answer
- one strategy, per-node layouts
- single overloads nvidia.com/gpu
- mixed names each profile
- the nvidia.com/mig.config node label
- mig.config.state and evicted GPU pods
basics
~20 sUnder the single strategy every GPU on a node has the same MIG profile and each instance is advertised as nvidia.com/gpu; under mixed, each profile becomes its own resource such as nvidia.com/mig-3g.40gb. Repartition by changing the node's nvidia.com/mig.config label.
solid answer
~30 sThe strategy is set once for the cluster: Helm `mig.strategy` (default `single` in GPU Operator 26.7) or `spec.mig.strategy` in the `ClusterPolicy`. With `single`, every GPU on a node carries one identical profile, the device plugin advertises each instance as `nvidia.com/gpu`, and GPU Feature Discovery rewrites `nvidia.com/gpu.product`, e.g. `NVIDIA-H100-80GB-HBM3-MIG-1g.10gb`. With `mixed`, whole GPUs and several profiles can share a node, and each profile is advertised as `nvidia.com/mig-<profile>`. To repartition, label the node `nvidia.com/mig.config=<config>` (MIG-enabled nodes start at `all-disabled`); MIG Manager sets `nvidia.com/mig.config.state` to `pending`, terminates the GPU pods on that node, applies the geometry and reports `success`. Drain the node first.
code
yaml · 18 linesmigManager:
config:
name: notebook-mig-config
create: true
data:
config.yaml: |-
version: v1
mig-configs:
all-disabled:
- devices: all
mig-enabled: false
notebook-split:
- devices: [0, 1, 2, 3]
mig-enabled: false
- devices: [4, 5, 6, 7]
mig-enabled: true
mig-devices:
"3g.40gb": 2go deeper
Recall that single advertises MIG instances as nvidia.com/gpu, mixed advertises nvidia.com/mig-<profile>, and a node label selects the layout.
Walk through the relabel sequence and its state label, and compute what a node advertises for a given layout and strategy.
Treat relayouts as maintenance: drain first, watch mig.config.state, keep whole-GPU manifests off slices under single, and keep custom layouts in Helm values.
Decide how much of the fleet is sliced and how often layouts change, weighing utilisation against disruption and the manifest discipline mixed demands.
## Where the strategy is set **MIG** (Multi-Instance GPU) cuts a supported GPU into hardware instances. The NVIDIA GPU Operator needs two decisions to use it: a cluster-wide **strategy**, which fixes how instances are advertised to Kubernetes, and a per-node **layout**, which fixes how each GPU is cut. - The strategy comes from the Helm value `mig.strategy`, which defaults to `single` in GPU Operator 26.7, and lives afterwards in the ClusterPolicy as `spec.mig.strategy`; the documented way to change it is a JSON patch of `/spec/mig/strategy`. - The device plugin underneath accepts `none`, `single` or `mixed`; run standalone it defaults to `none`, which exposes no MIG devices at all. - The layout is chosen node by node with the `nvidia.com/mig.config` label, which MIG Manager watches. ## single against mixed | Aspect | `single` | `mixed` | |---|---|---| | Layout on a node | Every GPU MIG-enabled with one identical profile | MIG and non-MIG GPUs, several profiles | | Resource a pod requests | `nvidia.com/gpu` | `nvidia.com/mig-<profile>`, e.g. `nvidia.com/mig-3g.40gb`; whole GPUs stay `nvidia.com/gpu` | | GPU Feature Discovery labels | `nvidia.com/gpu.product` gains the profile, `nvidia.com/gpu.count` counts instances | per-profile labels such as `nvidia.com/mig-1g.10gb.count` | | Good for | Pools of identical slices; existing manifests keep working | Heterogeneous slices on one node | | Catch | A pod cannot tell a slice from a whole GPU by resource name | Every manifest must name its profile | The `single` catch is real: on a node labelled `all-1g.10gb`, a manifest written for a whole 80 GB GPU still requests `nvidia.com/gpu: 1` and will happily land on a 10 GB instance unless it selects on `nvidia.com/gpu.product`. ## Repartitioning a node 1. **Cordon and drain** the node. MIG Manager requires that no user workloads run on the GPUs it reconfigures. 2. **Label it**: `kubectl label nodes node-0 nvidia.com/mig.config=all-1g.10gb --overwrite`. 3. MIG Manager sets `nvidia.com/mig.config.state=pending` and **terminates all GPU pods** on the node before changing the geometry. In environments that need a reboot to apply MIG (some cloud providers), MIG Manager runs with `WITH_REBOOT=true` and the state reads `rebooting`. 4. The state turns to `success`; the device plugin advertises the new resources and GPU Feature Discovery relabels the node. 5. **Uncordon** it. After a successful `single` relayout to `all-1g.10gb`, GPU Feature Discovery rewrites the node's labels: `nvidia.com/gpu.product` gains the profile (for example `NVIDIA-H100-80GB-HBM3-MIG-1g.10gb`), `nvidia.com/gpu.count` counts instances rather than GPUs, `nvidia.com/gpu.slices.gi` and `nvidia.com/gpu.slices.ci` report the slice size, and `nvidia.com/mig.strategy` names the strategy. Notebook pods select on the product label so that whole-GPU pods and slice pods never meet. ## Where named layouts come from - Since GPU Operator 26.3.0, MIG Manager **generates** a ConfigMap per MIG-capable node at startup, named `<node-name>-mig-config`, by querying the GPUs through NVML. It contains `all-disabled`, `all-enabled`, a per-profile config such as `all-1g.10gb`, and `all-balanced`. - Older drivers, such as the 535 branch, cannot query profiles while MIG mode is off; the operator then falls back to the static `default-mig-parted-config` ConfigMap. - **Custom layouts** go in Helm values: `migManager.config.create: true`, a `migManager.config.name`, and the data under `migManager.config.data` with a `config.yaml` key. If a custom layout uses more than one profile, the strategy must be `mixed`. ## Arithmetic on the notebook nodes Each notebook node has eight 80 GB H100s. - **single, `all-1g.10gb`**: 8 x 7 = **56** `nvidia.com/gpu`, each a 10 GB instance. - **mixed, the custom layout in the example**: GPUs 0-3 stay whole and GPUs 4-7 each become two `3g.40gb` instances, so the node advertises **4** `nvidia.com/gpu` plus **8** `nvidia.com/mig-3g.40gb`. Memory adds up (2 x 40 GB = 80 GB per split GPU); compute does not quite, since two 3-slice instances use 6 of the GPU's 7 compute slices. ## Choosing a strategy for this cluster 1. If the notebook nodes will all use one profile, and existing notebook images already request `nvidia.com/gpu`, **`single`** keeps manifests unchanged; isolate the sliced nodes with a node selector on the product label. 2. If one node must offer several sizes, for example `1g.10gb` for light notebooks and `3g.40gb` for small fine-tunes, or keep whole GPUs beside slices, choose **`mixed`** and teach users the per-profile resource names. 3. Because the strategy is cluster-wide while layouts are per node, decide it before the first relayout; switching later means rewriting every manifest that names a resource. ## Pitfalls - Relabelling a node that runs a training job kills that job's GPU pods; treat relayouts as maintenance. - Mixing whole GPUs and slices on one node requires `mixed`, because `single` assumes every GPU on the node is MIG-enabled with the same profile. - With the GPU Operator, a pod cannot ask for a profile the node's layout does not already provide; the layout changes only when the node label does.
- How do you confirm a MIG relayout by the GPU Operator has finished?Watch `nvidia.com/mig.config.state` on the node move from `pending` (or `rebooting` when MIG Manager runs with `WITH_REBOOT`) to `success`. Then check GPU Feature Discovery's labels: under `single`, `nvidia.com/gpu.product` gains the profile suffix and `nvidia.com/gpu.count` counts instances; under `mixed`, per-profile count labels appear.
- Where do named MIG layouts such as all-1g.10gb come from?Since GPU Operator 26.3.0, MIG Manager generates a `<node-name>-mig-config` ConfigMap per MIG-capable node from what NVML reports, including `all-disabled`, `all-enabled`, per-profile configs and `all-balanced`. Older drivers fall back to the static `default-mig-parted-config`, and custom layouts come from `migManager.config` in the Helm values.
- Under the single strategy, pods request nvidia.com/mig-1g.10gb.
- Changing nvidia.com/mig.config is safe while training pods use the node.
- The single strategy lets one node mix 3g.40gb and 1g.10gb instances.
- With the GPU Operator, a pod's request reshapes the GPU into the MIG profile it asks for.
- The MIG strategy is chosen per pod in its resource request.
Assumes NVIDIA GPU Operator 26.7 (MIG Manager's generated per-node layouts date from 26.3.0) and the H100 80 GB MIG profile table.