Skip to content

Commit 5ac593e

Browse files
authored
Merge pull request #877 from elezar/add-compatlibs-option
Disable mounting of compat libs from container by default
2 parents 12367de + 07f45ea commit 5ac593e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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

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

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

internal/config/features.go

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

1919
// features specifies a set of named features.
2020
type features struct {
21-
// DisableImexChannelCreation ensures that the implicit creation of
22-
// requested IMEX channels is skipped when invoking the nvidia-container-cli.
23-
DisableImexChannelCreation *feature `toml:"disable-imex-channel-creation,omitempty"`
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"`
2424
// AllowLDConfigFromContainer allows non-host ldconfig paths to be used.
2525
// If this feature flag is not set to 'true' only host-rooted config paths
2626
// (i.e. paths starting with an '@' are considered valid)
2727
AllowLDConfigFromContainer *feature `toml:"allow-ldconfig-from-container,omitempty"`
28+
// DisableImexChannelCreation ensures that the implicit creation of
29+
// requested IMEX channels is skipped when invoking the nvidia-container-cli.
30+
DisableImexChannelCreation *feature `toml:"disable-imex-channel-creation,omitempty"`
2831
}
2932

3033
type feature bool

0 commit comments

Comments
 (0)