Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Cloud Native 70 min read

GPU Sharing in Kubernetes: MIG vs MPS vs Time-Slicing vs vGPU

This article compares four NVIDIA GPU sharing methods—MIG, MPS, Time-Slicing, and vGPU—for Kubernetes clusters, detailing their isolation levels, hardware requirements, configuration steps, verification procedures, and failure-mode analysis to help operators select the right approach for their workloads.

Environment Assumptions

The article assumes a baseline environment: Ubuntu 24.04 LTS with containerd, Kubernetes 1.35, NVIDIA GPU Operator v26.7.3 installed via Helm in the gpu-operator namespace. Operator components include Device Plugin 0.20.2, MIG Manager 0.15.2, DCGM Exporter v4.7.0-4.9.0, and driver 595.91.07. Two node types are used: H100 80GB (supports MIG, MPS) and T4 (no MIG support). vGPU uses NVIDIA vGPU 19/20/21 branches. A common pitfall: some managed GPU Operator installations use namespace nvidia-gpu-operator instead of gpu-operator; all commands below assume -n gpu-operator.

Where Each Solution Splits the GPU

Layer          Who splits          Boundary
-------------  ------------------  ---------------------------
vGPU           hypervisor          per VM (time-sliced or MIG)
MIG            GPU hardware        SM + memory + L2 slices
MPS            CUDA MPS server     SM% + memory cap per client
Time-slicing   CUDA driver         none, time only

Time-Slicing: Only Makes the Scheduler Think There Are Multiple GPUs

Time-Slicing in Kubernetes is implemented by the device plugin reporting N replicas of a physical GPU to kubelet. Multiple Pods' CUDA contexts time-slice on the same GPU.

Three direct consequences:

No memory isolation : Every Pod sees and can allocate the full GPU memory; one Pod filling memory causes OOM in others.

No fault isolation : Official docs state time-sliced replicas share a fault domain; a crash in one workload can take down others on the same GPU.

Requesting 2 replicas ≠ 2× compute : CUDA simply splits time evenly among all processes. The article recommends enabling failRequestsGreaterThanOne so Pods requesting more than one shared replica fail immediately, avoiding the misconception that they get proportional compute.

Benefits: runs on almost any GPU, including older models, and can be combined with MIG (mixed strategy applies time-slicing on top of MIG instances).

MPS: A Single Server Process Proxies All Clients

MPS (Multi-Process Service) consists of a control daemon ( nvidia-cuda-mps-control), a server process ( nvidia-cuda-mps-server), and a client runtime inside libcuda.so. All client CUDA work is submitted to the same MPS server, allowing kernels from multiple processes to run concurrently on the GPU rather than context-switching.

Compared to Time-Slicing, MPS adds two limiting mechanisms:

Compute cap : Via CUDA_MPS_ACTIVE_THREAD_PERCENTAGE limiting each client's thread percentage. This is a ceiling, not a reservation; kernels from different clients may still run on the same SM.

Memory cap : Via pinned device memory limit per client; allocations beyond the limit return OOM immediately without stealing from others.

In Kubernetes, the device plugin's MPS mode splits each GPU evenly by replicas: each replica gets ~1/replicas of memory limit and compute proportion. Only equal splits are supported (e.g., cannot give one Pod 30% and another 70%).

Key boundaries of MPS:

Faults are shared : Since Volta, MPS clients have independent GPU address spaces, but a fatal GPU error in one client propagates to all clients sharing the GPU; the MPS server enters FAULT state until all affected clients exit. MIG docs mark MPS error isolation as unsupported.

Clients must not be killed abruptly : Terminating a client without letting it synchronize GPU work (e.g., kubectl delete --force, OOMKilled, node-pressure eviction) can leave the MPS server and other clients in undefined state (hangs or errors).

Monitoring cannot see individual clients : nvidia-smi and NVML attribute all activity to the MPS server process.

Connection limit : With default CUDA_DEVICE_MAX_CONNECTIONS=2, each MPS server supports at most 60 client CUDA contexts per GPU.

Experimental in device plugin : Official README states MPS support is experimental from v0.15.0; MPS only works with whole-GPU nvidia.com/gpu resources and cannot be combined with MIG.

MIG: Hardware-Level Partitioning into Smaller GPUs

MIG (Multi-Instance GPU) is supported from Ampere architecture (compute capability 8.0+). It slices GPU memory into ~1/8 chunks and SMs into ~1/7 chunks, combining them into GPU Instances (GIs). Each instance has dedicated SMs, memory, L2 cache, and memory bandwidth; faults are contained within the instance.

