Memory-Enforced GPU Sharing in Kubernetes with NVIDIA CUDA 13.4
NVIDIA CUDA 13.4 introduces memory boundary enforcement in Kubernetes using the GPU Fractioning Operator and KAI Scheduler to manage GPU resources efficiently.
Introduction to Memory-Enforced GPU Sharing in Kubernetes
Memory-Enforced GPU Sharing in Kubernetes with NVIDIA CUDA 13.4 introduces a new approach to managing GPU resources in cloud and data center environments. This method leverages the open-source GPU Fractioning Operator and KAI Scheduler to enforce per-workload memory limits at scale. According to NVIDIA Developer, this innovation is hosted under the KAI Scheduler organization on GitHub and aims to improve resource allocation efficiency in Kubernetes clusters. CUDA 13.4, as noted in NVIDIA Developer, introduces memory boundary enforcement that is transparent to applications, offering exact memory amounts, guaranteed minimums with burstable maximums, and a choice between time-slicing and sm-sharing compute modes. However, as NVIDIA Developer explains, CUDA alone cannot be used directly in a Kubernetes cluster without additional components to bridge the gap between the GPU capabilities and Kubernetes orchestration.
Integration of KAI Scheduler and GPU Fractioning Operator
The integration of the KAI Scheduler and the GPU Fractioning Operator in Kubernetes enables memory-enforced GPU sharing through NVIDIA CUDA 13.4. Starting with KAI Scheduler v0.18.0, the scheduler supports a GPU-sharing mode called NvFractions, which writes per-container Pod annotations specifying memory requests, limits, compute mode, and GPU device assignments. These annotations are then read by the GPU Fractioning Operator, which configures the assigned GPUs to enforce the workload’s memory limits and compute mode. Annotations such as nvidia.com/container..gpu-memory.request and nvidia.com/container..gpu-memory.limit define guaranteed and maximum GPU memory allocations, respectively, while nvidia.com/container..gpu-compute.mode specifies whether time-slicing or SM-sharing is used. The nvidia.com/container..gpus.devices annotation identifies which GPUs are assigned to the container. This mechanism allows any Kubernetes scheduler that can write these annotations to enforce GPU fractions with CUDA, as noted in the documentation.
Configuration and Annotation Details for GPU Fractioning
Configuration of memory-enforced GPU sharing in Kubernetes with NVIDIA CUDA 13.4 requires specific annotations to define resource limits and compute modes. For absolute size requests, the annotation nvidia.com/container.<c>.gpu-memory.limit is used with a value like “80Gi”. For portion-based limits, kai.scheduler/container.<c>.gpu-memory.portion.limit is applied with a value such as “0.8”, as described in Table 2 (NVIDIA Developer). The compute mode can be explicitly set per container using nvidia.com/container.app.gpu-compute.mode, with options “sm-sharing” or “time-slicing” (NVIDIA Developer). When using time-slicing, the gpu-fraction.limit and gpu-fraction-num-devices annotations can be configured to allow a job to use half a GPU across two devices, potentially growing to 80% utilization when memory is available (NVIDIA Developer).
Compute Mode and Memory Enforcement in CUDA 13.4
NVIDIA CUDA 13.4 introduces a new time-sharing mode that enforces a memory boundary transparently to the application, alongside the existing compute sharing mode (sm-sharing) in MPS. This update allows for more efficient GPU resource allocation in Kubernetes environments. According to NVIDIA Developer, the new mode ensures that each workload sharing a GPU receives roughly 1/n of the compute resources, where n is the number of workloads. The difference between the modes lies in whether workloads take turns or run concurrently. As noted in NVIDIA Developer, this division of compute resources remains consistent regardless of the mode. Additionally, NVIDIA Developer indicates that running nvidia-smi in the container should display two GPUs, each reflecting the workload’s fractional memory share. These features enhance memory enforcement and improve the manageability of GPU resources in containerized environments.
Getting Started with KAI Scheduler and GPU Fractioning Operator
Getting started with the KAI Scheduler and GPU Fractioning Operator involves accessing their repositories on GitHub under the KAI Scheduler organization. Installation and configuration instructions are available in the admin and user guides, covering all three sharing mechanisms. These tools enable memory-enforced GPU sharing in Kubernetes environments, allowing for more efficient utilization of GPU resources. The KAI Scheduler, developed by NVIDIA, is designed to work with NVIDIA CUDA 13.4, providing a framework for managing GPU resources in AI workloads. The GPU Fractioning Operator complements this by enabling fine-grained control over GPU allocation, ensuring that memory constraints are respected during resource sharing. This approach is particularly useful in cloud and data center environments where multiple users or workloads require access to the same GPU resources. The tools are part of NVIDIA's broader efforts to enhance Kubernetes scheduling and GPU resource management for AI applications.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.