diff --git a/pkg/nvcdi/options.go b/pkg/nvcdi/options.go index 5a490619..417687b9 100644 --- a/pkg/nvcdi/options.go +++ b/pkg/nvcdi/options.go @@ -18,6 +18,7 @@ package nvcdi import ( "github.com/NVIDIA/go-nvlib/pkg/nvlib/device" + "github.com/NVIDIA/go-nvlib/pkg/nvlib/info" "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" @@ -34,6 +35,13 @@ func WithDeviceLib(devicelib device.Interface) Option { } } +// WithInfoLib sets the info library for CDI spec generation. +func WithInfoLib(infolib info.Interface) Option { + return func(l *nvcdilib) { + l.infolib = infolib + } +} + // WithDeviceNamers sets the device namer for the library func WithDeviceNamers(namers ...DeviceNamer) Option { return func(l *nvcdilib) {