Skip to main content
AI on Kubernetes · GPU/NPULesson 5 of 20

Sharing Accelerators (Time-Slicing, MPS)

When a small model holds a whole GPU, most of it sits idle. With DRA you can write a sharing strategy (TimeSlicing or MPS) into the device claim’s config so several Pods share one GPU. With no sharing config, which this lesson calls “none”, a claim gets a whole GPU. This lesson uses NVIDIA’s DRA driver for GPUs as the example. Node-wide MIG and time-slicing through the GPU Operator are covered in Sharing GPUs.

Sharing modenone (no config)
Who uses the GPU1 Pod
Isolationno interference
Quota charged—
GPU nodeOperatordeploy settingsDevice claimResourceClaim+sharingDRA driverapplies sharingOne GPUNVIDIA GPUDeploy Areplica 1Deploy Areplica 2Deploy Bsame namespaceDeploy Csame namespaceno sharingwhole GPU
RequestAppears in a later step

What you will learn

  • The default "none" gives each Pod a whole GPU
  • In DRA, Pods that reference the same claim share its device
  • Time-slicing takes turns and has no memory isolation
  • MPS runs Pods at the same time under set limits
  • Quota is counted per claim

The three modes​

NoneTime-slicingMPS
Who sharesNobodyPods referencing the same claimPods referencing the same claim
HowWhole GPUTake turns in timeRun at once under caps
IsolationNo interferenceNo memory isolation or performance guaranteeConcurrent within caps; weak fault isolation

Try it yourself​

kubectl get resourceclaims -n <namespace> # Named claim shared by several Pods (step 3)
kubectl get resourceclaim <name> -n <namespace> -o jsonpath='{.status.reservedFor[*].name}' # Pods using this claim
kubectl get resourceclaim <name> -n <namespace> -o jsonpath='{.spec.devices.config}' # TimeSlicing or MPS settings
kubectl exec <pod> -- nvidia-smi # e.g. NVIDIA: shared GPU memory and processes (step 5)
kubectl describe quota -n <namespace> # Charged per claim, not per Pod (step 8)

Check yourself

  1. With DRA, how do several Pods end up sharing one GPU?
  2. Deployment A is scaled from 1 to 2 replicas on a time-sliced claim. What should you expect?
  3. Deployments B and C share one MPS claim with a ResourceQuota on DRA devices. How many GPUs are charged, and what is the main risk?

Further reading: Dynamic Resource Allocation · DRA Driver for NVIDIA GPUs · Time-slicing with the DRA driver · MPS with the DRA driver · NVIDIA MPS