You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(manifests): add NVML init container for NVIDIA GPU Operator support
Closes#2484
Kepler failed to load NVML on clusters using the NVIDIA GPU Operator
because the operator exposes driver libraries at /run/nvidia/driver
(driver-container root FS) but the chart mounted that hostPath directly
into the Kepler container, pulling in glibc from the driver image and
breaking dynamic linking.
Replace the direct hostPath mount with an init container that copies
only libnvidia-ml.so* into an emptyDir mounted at
/usr/local/nvidia/lib64. The emptyDir holds just the NVML libraries --
no glibc conflict.
Changes:
manifests/helm/kepler/values.yaml
- Chart-only knobs under daemonset.nvidia.* (not config.experimental.gpu.*
so templates/configmap.yaml does not leak chart internals into the
binary config). Enabling config.experimental.gpu.enabled also
triggers the init-container plumbing.
manifests/helm/kepler/templates/daemonset.yaml
- Gated nvidia-libs init container, emptyDir mount, and
LD_LIBRARY_PATH when gpu.enabled is true.
manifests/k8s/daemonset.yaml
- Same pattern, unconditional (raw manifest has no values system).
.pre-commit-config.yaml
- Local helm-lint-gpu hook for the gpu.enabled=true variant (keeps
validation in pre-commit rather than a dedicated CI job).
docs/user/installation.md
- Document GPU Operator enablement, overrides, and flag coupling.
Init container notes (deep rationale):
- Copy globs the known driver lib dirs (usr/lib64,
usr/lib/{x86_64,aarch64}-linux-gnu) instead of running find over the
driver root FS. That root contains the driver container's /proc:
find walked procfs for minutes and exited nonzero on unreadable
fdinfo entries, so init crash-looped on real GPU Operator clusters.
- set -e with no || true on the copy pass so ENOSPC/EACCES fail init.
- cp -P (not -L): preserve the driver symlink chain so leftover
driver versions do not blow past the 200Mi emptyDir sizeLimit.
- runAsUser/runAsGroup 0 with capabilities dropped for root-owned
driver libs without depending on the image USER directive.
- NVIDIA_VISIBLE_DEVICES / NVIDIA_MIG_MONITOR_DEVICES stay
unconditional for the runtimeClassName: nvidia workaround.
Verified: helm lint passes both states; gpu-disabled render has no
init/nvml volume path; gpu-enabled ConfigMap keeps only
enabled/idlePower/dcgmEndpoint under experimental.gpu. Init validated
end to end on a 4-node kubeadm cluster (staged driver root with live
procfs: sub-second copy, symlink chain intact, no-driver fallback on
3 nodes, usr/lib64 layout) and against a Tesla T4 where NVML was
initialized strictly from the copied directory.
Signed-off-by: Himanshu Verma <himnshuverma10152006@gmail.com>
#### Enabling GPU Power Monitoring (NVIDIA GPU Operator)
104
+
105
+
To export GPU power metrics on clusters with the [NVIDIA GPU Operator](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/overview.html), enable the experimental GPU flag. The chart then adds an `nvidia-libs` init container that copies `libnvidia-ml.so*` from the host driver path into an `emptyDir`, and points `LD_LIBRARY_PATH` at it:
- Adds an `nvidia-libs` init container that copies `libnvidia-ml.so*` into a 200Mi `emptyDir` using `cp -P` (preserves the driver symlink chain; `cp -L` can exceed the size limit when leftover driver versions are present).
117
+
- Mounts that `emptyDir` read-only at `/usr/local/nvidia/lib64` and sets `LD_LIBRARY_PATH=/usr/local/nvidia/lib64`.
118
+
- Mounts the host driver directory (default `/run/nvidia/driver`, overridable via `daemonset.nvidia.driverPath`) with `DirectoryOrCreate` so non-GPU nodes still schedule.
119
+
120
+
Defaults assume the standard GPU Operator layout. Override via `values.yaml` if needed:
121
+
122
+
```yaml
123
+
config:
124
+
experimental:
125
+
gpu:
126
+
enabled: true
127
+
128
+
daemonset:
129
+
nvidia:
130
+
driverPath: /run/nvidia/driver
131
+
nvmlInitImage:
132
+
repository: busybox
133
+
tag: 1.36.1
134
+
```
135
+
136
+
Note: `config.experimental.gpu.enabled` is intentionally coupled with the chart's `daemonset.nvidia.*` plumbing. Enabling the binary flag without the init path (or the reverse) is not a supported split. Leave `enabled: false` if you do not want GPU power monitoring.
0 commit comments