Skip to content

Commit 5d246ad

Browse files
authored
Merge pull request #376 from elezar/cherry-pick-v1.14.6
Cherry pick v1.14.6
2 parents d57d834 + 8281e7d commit 5d246ad

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# NVIDIA Container Toolkit Changelog
22

3+
## v1.14.6
34
* Add support for extracting device major number from `/proc/devices` if `nvidia` is used as a device name over `nvidia-frontend`.
5+
* Add support for selecting IMEX channels using the NVIDIA_IMEX_CHANNELS environement variable.
46

57
## v1.14.5
68
* Fix `nvidia-ctk runtime configure --cdi.enabled` for Docker. This was incorrectly setting `experimental = true` instead

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import (
99
"path/filepath"
1010
"strings"
1111

12-
"github.com/NVIDIA/nvidia-container-toolkit/internal/config/image"
1312
"github.com/opencontainers/runtime-spec/specs-go"
1413
"golang.org/x/mod/semver"
14+
15+
"github.com/NVIDIA/nvidia-container-toolkit/internal/config/image"
1516
)
1617

1718
const (
@@ -22,6 +23,7 @@ const (
2223
envNVVisibleDevices = "NVIDIA_VISIBLE_DEVICES"
2324
envNVMigConfigDevices = "NVIDIA_MIG_CONFIG_DEVICES"
2425
envNVMigMonitorDevices = "NVIDIA_MIG_MONITOR_DEVICES"
26+
envNVImexChannels = "NVIDIA_IMEX_CHANNELS"
2527
envNVDriverCapabilities = "NVIDIA_DRIVER_CAPABILITIES"
2628
)
2729

@@ -37,6 +39,7 @@ type nvidiaConfig struct {
3739
Devices string
3840
MigConfigDevices string
3941
MigMonitorDevices string
42+
ImexChannels string
4043
DriverCapabilities string
4144
// Requirements defines the requirements DSL for the container to run.
4245
// This is empty if no specific requirements are needed, or if requirements are
@@ -271,6 +274,13 @@ func getMigMonitorDevices(env map[string]string) *string {
271274
return nil
272275
}
273276

277+
func getImexChannels(env map[string]string) *string {
278+
if chans, ok := env[envNVImexChannels]; ok {
279+
return &chans
280+
}
281+
return nil
282+
}
283+
274284
func (c *HookConfig) getDriverCapabilities(env map[string]string, legacyImage bool) image.DriverCapabilities {
275285
// We use the default driver capabilities by default. This is filtered to only include the
276286
// supported capabilities
@@ -324,6 +334,11 @@ func getNvidiaConfig(hookConfig *HookConfig, image image.CUDA, mounts []Mount, p
324334
log.Panicln("cannot set MIG_MONITOR_DEVICES in non privileged container")
325335
}
326336

337+
var imexChannels string
338+
if c := getImexChannels(image); c != nil {
339+
imexChannels = *c
340+
}
341+
327342
driverCapabilities := hookConfig.getDriverCapabilities(image, legacyImage).String()
328343

329344
requirements, err := image.GetRequirements()
@@ -335,6 +350,7 @@ func getNvidiaConfig(hookConfig *HookConfig, image image.CUDA, mounts []Mount, p
335350
Devices: devices,
336351
MigConfigDevices: migConfigDevices,
337352
MigMonitorDevices: migMonitorDevices,
353+
ImexChannels: imexChannels,
338354
DriverCapabilities: driverCapabilities,
339355
Requirements: requirements,
340356
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ func doPrestart() {
126126
if len(nvidia.MigMonitorDevices) > 0 {
127127
args = append(args, fmt.Sprintf("--mig-monitor=%s", nvidia.MigMonitorDevices))
128128
}
129+
if len(nvidia.ImexChannels) > 0 {
130+
args = append(args, fmt.Sprintf("--imex-channel=%s", nvidia.ImexChannels))
131+
}
129132

130133
for _, cap := range strings.Split(nvidia.DriverCapabilities, ",") {
131134
if len(cap) == 0 {

third_party/libnvidia-container

Submodule libnvidia-container updated from 8971b92 to d2eb0af

versions.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
LIB_NAME := nvidia-container-toolkit
16-
LIB_VERSION := 1.14.5
16+
LIB_VERSION := 1.14.6
1717
LIB_TAG :=
1818

1919
# The package version is the combination of the library version and tag.

0 commit comments

Comments
 (0)