Skip to content

Commit 7ba4ea6

Browse files
committed
Add disable-cuda-compat-lib-hook feature flag
Signed-off-by: Evan Lezar <[email protected]>
1 parent a48b726 commit 7ba4ea6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/config/features.go

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ type features struct {
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+
// DisableCUDACompatLibHook, when enabled skips the injection of a specific
29+
// hook to process CUDA compatibility libraries.
30+
//
31+
// Note: Since this mechanism replaces the logic in the `nvidia-container-cli`,
32+
// toggling this feature has no effect if `allow-cuda-compat-libs-from-container` is enabled.
33+
DisableCUDACompatLibHook *feature `toml:"disable-cuda-compat-lib-hook,omitempty"`
2834
// DisableImexChannelCreation ensures that the implicit creation of
2935
// requested IMEX channels is skipped when invoking the nvidia-container-cli.
3036
DisableImexChannelCreation *feature `toml:"disable-imex-channel-creation,omitempty"`

internal/modifier/gated.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ func NewFeatureGatedModifier(logger logger.Interface, cfg *config.Config, image
7979
discoverers = append(discoverers, d)
8080
}
8181

82-
if !cfg.Features.AllowCUDACompatLibsFromContainer.IsEnabled() {
82+
if !cfg.Features.AllowCUDACompatLibsFromContainer.IsEnabled() && !cfg.Features.DisableCUDACompatLibHook.IsEnabled() {
8383
compatLibHookDiscoverer := discover.NewCUDACompatHookDiscoverer(logger, cfg.NVIDIACTKConfig.Path, driver)
8484
discoverers = append(discoverers, compatLibHookDiscoverer)
85+
// For legacy mode, we also need to inject a hook to update the LDCache
86+
// after we have modifed the configuration.
8587
if cfg.NVIDIAContainerRuntimeConfig.Mode == "legacy" {
8688
ldcacheUpdateHookDiscoverer, err := discover.NewLDCacheUpdateHook(
8789
logger,

0 commit comments

Comments
 (0)