Set skip-mode-detection in the toolkit-container by default

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-03-09 09:49:50 +02:00
parent 3a11f6ee0a
commit ccf73f2505

View File

@ -51,6 +51,8 @@ type options struct {
ContainerRuntimeDebug string
ContainerRuntimeLogLevel string
ContainerRuntimeHookSkipModeDetection bool
ContainerCLIDebug string
toolkitRoot string
@ -137,6 +139,12 @@ func main() {
Destination: &opts.ContainerRuntimeModesCdiDefaultKind,
EnvVars: []string{"NVIDIA_CONTAINER_RUNTIME_MODES_CDI_DEFAULT_KIND"},
},
&cli.BoolFlag{
Name: "nvidia-container-runtime-hook.skip-mode-detection",
Value: true,
Destination: &opts.ContainerRuntimeHookSkipModeDetection,
EnvVars: []string{"NVIDIA_CONTAINER_RUNTIME_HOOK_SKIP_MODE_DETECTION"},
},
&cli.StringFlag{
Name: "nvidia-container-cli-debug",
Usage: "Specify the location of the debug log file for the NVIDIA Container CLI",
@ -371,6 +379,9 @@ func installToolkitConfig(toolkitConfigPath string, nvidiaContainerCliExecutable
// Set nvidia-ctk options
config.Set("nvidia-ctk.path", nvidiaCTKPath)
// Set the nvidia-container-runtime-hook options
config.Set("nvidia-container-runtime-hook.skip-mode-detection", opts.ContainerRuntimeHookSkipModeDetection)
_, err = config.WriteTo(targetConfig)
if err != nil {
return fmt.Errorf("error writing config: %v", err)