Skip to content

Commit 2310ed7

Browse files
committed
Add allow-cuda-compat-libs-from-container feature flag
This change adds an allow-cuda-compat-libs-from-container feature flag to the NVIDIA Container Toolkit config. This allows a user to opt-in to the previous default behaviour of overriding certain driver libraries with CUDA compat libraries from the container. Signed-off-by: Evan Lezar <[email protected]>
1 parent f2b3e8d commit 2310ed7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/nvidia-container-runtime-hook/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ func doPrestart() {
114114
}
115115
args = append(args, "configure")
116116

117-
args = append(args, "--no-cntlibs")
118-
117+
if !hook.Features.AllowCUDACompatLibsFromContainer.IsEnabled() {
118+
args = append(args, "--no-cntlibs")
119+
}
119120
if ldconfigPath := cli.NormalizeLDConfigPath(); ldconfigPath != "" {
120121
args = append(args, fmt.Sprintf("--ldconfig=%s", ldconfigPath))
121122
}

internal/config/features.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ package config
1818

1919
// features specifies a set of named features.
2020
type features struct {
21+
// AllowCUDACompatLibsFromContainer allows CUDA compat libs from a container
22+
// to override certain driver library mounts from the host.
23+
AllowCUDACompatLibsFromContainer *feature `toml:"allow-cuda-compat-libs-from-container,omitempty"`
2124
// AllowLDConfigFromContainer allows non-host ldconfig paths to be used.
2225
// If this feature flag is not set to 'true' only host-rooted config paths
2326
// (i.e. paths starting with an '@' are considered valid)

0 commit comments

Comments
 (0)