Specify library search paths for CSV CDI spec generation

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2023-07-18 12:02:37 +02:00
parent 03a4e2f8a9
commit 8553fce68a
6 changed files with 45 additions and 15 deletions

View File

@@ -44,6 +44,7 @@ func (l *csvlib) GetAllDeviceSpecs() ([]specs.Device, error) {
tegra.WithDriverRoot(l.driverRoot),
tegra.WithNVIDIACTKPath(l.nvidiaCTKPath),
tegra.WithCSVFiles(l.csvFiles),
tegra.WithLibrarySearchPaths(l.librarySearchPaths...),
)
if err != nil {
return nil, fmt.Errorf("failed to create discoverer for CSV files: %v", err)

View File

@@ -38,13 +38,14 @@ type wrapper struct {
}
type nvcdilib struct {
logger logger.Interface
nvmllib nvml.Interface
mode string
devicelib device.Interface
deviceNamer DeviceNamer
driverRoot string
nvidiaCTKPath string
logger logger.Interface
nvmllib nvml.Interface
mode string
devicelib device.Interface
deviceNamer DeviceNamer
driverRoot string
nvidiaCTKPath string
librarySearchPaths []string
csvFiles []string

View File

@@ -103,3 +103,11 @@ func WithCSVFiles(csvFiles []string) Option {
o.csvFiles = csvFiles
}
}
// WithLibrarySearchPaths sets the library search paths.
// This is currently only used for CSV-mode.
func WithLibrarySearchPaths(paths []string) Option {
return func(o *nvcdilib) {
o.librarySearchPaths = paths
}
}