-
Define the time-slicing configuration.
a. Create a file called
time-slicing-config-all.yaml
with the following contents:apiVersion: v1 kind: ConfigMap metadata: name: time-slicing-config-all data: any: |- version: v1 flags: migStrategy: none sharing: timeSlicing: resources: - name: nvidia.com/gpu replicas: 4
b. Create the namespace for the operator and add the config map
kubectl create ns gpu-operator kubectl create -n gpu-operator -f time-slicing-config-all.yaml
-
Add nvidia's helm repository
See: docs.nvidia
# helm repo add nvdp https://nvidia.github.io/k8s-device-plugin
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
helm install gpu-operator nvidia/gpu-operator \
-n gpu-operator \
--set devicePlugin.config.name=time-slicing-config-all
- Apply the time-slicing configuration
See docs.nvidia
kubectl patch clusterpolicy/cluster-policy \
-n gpu-operator --type merge \
-p '{"spec": {"devicePlugin": {"config": {"name": "time-slicing-config-all", "default": "any"}}}}'
kubectl label node <node-name> nvidia.com/device-plugin.config=any
- Verify time-slicing
see docs.nvidia
kubectl describe node <node-name>