diff --git a/CHANGELOG.md b/CHANGELOG.md index d64605dc..aa52deba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ * Remove installation of OCI hook JSON from RPM package. * Refactored config for `nvidia-container-runtime-hook`. * Added a `nvidia-ctk config` command which supports setting config options using a `--set` flag. +* Added `--library-search-path` option to `nvidia-ctk cdi generate` command in `csv` mode. This allows folders where + libraries are located to be specified explicitly. ## v1.14.0-rc.2 * Fix bug causing incorrect nvidia-smi symlink to be created on WSL2 systems with multiple driver roots. diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index 8a6f061b..1afb7550 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -50,9 +50,10 @@ type options struct { vendor string class string + librarySearchPaths cli.StringSlice + csv struct { - files cli.StringSlice - librarySearchPaths cli.StringSlice + files cli.StringSlice } } @@ -110,6 +111,11 @@ func (m command) build() *cli.Command { Usage: "Specify the NVIDIA GPU driver root to use when discovering the entities that should be included in the CDI specification.", Destination: &opts.driverRoot, }, + &cli.StringSliceFlag{ + Name: "library-search-path", + Usage: "Specify the path to search for libraries when discovering the entities that should be included in the CDI specification.\n\tNote: This option only applies to CSV mode.", + Destination: &opts.librarySearchPaths, + }, &cli.StringFlag{ Name: "nvidia-ctk-path", Usage: "Specify the path to use for the nvidia-ctk in the generated CDI specification. If this is left empty, the path will be searched.", @@ -135,11 +141,6 @@ 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 @@ -233,7 +234,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()), + nvcdi.WithLibrarySearchPaths(opts.librarySearchPaths.Value()), ) if err != nil { return nil, fmt.Errorf("failed to create CDI library: %v", err)