mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Specify library search paths for CSV CDI spec generation
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user