Commit b578788
Prevent operand pods from starting before nvidia driver is loaded
When an operand pod (mig-manager, device-plugin, GFD, etc.) is created
while the nvidia driver module is not loaded, the nvidia container runtime
wrapper falls back to plain runc/crun. This means no NVIDIA libraries are
injected into the container — the container is permanently broken for its
lifetime.
The init containers in these pods gate on the toolkit-ready sentinel file,
but this file can be validly present from a running operator-validator
even while the driver is temporarily unloaded (e.g., during a driver
container restart). The sentinel file system validates that components
were installed correctly but does not validate that the nvidia kernel
module is currently loaded — which is the actual condition required for
the container runtime to inject NVIDIA libraries.
Add a /proc/modules check for the nvidia kernel module alongside the
existing toolkit-ready file check in all operand init containers. This
ensures the main container is not created until the nvidia module is
loaded, guaranteeing the runtime wrapper invokes the real
nvidia-container-runtime (which injects libraries) instead of falling
back to runc.
Additionally, add preStop lifecycle hooks to the toolkit and driver
containers to clean up sentinel files (toolkit-ready, driver-ready) on
graceful termination. This prevents downstream init containers from
passing on stale files when pods are properly terminated during upgrades
or drains.
Co-authored-by: Shiva Kumar <shivaku@nvidia.com>
Signed-off-by: Rajath Agasthya <ragasthya@nvidia.com>1 parent 652724d commit b578788
8 files changed
Lines changed: 11 additions & 7 deletions
File tree
- assets
- gpu-feature-discovery
- state-container-toolkit
- state-dcgm-exporter
- state-dcgm
- state-device-plugin
- state-driver
- state-mig-manager
- state-mps-control-daemon
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments