diff --git a/cmd/nvidia-container-runtime-hook/main.go b/cmd/nvidia-container-runtime-hook/main.go index f53a649a..a4a963f4 100644 --- a/cmd/nvidia-container-runtime-hook/main.go +++ b/cmd/nvidia-container-runtime-hook/main.go @@ -90,11 +90,6 @@ func doPrestart() { args := []string{getCLIPath(cli)} - // Only include the nvidia-persistenced socket if it is explicitly enabled. - if !hook.Features.IncludePersistencedSocket.IsEnabled() { - args = append(args, "--no-persistenced") - } - if cli.Root != "" { args = append(args, fmt.Sprintf("--root=%s", cli.Root)) } @@ -117,6 +112,11 @@ func doPrestart() { } args = append(args, "configure") + // Only include the nvidia-persistenced socket if it is explicitly enabled. + if !hook.Features.IncludePersistencedSocket.IsEnabled() { + args = append(args, "--no-persistenced") + } + if ldconfigPath := cli.NormalizeLDConfigPath(); ldconfigPath != "" { args = append(args, fmt.Sprintf("--ldconfig=%s", ldconfigPath)) }