Skip to content

Commit 3e6c2b7

Browse files
committed
address review comment
Signed-off-by: Tariq Ibrahim <[email protected]>
1 parent 6266ef3 commit 3e6c2b7

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

tools/container/nvidia-toolkit/run.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const (
2828
)
2929

3030
var availableRuntimes = map[string]struct{}{"docker": {}, "crio": {}, "containerd": {}}
31+
var defaultLowLevelRuntimes = []string{"docker-runc", "runc", "crun"}
3132

3233
var waitingForSignal = make(chan bool, 1)
3334
var signalReceived = make(chan bool, 1)
@@ -161,6 +162,7 @@ func Run(c *cli.Context, o *options) error {
161162
if err != nil {
162163
return fmt.Errorf("unable to determine runtime options: %w", err)
163164
}
165+
lowlevelRuntimePaths = append(lowlevelRuntimePaths, defaultLowLevelRuntimes...)
164166

165167
o.toolkitOptions.ContainerRuntimeRuntimes = *cli.NewStringSlice(lowlevelRuntimePaths...)
166168
}

tools/container/toolkit/toolkit.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ func installToolkitConfig(c *cli.Context, toolkitConfigPath string, nvidiaContai
452452
"nvidia-container-runtime-hook.skip-mode-detection": opts.ContainerRuntimeHookSkipModeDetection,
453453
}
454454

455-
toolkitRuntimeList := getNvidiaContainerRuntimeList(cfg, opts.ContainerRuntimeRuntimes.Value())
455+
toolkitRuntimeList := opts.ContainerRuntimeRuntimes.Value()
456456
if len(toolkitRuntimeList) > 0 {
457457
configValues["nvidia-container-runtime.runtimes"] = toolkitRuntimeList
458458
}
@@ -790,19 +790,3 @@ func generateCDISpec(opts *Options, nvidiaCDIHookPath string) error {
790790

791791
return nil
792792
}
793-
794-
// getNvidiaContainerRuntimeList returns a consolidated list of low-level runtimes to be used by the toolkit
795-
func getNvidiaContainerRuntimeList(cfgToml *config.Toml, containerRuntimeBinaries []string) []string {
796-
var ctkRuntimes []string
797-
nvidiaCTKConfig, err := cfgToml.Config()
798-
if err == nil {
799-
if len(containerRuntimeBinaries) > 0 {
800-
ctkRuntimes = append(ctkRuntimes, containerRuntimeBinaries...)
801-
}
802-
defaultCfgRuntimes := nvidiaCTKConfig.NVIDIAContainerRuntimeConfig.Runtimes
803-
ctkRuntimes = append(ctkRuntimes, defaultCfgRuntimes...)
804-
} else {
805-
log.Warningf("could not get nvidia container toolkit config: %v", err)
806-
}
807-
return ctkRuntimes
808-
}

0 commit comments

Comments
 (0)