Instance specs use the naming <compute-slices>g.<memory>gb. For H100 80GB, common specs are 1g.10gb, 2g.20gb, 3g.40gb, 7g.80gb, with up to 7 instances per GPU. Specs cannot be arbitrarily combined; placement constraints exist, and frequent create/destroy of different specs causes fragmentation.

Trade-offs:

Only predefined specs, fixed granularity.

Changing the partitioning requires stopping all workloads on that GPU; on Ampere, switching MIG mode needs a GPU reset, and some cloud environments require a node reboot.

Limited supported models: A100, A30, H100, H200, H20, B200, B300, GB200, and some RTX PRO Blackwell. T4, L4, L40S are not supported.

vGPU: Virtualization Layer Assigns GPU to VMs

vGPU is a virtualization solution: the host runs NVIDIA vGPU Manager, each VM gets a vGPU type with fixed memory. Compute allocation has two backends:

Time-sliced vGPU : Multiple VMs share full GPU compute via host scheduler policies: Best Effort (default, idle VM's time given to busy VMs, no floor), Equal Share (running vGPUs split equally), Fixed Share (each vGPU gets a fixed slice, unchanged even if other VMs stop).

MIG-backed vGPU : Each VM gets a full MIG instance with dedicated hardware resources, unaffected by scheduler policies. Some models allow further time-slicing a single MIG instance among multiple VMs.

vGPU requires NVIDIA License System (CLS or DLS) for licenses. If the goal is merely sharing a GPU among containers in Kubernetes, vGPU is usually overkill; it fits scenarios where the GPU must be presented to a VM (e.g., Kubernetes nodes running on VMware or KVM).

Comparison and Selection

Isolation and Resource Limits

Solution       Isolation Boundary   Memory Limit          Compute Allocation
-------------  ------------------  --------------------  --------------------
Time-Slicing   None                None, can consume full GPU  All processes share time equally
MPS            Process address space  ~1/N per replica    Thread percentage ceiling
MIG            Hardware instance   Fixed per spec        Dedicated SMs
vGPU           Virtual machine     Fixed per type        Scheduler policy or MIG

Hardware Requirements and Change Cost

Solution       Hardware/License                K8s Resource Name      Config Change Cost
-------------  ------------------------------  ---------------------  --------------------
Time-Slicing   Almost any GPU                  gpu or gpu.shared    Restart device plugin
MPS            Linux, whole GPU                gpu or gpu.shared    Restart plugin and MPS daemon
MIG            Ampere+ specific models         gpu or mig-<spec>     Stop all workloads on that GPU
vGPU           Supported models + license      VM sees gpu          Usually requires VM shutdown

Resource names omit the nvidia.com/ prefix.

Selection Flow

GPU must go to a VM?
├─ Yes → vGPU
│     └─ Need hard isolation between VMs and GPU supports MIG → MIG-backed vGPU
└─ No (container sharing)
     ├─ Multi-tenant / latency SLA / untrusted, and GPU supports MIG → MIG
     │     └─ Single instance still underutilized → MIG + Time-Slicing
     ├─ Same team, multiple small processes, need memory limit → MPS
     └─ Dev, CI, batch off-peak, or GPU lacks MIG support → Time-Slicing

Combination rules:

On a single node, the device plugin can use only one sharing mode across all GPUs (cannot mix Time-Slicing on one GPU and MPS on another).

Time-Slicing and MPS cannot be enabled simultaneously on the same node.

MIG can combine with Time-Slicing (mixed strategy applies time-slicing to MIG resources) but not with MPS.

Time-Slicing can be used inside a VM with GPU passthrough or vGPU.

Note: GPU Operator 26.7 includes DRA Driver for NVIDIA GPUs (v0.5.x) using Kubernetes Dynamic Resource Allocation for GPU, MPS, and dynamic MIG. Its resource model differs from the device plugin approach and is rapidly evolving; evaluate against the corresponding version's documentation.

Pre-Change Checks (Read-Only)

Confirm Cluster Context

kubectl config current-context
kubectl config get-contexts

Verify the context matches the intended cluster; switch with kubectl config use-context <name> if needed.

Confirm Operator and ClusterPolicy

helm list -n gpu-operator
kubectl get pods -n gpu-operator -o wide

kubectl get clusterpolicies.nvidia.com cluster-policy \
  -o jsonpath='{.spec.devicePlugin.config}{"
"}{.spec.mig.strategy}{"
"}'

Check that nvidia-device-plugin-daemonset, gpu-feature-discovery, nvidia-dcgm-exporter are Running, and nvidia-cuda-validator is Completed. The first output line shows current device plugin config (empty means no sharing enabled). The second line shows MIG strategy ( single or mixed); empty means MIG not enabled at install.

Confirm Node State

kubectl get nodes -l nvidia.com/gpu.present=true \
  -L nvidia.com/gpu.product,nvidia.com/gpu.count \
  -L nvidia.com/gpu.sharing-strategy,nvidia.com/gpu.replicas \
  -L nvidia.com/mig.capable,nvidia.com/mig.config

Example output shows sharing-strategy=none, replicas=1 for exclusive mode; mig.capable=false means MIG not supported on that node.

Confirm at GPU Level

NODE=gpu-h100-01
kubectl get pods -n gpu-operator -o wide \
  --field-selector spec.nodeName="${NODE}" | grep nvidia-driver
DRV_POD=nvidia-driver-daemonset-xxxxx
kubectl exec -n gpu-operator "${DRV_POD}" -- nvidia-smi \
  --query-gpu=index,name,memory.total,mig.mode.current,compute_mode \
  --format=csv

If driver is installed on host (install with driver.enabled=false), run nvidia-smi directly on the node. Also list Pods using GPU on the node to notify them for maintenance windows.

Unified Sharing ConfigMap

Both Time-Slicing and MPS are configured via a single ConfigMap with multiple keys; ClusterPolicy references this ConfigMap; nodes select a key via label nvidia.com/device-plugin.config=<key>. Recommended: create one ConfigMap holding all sharing configs.

apiVersion: v1
kind: ConfigMap
metadata:
  name: gpu-sharing-config
  namespace: gpu-operator
data:
  t4-ts: |
    version: v1
    flags:
      migStrategy: none
    sharing:
      timeSlicing:
        renameByDefault: true
        failRequestsGreaterThanOne: true
        resources:
          - name: nvidia.com/gpu
            replicas: 4
  h100-mps: |
    version: v1
    flags:
      migStrategy: none
    sharing:
      mps:
        renameByDefault: true
        resources:
          - name: nvidia.com/gpu
            replicas: 4

Key fields: renameByDefault: true: Renames shared resource to nvidia.com/gpu.shared. Default false keeps nvidia.com/gpu with -SHARED product label suffix. Setting true prevents exclusive-workload Pods from silently landing on shared GPUs; shared workloads must change resource name. failRequestsGreaterThanOne: true: Pods requesting >1 shared replica fail with UnexpectedAdmissionError. Default false for backward compatibility; without it, a Pod asking for gpu.shared: 4 thinks it gets the whole GPU but still time-slices. migStrategy: none: These configs target non-MIG nodes. MIG nodes should not receive these labels. replicas: No universal formula; see per-solution sections.

Create and reference:

kubectl apply -n gpu-operator -f gpu-sharing-config.yaml
kubectl patch clusterpolicies.nvidia.com/cluster-policy \
  --type merge \
  -p '{"spec":{"devicePlugin":{"config":{"name":"gpu-sharing-config"}}}}

Intentionally omitting default limits impact to explicitly labeled nodes. Patching ClusterPolicy restarts device plugin and GPU Feature Discovery Pods on all GPU nodes; official docs say running workloads are unaffected but recommend a maintenance window.

Verify restart:

kubectl get events -n gpu-operator --sort-by='.lastTimestamp' | tail -n 20
kubectl get pods -n gpu-operator -o wide | grep -E 'device-plugin|feature-discovery'

Critical limitation : Operator does not watch the ConfigMap for changes. After editing the ConfigMap, manually restart the device plugin:

kubectl rollout restart -n gpu-operator \
  daemonset/nvidia-device-plugin-daemonset

Solution 1: Time-Slicing Implementation

Choosing replicas

Replicas only caps the number of Pods per GPU, no resource enforcement. Determine by:

Memory : Sum of peak memory of co-located Pods must fit within total GPU memory with headroom. Run each workload alone, record peak memory via DCGM or nvidia-smi.

Latency : More Pods → smaller time slices → higher latency. For latency-sensitive services, measure P99 at different replica counts (see Verification section) and pick the maximum meeting SLO.

Fault domain : Larger replicas means more Pods affected by a single crash.

Memory is a hard constraint; if it doesn't fit, use MPS or MIG instead.

Label the Node

NODE=gpu-t4-01
kubectl label node "${NODE}" nvidia.com/device-plugin.config=t4-ts

Verify Effect

kubectl get node "${NODE}" -L nvidia.com/gpu.sharing-strategy,nvidia.com/gpu.replicas
kubectl describe node "${NODE}" | grep -A8 -E '^Capacity|^Allocatable'

Expected for 1 T4 with replicas=4:

NAME        ...  GPU.SHARING-STRATEGY  GPU.REPLICAS
gpu-t4-01   ...  time-slicing          4
...
Capacity:
  nvidia.com/gpu:         0
  nvidia.com/gpu.shared:  4
...

Check: nvidia.com/gpu.count stays physical GPU count; nvidia.com/gpu.shared = physical GPUs × replicas; nvidia.com/gpu becomes 0.

Run a Verification Workload

Create namespace gpu-share-test. Deploy ts-verify.yaml with replicas = capacity + 1 (e.g., 5 for 4 shared GPUs), requesting nvidia.com/gpu.shared: 1. Expect 4 Running, 1 Pending with Insufficient nvidia.com/gpu.shared; Running Pods log Test PASSED.

Test failRequestsGreaterThanOne: change request to nvidia.com/gpu.shared: 2; expect UnexpectedAdmissionError and message maximum request size for shared resources is 1.

Rollback

Migrate or scale down workloads requesting nvidia.com/gpu.shared on the node.

Remove label:

kubectl label node "${NODE}" nvidia.com/device.plugin.config-

Confirm nvidia.com/gpu returns to physical count, gpu.shared disappears, sharing-strategy back to none.

Solution 2: MPS Implementation

Prerequisites

Node has MIG disabled: nvidia.com/mig.config = all-disabled or nvidia-smi shows mig.mode.current=Disabled.

No workloads requiring exclusive GPU on the node.

Accept experimental status and fault sharing; test in a dedicated node pool first.

Choosing replicas

Replicas sets both memory limit (~total memory / replicas) and compute proportion. Steps:

Run each workload alone, measure peak memory. Peak must be < total memory / replicas (account for CUDA context overhead).

Verify latency under 1/replicas compute (see Verification).

Keep replica count well below MPS client limit (default 60 contexts per GPU); a Pod may have multiple processes/contexts.

Label and Verify

NODE=gpu-h100-01
kubectl label node "${NODE}" nvidia.com/device-plugin.config=h100-mps

Check node labels and MPS control daemon Pod:

kubectl get node "${NODE}" -L nvidia.com/gpu.sharing-strategy,nvidia.com/gpu.replicas,nvidia.com/mps.capable,nvidia.com/gpu.count
kubectl get pods -n gpu-operator -o wide --field-selector spec.nodeName="${NODE}" | grep mps-control

Expected: sharing-strategy=mps, mps.capable=true, MPS control daemon Pod running, nvidia.com/gpu.shared capacity = 8 GPUs × 4 = 32.

Inspect daemon logs for applied limits:

kubectl logs -n gpu-operator -l app=nvidia-device-plugin-mps-control-daemon -c mps-control-daemon-ctr --tail=30

Look for set_default_active_thread_percentage 25 (100/replicas) and set_default_device_pinned_mem_limit (~total memory / replicas).

Verify Memory Limit Actually Works

In MPS, nvidia-smi inside container still shows full GPU memory; limit is enforced by MPS daemon. Launch a test Pod with nvidia.com/gpu.shared: 1 using a PyTorch image and run a memory probe script that allocates 1 GiB chunks until OOM:

import torch
step = 1 << 30
bufs = []
try:
    while True:
        bufs.append(torch.empty(step, dtype=torch.uint8, device="cuda"))
except RuntimeError as e:
    print(f"allocated ~{len(bufs)} GiB before {type(e).__name__}")

Pass criteria: allocated amount approaches total memory / replicas, significantly less than full GPU. If near full GPU, MPS not effective; check node label and daemon logs.

Risk : This script consumes memory aggressively; run only on a test node with no other workloads.

MPS Operational Notes

Don't force-kill GPU processes : Allow graceful exit; set adequate terminationGracePeriodSeconds; avoid kubectl delete --force.

One Pod's error can affect the whole GPU : Simultaneous CUDA errors across Pods on same GPU suggest one triggered a fatal error. MPS server enters FAULT state; new clients get CUDA_ERROR_MPS_SERVER_NOT_READY until all affected clients exit.

Monitoring only sees whole GPU : Per-Pod GPU usage must come from application-reported metrics or framework memory stats.

Rollback

Migrate/scale down gpu.shared workloads, then remove label:

kubectl label node "${NODE}" nvidia.com/device-plugin.config-

. Confirm sharing-strategy no longer mps, mps.capable=false, MPS daemon Pod gone, nvidia.com/gpu restored to physical count.

Solution 3: MIG Implementation

Choose Strategy and Specs

MIG strategy set at Operator install via mig.strategy: single: Every MIG device reported as nvidia.com/gpu. Requires all GPUs on node to use MIG with the same spec; otherwise product label becomes <model>-MIG-INVALID. mixed: Each spec becomes a distinct resource, e.g., nvidia.com/mig-1g.10gb; non-MIG GPUs remain nvidia.com/gpu.

Recommend mixed: spec visible in resource name, allows mixing specs on one GPU. Workloads must request specific resource names.

Pick specs from workload needs: measure peak memory and required compute, choose smallest spec that fits. H100 80GB built-in all-balanced yields 2× 1g.10gb, 1× 2g.20gb, 1× 3g.40gb.

From GPU Operator v26.3.0, MIG Manager creates a per-node ConfigMap <node-name>-mig-config with keys like all-disabled, all-enabled, all-1g.10gb, all-balanced. List available configs:

NODE=gpu-h100-01
kubectl get configmap -n gpu-operator "${NODE}-mig-config" -o yaml

Older driver branches (e.g., 535) may not support querying specs with MIG off; Operator falls back to static default-mig-parted-config.

Confirm current strategy, switch to mixed if needed:

kubectl get clusterpolicies.nvidia.com cluster-policy -o jsonpath='{.spec.mig.strategy}{"
"}'
kubectl patch clusterpolicies.nvidia.com/cluster-policy --type=json -p='[{"op":"replace","path":"/spec/mig/strategy","value":"mixed"}]'

Changing strategy affects all MIG nodes' resource names; ensure no workloads depend on nvidia.com/gpu for MIG devices under single.

Stop Workloads (High-Risk Step)

MIG Manager terminates all GPU Pods on the node when changing layout; existing MIG instances are destroyed, processes and memory not preserved. Pre-checks:

Notify all GPU workload owners; confirm replicas elsewhere or acceptable disruption.

Stateful workloads must have checkpoints and data persisted.

kubectl cordon "${NODE}"
kubectl drain "${NODE}" --ignore-daemonsets --delete-emptydir-data --dry-run=client

Review dry-run list, then execute without --dry-run. --delete-emptydir-data permanently deletes emptyDir data. If non-GPU workloads must stay, scale only GPU workloads to zero.

Host-installed drivers may have host GPU clients (dcgm, nvsm); MIG Manager stops/starts those listed in default-gpu-clients ConfigMap; others must be handled manually.

Apply MIG Config

kubectl label node "${NODE}" nvidia.com/mig.config=all-balanced --overwrite

Watch state:

kubectl get node "${NODE}" -w -L nvidia.com/mig.config,nvidia.com/mig.config.state
mig.config.state

goes pending → success (or rebooting if WITH_REBOOT set). If failed, check MIG Manager logs:

kubectl logs -n gpu-operator -l app=nvidia-mig-manager -c nvidia-mig-manager --tail=100

Success log ends with MIG configuration applied successfully and state set to success.

Verify

kubectl exec -n gpu-operator "${DRV_POD}" -- nvidia-smi -L
kubectl describe node "${NODE}" | grep -E 'nvidia.com/(gpu|mig-)'

Example output shows MIG devices listed and allocatable resources like nvidia.com/mig-1g.10gb: 16 (per GPU instance count × GPU count).

Uncordon and run test Pod mig-verify.yaml requesting nvidia.com/mig-1g.10gb: 1. Expect container's nvidia-smi -L to show only one MIG 1g.10gb device and vectorAdd prints Test PASSED. If container sees full GPU or multiple MIG devices, allocation is wrong; check resource name and MIG strategy.

Time-Slicing on Top of MIG

Under mixed strategy, add a sharing ConfigMap entry with migStrategy: mixed targeting a specific MIG resource (e.g., nvidia.com/mig-1g.10gb with replicas: 2), then label node with that config. flags.migStrategy must match ClusterPolicy's strategy. Time-slicing inside a MIG instance has no memory or fault isolation.

Rollback

MIG rollback = change layout again, also requires stopping workloads:

kubectl cordon "${NODE}"
# drain or scale down GPU workloads
kubectl label node "${NODE}" nvidia.com/mig.config=all-disabled --overwrite
kubectl get node "${NODE}" -L nvidia.com/mig.config.state
kubectl uncordon "${NODE}"

Wait for mig.config.state=success and nvidia.com/gpu restored to physical count.

Solution 4: vGPU Key Checkpoints

vGPU setup has two halves: host-side vGPU Manager and license service (virtualization platform responsibility); VM-side guest driver installed by GPU Operator. Only operational checkpoints covered.

Host Side: Inspect vGPU and Scheduler Policy (Read-Only)

On KVM host:

nvidia-smi vgpu
nvidia-smi vgpu -sc
nvidia-smi vgpu -ss
vgpu

: Lists vGPUs running on each physical GPU. -sc: Shows scheduler capabilities (supported policies: Best Effort, Equal Share, Fixed Share) and time-slice range. -ss: Shows current scheduler state, e.g., Scheduler Policy : Equal Share.

Best Effort is default, no guaranteed compute floor. For latency-sensitive inference sharing a GPU, evaluate Equal Share or Fixed Share. Both are strict round-robin; Equal Share adjusts share count with running vGPUs, Fixed Share keeps share constant.

Two ways to change policy: nvidia-smi vgpu set-scheduler-state: Immediate but lost on driver reload/host reboot; requires target GPU to have zero vGPUs at execution time. RmPVMRL registry key: Persistent but needs driver reload or host reboot. Values per NVIDIA vGPU docs.

Both require stopping all VMs on that GPU first. Follow platform change process: migrate/stop VMs, test on one host, confirm nvidia-smi vgpu -ss shows expected policy, then roll out. MIG-backed vGPU with dedicated GPU instance ignores scheduler policy.

VM Side: GPU Operator Installs vGPU Guest Driver

Prerequisites:

Without NVIDIA AI Enterprise license: download guest driver from NVIDIA Licensing Portal, build driver container image, push to private registry. Pushing vGPU driver to public registry violates EULA. With AI Enterprise license, use pre-built NGC images.

License config via Secret named licensing-config containing gridd.conf and client_configuration_token.tok.

kubectl create secret generic licensing-config -n gpu-operator \
  --from-file=gridd.conf --from-file=client_configuration_token.tok
gridd.conf
FeatureType

must match purchased license type. Token is sensitive; keep out of Git, distribute via secrets management.

After install, verify in Kubernetes:

kubectl get nodes -l nvidia.com/gpu.present=true \
  -L nvidia.com/vgpu.present,nvidia.com/vgpu.host-driver-version
vgpu.present=true

means device plugin detected vGPU. Exec into driver Pod, run nvidia-smi -q, check license fields. License issues: verify VM-to-CLS/DLS connectivity and token expiry.

VM's Kubernetes sees a regular GPU; Time-Slicing can be layered inside vGPU VM.

Verification: Is Sharing Actually Usable?

"Pod runs" only proves scheduling works, not that sharing meets business needs. Run three validations before production.

1. Capacity and Isolation

Check          Method                Pass Standard
-------------  --------------------  -----------------------------------
Capacity       describe node         Allocatable = GPU count × replicas or instances
Memory Isolation  Memory probe script  MPS/MIG do not exceed limit
Device Visibility  Container nvidia-smi -L  MIG sees only assigned instance

2. Noisy Neighbor Interference

Most critical differentiator. Steps:

Baseline: Target service alone on a GPU (or exclusive instance), run existing load test at fixed concurrency, record P50, P99 latency, throughput, error rate.

Shared: On other replicas/instances of same GPU, run a sustained saturating interferer (e.g., vectorAdd loop or real batch job), repeat same load test.

Compare.

Pass standard defined by business: shared P99 and error rate within service SLO. Do not adopt others' numbers; results vary by model, batch size, GPU type. General expectation: MIG least interference, MPS next, Time-Slicing most; but verify with your workload.

3. Failure Drill

In test env, cause a Pod sharing a GPU to crash abnormally (trigger CUDA error or OOM). Observe if other Pods on same GPU are affected and recovery time. Use results to define alerts and auto-recovery, not assumptions.

Monitoring Version Changes

GPU Operator v26.7.3 includes DCGM Exporter 4.9.0 with renamed metrics and units; upgrades break existing dashboards/alerts. Examples: DCGM_FI_DEV_GPU_UTIL (percent) → DCGM_FI_DEV_GPU_UTIL_RATIO (0-1) DCGM_FI_DEV_FB_USED (MiB) → DCGM_FI_DEV_FB_USED_BYTES (bytes) DCGM_FI_DRIVER_VERSION → DCGM_FI_SYSTEM_DRIVER_VERSION New: DCGM_FI_DEV_FB_CAPACITY_BYTES (total memory bytes)

Memory usage ratio per GPU:

DCGM_FI_DEV_FB_USED_BYTES / DCGM_FI_DEV_FB_CAPACITY_BYTES

First curl your DCGM Exporter /metrics to confirm actual metric names and labels before writing queries/alerts.

Sharing-specific monitoring limits:

Time-Slicing: Official docs state DCGM Exporter cannot associate metrics to specific containers.

MPS: All client activity attributed to MPS server process; per-Pod breakdown requires application metrics.

MIG: DCGM Exporter reports per MIG instance; from 4.9.0, whole-GPU fields (power, temperature) reported once per physical GPU, not duplicated per instance, avoiding double-counting in sums.

No universal alert thresholds: derive from baseline test memory peaks and latency distributions combined with business SLO.

Common Failures and Troubleshooting

Always correlate at least two evidence sources (e.g., node labels + plugin logs, Pod events + GPU-level output).

Time-Slicing/MPS Configured but Capacity Unchanged

Symptom: nvidia.com/gpu.shared missing, gpu.replicas stays 1.

Check:

kubectl get clusterpolicies.nvidia.com cluster-policy -o jsonpath='{.spec.devicePlugin.config}{"
"}'
kubectl get configmap -n gpu-operator gpu-sharing-config -o jsonpath='{.data}' | head -c 600; echo
kubectl get node "${NODE}" -L nvidia.com/device-plugin.config
DP_POD=$(kubectl get pods -n gpu-operator -o name --field-selector spec.nodeName="${NODE}" | grep nvidia-device-plugin-daemonset)
kubectl logs -n gpu-operator "${DP_POD}" -c config-manager --tail=50
kubectl logs -n gpu-operator "${DP_POD}" -c nvidia-device-plugin --tail=50

Common causes (by frequency):

ConfigMap created in wrong namespace (not Operator's namespace).

ClusterPolicy config.name mismatches ConfigMap name.

Node label value not a key in ConfigMap (typo).

ConfigMap edited but device plugin not restarted (Operator doesn't watch ConfigMap).

MPS node has MIG enabled.

After fix, recheck capacity with describe node and verify config-manager logs show loaded config name.

Pod Reports UnexpectedAdmissionError

Event contains maximum request size for shared resources is 1. Cause: failRequestsGreaterThanOne enabled, Pod requested >1 shared replica. Fix: change request to 1, delete old Pod, redeploy (won't self-recover).

Pod Stays Pending with Insufficient Resource

Compare Pod's requested resource name with node's allocatable resources. renameByDefault: true → request gpu.shared; MIG mixed → request mig-<spec>. If names match but still Pending, capacity may be exhausted.

Time-Slicing Pods OOM Each Other

Symptom: Pods on same GPU intermittently hit CUDA OOM; individually they run fine. Evidence: DCGM DCGM_FI_DEV_FB_USED_BYTES near total GPU capacity at failure time; multiple Pods scheduled on same GPU. This is expected Time-Slicing behavior, not a bug. Mitigations: reduce replicas; limit per-process memory in framework (e.g., inference framework memory fraction); switch to MPS or MIG.

MPS Node: Multiple Pods Simultaneously Report CUDA Errors

Symptom: Several Pods on same GPU error nearly simultaneously; new Pods fail with CUDA_ERROR_MPS_SERVER_NOT_READY. Evidence: MPS daemon logs show FAULT state and affected client PIDs; dmesg -T | grep -i xid shows Xid at same time. Root cause: one client triggered fatal GPU error or was force-terminated. Fix: let all affected Pods exit; MPS server rebuilds context and recovers; identify trigger by PID, fix application or move it off shared node.

MIG Config Stuck in Failed

Symptom: nvidia.com/mig.config.state=failed. Check MIG Manager logs and nvidia-smi on driver Pod/host for lingering GPU processes. Common causes:

Workloads still running on GPU, or host GPU client processes outside managed list.

Chosen spec combination doesn't fit on this GPU model.

Using single strategy with multiple specs → product label shows -MIG-INVALID.

Cloud environment requires reboot for MIG mode switch but WITH_REBOOT not set.

After fix, re-apply label with --overwrite to retry.

vGPU Scheduler Policy Change Fails

nvidia-smi vgpu set-scheduler-state

errors. Usually because target GPU still has vGPUs. Stop/migrate VMs off that GPU, retry, confirm with nvidia-smi vgpu -ss.

Long-Term Maintenance

Store sharing ConfigMap, custom MIG configs, node label plans in Git; changes go through review.

After ConfigMap edits, remember rollout restart device plugin and record in change log.

Separate node pools by sharing mode (exclusive, Time-Slicing, MPS, MIG) using labels and taints; easier than mixing in one pool.

Before GPU Operator upgrade, read release notes focusing on device plugin, MIG Manager, DCGM Exporter changes. v26.7.3 metric rename is a breaking-change example.

After any sharing parameter change, re-run interference tests (Verification section) and archive results as baseline for next adjustment.

Appendix: Inspection and Change Scripts

Two scripts require kubectl and jq; executor needs read access to nodes, Pods, ConfigMaps, ClusterPolicy; second script also needs node label write permission.

gpu-share-inspect.sh (Read-Only Inspection)

Outputs GPU node details, ClusterPolicy config, non-healthy Operator Pods, and Pods requesting nvidia.com/* resources. Logs to timestamped file under ./logs.

NS=gpu-operator ./gpu-share-inspect.sh gpu-h100-01

gpu-share-label.sh (Single-Node Label Change, Dry-Run Default)

Changes one label on one node. Default prints planned command; requires --context (matching current context) and --apply to execute. For MIG label changes, node must be cordoned and have no running Pods requesting nvidia.com/* resources.

./gpu-share-label.sh --context prod-gpu --node gpu-t4-01 --kind ts --value t4-ts
# after review
./gpu-share-label.sh --context prod-gpu --node gpu-t4-01 --kind ts --value t4-ts --apply

Script logs old value and rollback command. MIG rollback similarly requires stopping workloads then --kind mig --value all-disabled.

References

NVIDIA GPU Operator Release Notes: https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/release-notes.html

NVIDIA GPU Operator Platform Support: https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/platform-support.html

Time-Slicing GPUs in Kubernetes: https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/gpu-sharing.html

GPU Operator with MIG: https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/gpu-operator-mig.html

Using NVIDIA vGPU: https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/install-gpu-operator-vgpu.html

NVIDIA k8s-device-plugin README: https://github.com/NVIDIA/k8s-device-plugin

NVIDIA k8s-device-plugin Releases: https://github.com/NVIDIA/k8s-device-plugin/releases

NVIDIA Multi-Process Service Docs: https://docs.nvidia.com/deploy/mps/index.html

When to Use MPS: https://docs.nvidia.com/deploy/mps/when-to-use-mps.html

MIG User Guide - Supported GPUs: https://docs.nvidia.com/datacenter/tesla/mig-user-guide/supported-gpus.html

MIG User Guide - Concepts: https://docs.nvidia.com/datacenter/tesla/mig-user-guide/concepts.html

DCGM Exporter Releases: https://github.com/NVIDIA/dcgm-exporter/releases

NVIDIA Virtual GPU Software Versions: https://docs.nvidia.com/vgpu/index.html

Changing Scheduling Behavior for Time-Sliced vGPUs: https://docs.nvidia.com/vgpu/latest/grid-vgpu-user-guide/changing-vgpu-scheduling-policy.html

NVIDIA AI Enterprise - Scheduling Policies: https://docs.nvidia.com/ai-enterprise/release-8/latest/infra-software/vgpu/features/scheduling.html

NVIDIA AI Enterprise - Choosing a vGPU Mode for Inference: https://docs.nvidia.com/ai-enterprise/release-9/latest/infra-software/vgpu/features/inference-mode-decision.html

Crusoe Support - Enable NVIDIA MPS on Crusoe Managed Kubernetes: https://support.crusoecloud.com/hc/en-us/articles/55454830024859-How-To-Enable-NVIDIA-MPS-GPU-Sharing-on-Crusoe-Managed-Kubernetes

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

KubernetesGPU schedulingvGPUMPSTime-SlicingMIGGPU sharingNVIDIA GPU Operator

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion