forked from kubernetes-sigs/dra-driver-nvidia-gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmps-control-daemon.tmpl.yaml
More file actions
75 lines (72 loc) · 2.23 KB
/
mps-control-daemon.tmpl.yaml
File metadata and controls
75 lines (72 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: {{ .MpsControlDaemonNamespace }}
name: {{ .MpsControlDaemonName }}
labels:
app.kubernetes.io/name: {{ .AppLabelValue }}
component: {{ .MpsControlDaemonName }}
spec:
replicas: 1
selector:
matchLabels:
component: {{ .MpsControlDaemonName }}
template:
metadata:
labels:
component: {{ .MpsControlDaemonName }}
spec:
nodeName: {{ .NodeName }}
hostPID: true
containers:
- name: mps-control-daemon
image: {{ .MpsImageName }}
securityContext:
privileged: true
command: [chroot, /driver-root, sh, -c]
args:
- |-
set -e
rm -f /var/log/nvidia-mps/startup.log
nvidia-cuda-mps-control -d
{{- if .DefaultActiveThreadPercentage }}
echo set_default_active_thread_percentage {{.DefaultActiveThreadPercentage}} | nvidia-cuda-mps-control
{{- end}}
{{- range $id, $limit := .DefaultPinnedDeviceMemoryLimits }}
echo set_default_device_pinned_mem_limit {{ $id }} {{ $limit }} | nvidia-cuda-mps-control
{{- end}}
echo "startup complete" > /var/log/nvidia-mps/startup.log
tail -n +1 -f /var/log/nvidia-mps/control.log
startupProbe:
exec:
command:
- cat
- /driver-root/var/log/nvidia-mps/startup.log
initialDelaySeconds: 1
periodSeconds: 1
env:
- name: CUDA_VISIBLE_DEVICES
value: "{{ .CUDA_VISIBLE_DEVICES }}"
volumeMounts:
- name: driver-root
mountPath: /driver-root
- name: mps-shm-directory
mountPath: /driver-root/dev/shm
- name: mps-pipe-directory
mountPath: /driver-root/tmp/nvidia-mps
- name: mps-log-directory
mountPath: /driver-root/var/log/nvidia-mps
volumes:
- name: driver-root
hostPath:
path: {{ .NvidiaDriverRoot }}
- name: mps-shm-directory
hostPath:
path: {{ .MpsShmDirectory }}
- name: mps-pipe-directory
hostPath:
path: {{ .MpsPipeDirectory }}
- name: mps-log-directory
hostPath:
path: {{ .MpsLogDirectory }}