-
Notifications
You must be signed in to change notification settings - Fork 26
Add simple options for enabling Gremlin GPU access #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
70bb987
0281768
c5e802d
a5526c8
ed9b656
cd043d5
9048fe0
7be99b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| {{- /* | ||
| Projects an OpenCL ICD registry file into the Gremlin container. | ||
|
|
||
| Some NVIDIA container runtimes inject the OpenCL driver library (libnvidia-opencl.so.1) but do | ||
| NOT create the /etc/OpenCL/vendors/<vendor>.icd registry file that the ICD loader reads to | ||
| discover the driver. Without it, the OpenCL platforms cannot be listed. | ||
|
|
||
| The ICD filename and library come from the selected vendor preset (see gremlinGpuVendorPreset). | ||
| See gremlinGpuOpenclIcdActive for when this is rendered. | ||
| */ -}} | ||
| {{- if include "gremlinGpuOpenclIcdActive" . }} | ||
| {{- $eff := fromYaml (include "gremlinGpuEffective" .) }} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "gremlin.fullname" . }}-opencl-icd | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| helm.sh/chart: {{ include "gremlin.chart" . }} | ||
| app.kubernetes.io/name: {{ include "gremlin.fullname" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| data: | ||
| {{ $eff.openclIcd.filename }}: | | ||
| {{ $eff.openclIcd.library }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| {{- /* | ||
| Creates the RuntimeClass referenced by the GPU configuration when it does not already exist. | ||
|
|
||
| NOTE: `lookup` only sees the cluster during `helm install`/`upgrade`. Under `helm template` or a | ||
| GitOps renderer with no cluster access, `lookup` returns empty and the RuntimeClass is rendered. | ||
| Set gremlin.gpu.createRuntimeClass to false if you manage the RuntimeClass yourself. | ||
| */ -}} | ||
| {{- if .Values.gremlin.gpu.enabled -}} | ||
| {{- $runtimeClassName := include "gremlinGpuRuntimeClassName" . -}} | ||
| {{- if and $runtimeClassName .Values.gremlin.gpu.createRuntimeClass -}} | ||
| {{- if not (lookup "node.k8s.io/v1" "RuntimeClass" "" $runtimeClassName) }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, I think the use of I think the problem of preventing collisions with an existing runtimeClass is solved by If we want a better error message for someone that has the class already, we can use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the normal use case will be that a customer already has the runtimeclass existing for their normal application, but unfortunately not having the runtime makes the gremlin pod unschedulable, so it's a hard call honestly. |
||
| apiVersion: node.k8s.io/v1 | ||
| kind: RuntimeClass | ||
| metadata: | ||
| name: {{ $runtimeClassName }} | ||
| labels: | ||
| app.kubernetes.io/name: {{ include "gremlin.name" . }} | ||
| helm.sh/chart: {{ include "gremlin.chart" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| handler: {{ $runtimeClassName | quote }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need unit tests for this document?