diff --git a/cmd/nvidia-dra-plugin/cdi.go b/cmd/nvidia-dra-plugin/cdi.go index 5c405e54..997865fb 100644 --- a/cmd/nvidia-dra-plugin/cdi.go +++ b/cmd/nvidia-dra-plugin/cdi.go @@ -91,6 +91,7 @@ func NewCDIHandler(opts ...cdiOption) (*CDIHandler, error) { nvcdi.WithMode("nvml"), nvcdi.WithVendor(h.vendor), nvcdi.WithClass(h.class), + nvcdi.WithNVIDIACTKPath(h.nvidiaCTKPath), ) if err != nil { return nil, fmt.Errorf("unable to create CDI library: %w", err) diff --git a/deployments/helm/k8s-dra-driver/templates/kubeletplugin.yaml b/deployments/helm/k8s-dra-driver/templates/kubeletplugin.yaml index c2b7dd69..bb0a4a57 100644 --- a/deployments/helm/k8s-dra-driver/templates/kubeletplugin.yaml +++ b/deployments/helm/k8s-dra-driver/templates/kubeletplugin.yaml @@ -76,6 +76,8 @@ spec: resources: {{- toYaml .Values.kubeletPlugin.containers.plugin.resources | nindent 10 }} env: + - name: NVIDIA_CTK_PATH + value: "{{ .Values.nvidiaCtkPath }}" - name: NVIDIA_DRIVER_ROOT value: "{{ .Values.nvidiaDriverRoot }}" - name: NVIDIA_VISIBLE_DEVICES diff --git a/deployments/helm/k8s-dra-driver/values.yaml b/deployments/helm/k8s-dra-driver/values.yaml index 41d77cf1..512cdd7c 100644 --- a/deployments/helm/k8s-dra-driver/values.yaml +++ b/deployments/helm/k8s-dra-driver/values.yaml @@ -22,6 +22,11 @@ # For driver installed directly on a host, a value of `/` is used. nvidiaDriverRoot: / +# Specify the path of CTK binary (nvidia-ctk) on the host, +# as it should appear in the the generated CDI specification. +# The path depends on the system that runs on the node. +nvidiaCtkPath: /usr/bin/nvidia-ctk + nameOverride: "" fullnameOverride: "" namespaceOverride: ""