Skip to content

Commit d3f6cdb

Browse files
committed
Add disableIMEXChannelCreation feature flag
Signed-off-by: Evan Lezar <[email protected]>
1 parent d0c8fce commit d3f6cdb

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func doPrestart() {
9595
if cli.LoadKmods {
9696
args = append(args, "--load-kmods")
9797
}
98+
if hook.Features.DisableIMEXChannelCreation.IsEnabled() {
99+
args = append(args, "--no-create-imex-channels")
100+
}
98101
if cli.NoPivot {
99102
args = append(args, "--no-pivot")
100103
}

internal/config/features.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ package config
1919
type featureName string
2020

2121
const (
22-
FeatureGDS = featureName("gds")
23-
FeatureMOFED = featureName("mofed")
24-
FeatureNVSWITCH = featureName("nvswitch")
25-
FeatureGDRCopy = featureName("gdrcopy")
26-
FeatureIncludePersistencedSocket = featureName("include-persistenced-socket")
22+
FeatureGDS = featureName("gds")
23+
FeatureMOFED = featureName("mofed")
24+
FeatureNVSWITCH = featureName("nvswitch")
25+
FeatureGDRCopy = featureName("gdrcopy")
26+
27+
FeatureDisableIMEXChannelCreation = featureName("disable-imex-channel-creation")
2728
)
2829

2930
// features specifies a set of named features.
@@ -32,9 +33,9 @@ type features struct {
3233
MOFED *feature `toml:"mofed,omitempty"`
3334
NVSWITCH *feature `toml:"nvswitch,omitempty"`
3435
GDRCopy *feature `toml:"gdrcopy,omitempty"`
35-
// IncludePersistencedSocket enables the injection of the nvidia-persistenced
36-
// socket into containers.
37-
IncludePersistencedSocket *feature `toml:"include-persistenced-socket,omitempty"`
36+
// DisableIMEXChannelCreation ensures that the implicit creation of
37+
// requested IMEX channels is skipped when invoking the nvidia-container-cli.
38+
DisableIMEXChannelCreation *feature `toml:"disable-imex-channel-creation,omitempty"`
3839
}
3940

4041
type feature bool
@@ -54,8 +55,8 @@ func (fs features) IsEnabledInEnvironment(n featureName, in ...getenver) bool {
5455
case FeatureGDRCopy:
5556
return fs.GDRCopy.isEnabledWithEnvvarOverride("NVIDIA_GDRCOPY", in...)
5657
// Features without envvar overrides
57-
case FeatureIncludePersistencedSocket:
58-
return fs.IncludePersistencedSocket.IsEnabled()
58+
case FeatureDisableIMEXChannelCreation:
59+
return fs.DisableIMEXChannelCreation.IsEnabled()
5960
default:
6061
return false
6162
}

0 commit comments

Comments
 (0)