Mount host NVIDIA libraries into device plugin for NVML access

The device plugin needs libnvidia-ml.so to discover GPUs even when using
CDI annotations. Mount /run/opengl-driver/lib (NixOS NVIDIA lib path)
into the pod and set LD_LIBRARY_PATH.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-02-19 12:34:20 -08:00
commit 5194de13b9

View file

@ -28,6 +28,8 @@ spec:
value: cdi-annotations
- name: CDI_ROOT
value: /var/run/cdi
- name: LD_LIBRARY_PATH
value: /run/nvidia/lib
securityContext:
allowPrivilegeEscalation: false
capabilities:
@ -38,6 +40,9 @@ spec:
- name: cdi-specs
mountPath: /var/run/cdi
readOnly: true
- name: nvidia-libs
mountPath: /run/nvidia/lib
readOnly: true
volumes:
- name: device-plugins
hostPath:
@ -45,3 +50,6 @@ spec:
- name: cdi-specs
hostPath:
path: /var/run/cdi
- name: nvidia-libs
hostPath:
path: /run/opengl-driver/lib