Managing graphical processing units in containerized environments often presents a difficult cost dilemma, as smaller workloads can underutilize entire hardware cards while standard orchestrator configurations treat hardware strictly as whole units.
Default Scheduling and the NVIDIA Device Plugin
By default, Kubernetes relies on the NVIDIA device plugin running as a DaemonSet to discover hardware accelerators and advertise them to the kubelet as an extended resource named nvidia.com/gpu. Because the API server restricts extended resources exclusively to integers, workloads cannot request fractional cards, forcing engineers to adopt alternative sharing paradigms. Furthermore, the scheduler only evaluates raw counts rather than specific memory sizes, device models, or real-time compute load unless operators manually configure node labels and selectors.
Comparing Sharing Methods: Time-Slicing, MIG, and MPS
To overcome whole-number limitations, platforms employ distinct sharing strategies that vary widely in their isolation capabilities. Time-slicing configures the device plugin to expose multiple virtual replicas per card, though it provides zero memory or fault isolation, meaning a crash in one container impacts all others on that hardware. In contrast, Multi-Instance GPU (MIG) physically partitions supported hardware into up to seven isolated instances with dedicated memory paths and predictable performance, though reconfiguring layouts remains disruptive. Meanwhile, Multi-Process Service (MPS) offers concurrent kernel execution and isolated address spaces with compute and memory limits, but similarly lacks robust fault containment, meaning fatal errors from a single client can still propagate across the entire device.

Modernizing Allocation with Dynamic Resource Allocation
Moving beyond simple integer counts, Dynamic Resource Allocation (DRA)—which reached general availability in Kubernetes 1.34 and features locked feature gates in version 1.35—transforms how clusters bind accelerators. Instead of requesting a basic resource count, pods reference resource claims and template definitions that utilize Common Expression Language (CEL) expressions. This allows the scheduler to evaluate specific hardware attributes like minimum frame buffer capacity directly. While full devices and existing MIG configurations are production-ready in the NVIDIA DRA driver, advanced capabilities like consumable shares remain experimental alpha gates requiring careful migration planning.
Architectural Tradeoffs and Cost Optimization Strategies
Choosing the optimal GPU sharing architecture requires balancing cost reduction against operational predictability, performance degradation risks, and security boundaries. Organizations must weigh whether a development team requires isolated memory partitions or can safely tolerate shared fault domains under time-slicing configurations. For production workloads running inference with strict latency targets or multi-tenant environments where security is paramount, dedicated MIG instances or whole cards remain the most reliable choice, whereas exploratory notebooks and bursty testing benefit from lightweight time-slicing replicas. Concurrently, calculating true return on investment demands separating hardware reservations from active utilization metrics gathered via the DCGM exporter, tracking parameters like graphics engine activity and memory consumption rather than relying solely on pod allocation states. Failing to decouple active workloads from idle pod allocations can cause cluster autoscalers to miscalculate node utilization, keeping underperforming infrastructure online needlessly. Ultimately, successful multi-tenant GPU management depends on aligning the chosen sharing abstraction with specific workload requirements, establishing strict resource quotas, isolating nodes through proper taints and tolerances, and continuously monitoring unit economics to verify that hardware consolidation genuinely yields financial savings without compromising application reliability.
Cover: Google, Inc. · CC BY 4.0 · Wikimedia Commons. Layout and headline text by Signal Titans. Logo: Kubernetes, via Wikimedia Commons (Public domain).
Source: Kubernetes GPU Sharing: MIG, Time-Slicing, MPS and DRA · Kubernetes GPU Sharing: MIG, Time-Slicing, MPS and DRA

Leave a Reply