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:
@@ -51,7 +51,8 @@ type options struct {
|
||||
class string
|
||||
|
||||
csv struct {
|
||||
files cli.StringSlice
|
||||
files cli.StringSlice
|
||||
librarySearchPaths cli.StringSlice
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +135,11 @@ func (m command) build() *cli.Command {
|
||||
Value: cli.NewStringSlice(csv.DefaultFileList()...),
|
||||
Destination: &opts.csv.files,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "csv.library-search-path",
|
||||
Usage: "Specify the path to search for libraries when discovering the entities that should be included in the CDI specification. This currently only affects CDI mode",
|
||||
Destination: &opts.csv.librarySearchPaths,
|
||||
},
|
||||
}
|
||||
|
||||
return &c
|
||||
@@ -227,6 +233,7 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) {
|
||||
nvcdi.WithDeviceNamer(deviceNamer),
|
||||
nvcdi.WithMode(string(opts.mode)),
|
||||
nvcdi.WithCSVFiles(opts.csv.files.Value()),
|
||||
nvcdi.WithLibrarySearchPaths(opts.csv.librarySearchPaths.Value()),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create CDI library: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user