Commit 3c44080
committed
device: add hasSymbol guard to GetAddressingModeAsString
While debugging nvidia-dra-driver-gpu on a test cluster running
NVIDIA driver 570.148.08, the kubelet-plugin was crashing on startup
because GetAddressingModeAsString() calls nvmlDeviceGetAddressingMode
without checking whether the symbol exists in the loaded NVML library.
That API was added in NVML v580 (driver 580+), so on older drivers
the symbol is absent from libnvml.so. Since the library is opened
with RTLD_LAZY, the first call crashes the process.
IsCoherent() already guards against this with hasSymbol(). This
applies the same pattern to GetAddressingModeAsString(). Callers
now get ("", nil) when the symbol is missing, which is the same
result they already get when the symbol is present but returns
ERROR_NOT_SUPPORTED.
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>1 parent d0c20b7 commit 3c44080
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| |||
0 commit comments