Skip to content

Commit f7e1e37

Browse files
sutaakaropenshift-merge-bot[bot]
authored andcommitted
Add support for NVidia GPU Time slicing
1 parent eae5837 commit f7e1e37

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

github-actions/nvidia-gpu-operator/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: "Install NVidia GPU operator for KinD"
22
description: "Step to install NVidia GPU operator for KinD, based on https://www.substratus.ai/blog/kind-with-gpus"
33

4+
inputs:
5+
enable-time-slicing:
6+
description: "Enable time slicing for NVidia GPU operator"
7+
required: false
8+
default: 'false'
9+
time-slicing-capacity:
10+
description: "Time slicing GPU multiplier"
11+
required: false
12+
default: 4
13+
414
runs:
515
using: "composite"
616
steps:
@@ -23,3 +33,12 @@ runs:
2333
run: |
2434
kubectl describe nodes
2535
shell: bash
36+
37+
- name: Configuring Time-Slicing for NVidia GPU operator
38+
if: inputs.enable-time-slicing == 'true'
39+
run: |
40+
sudo sed -i "s/<REPLICAS>/${{ inputs.time-slicing-capacity }}/" ${GITHUB_ACTION_PATH}/resources/time-slicing-config.yaml
41+
kubectl create -n gpu-operator -f ${GITHUB_ACTION_PATH}/resources/time-slicing-config.yaml
42+
kubectl patch clusterpolicies.nvidia.com/cluster-policy -n gpu-operator --type merge -p '{"spec": {"devicePlugin": {"config": {"name": "time-slicing-config", "default": "any"}}}}'
43+
kubectl wait --timeout=120s --for=jsonpath='{.status.capacity.nvidia\.com/gpu}'=${{ inputs.time-slicing-capacity }} node/cluster-control-plane
44+
shell: bash
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: time-slicing-config
5+
data:
6+
any: |-
7+
version: v1
8+
flags:
9+
migStrategy: none
10+
sharing:
11+
timeSlicing:
12+
resources:
13+
- name: nvidia.com/gpu
14+
replicas: <REPLICAS>

0 commit comments

Comments
 (0)