Skip to content

Commit 081baa5

Browse files
jfroyelezar
authored andcommitted
Pass driver root to nvinfo.New in device plugin main
The `nvinfo` instance passed to `validateFlags` needs to have the driver root path, otherwise the `HasNvml` call will fail (`libnvidia-ml.so.1` won't be found). This will in turn cause `validateFlags` to error out if `AnyCDIEnabled` is true. Signed-off-by: Jean-Francois Roy <jeroy@nvidia.com>
1 parent 49edade commit 081baa5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd/nvidia-device-plugin/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ func startPlugins(c *cli.Context, o *options) ([]plugin.Interface, bool, error)
338338
)
339339
devicelib := device.New(nvmllib)
340340
infolib := nvinfo.New(
341+
nvinfo.WithRoot(string(driverRoot)),
341342
nvinfo.WithNvmlLib(nvmllib),
342343
nvinfo.WithDeviceLib(devicelib),
343344
)

0 commit comments

Comments
 (0)