diff --git a/tools/container/toolkit/toolkit.go b/tools/container/toolkit/toolkit.go index 5bae0f5c..8f93db7d 100644 --- a/tools/container/toolkit/toolkit.go +++ b/tools/container/toolkit/toolkit.go @@ -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)