Merge branch 'revert-nvlink' into 'master'

Revert support for NVIDIA_FABRIC_DEVICES

See merge request nvidia/container-toolkit/container-toolkit!41
This commit is contained in:
Evan Lezar 2021-08-20 08:39:49 +00:00
commit 28ee3d5fd5
7 changed files with 5 additions and 55 deletions

View File

@ -17,8 +17,8 @@ MKDIR ?= mkdir
DIST_DIR ?= $(CURDIR)/dist
LIB_NAME := nvidia-container-toolkit
LIB_VERSION := 1.6.0
LIB_TAG ?= rc.1
LIB_VERSION := 1.5.1
LIB_TAG ?=
GOLANG_VERSION := 1.16.3
MODULE := github.com/NVIDIA/nvidia-container-toolkit

View File

@ -23,7 +23,6 @@ const (
envNVVisibleDevices = "NVIDIA_VISIBLE_DEVICES"
envNVMigConfigDevices = "NVIDIA_MIG_CONFIG_DEVICES"
envNVMigMonitorDevices = "NVIDIA_MIG_MONITOR_DEVICES"
envNVFabricDevices = "NVIDIA_FABRIC_DEVICES"
envNVDriverCapabilities = "NVIDIA_DRIVER_CAPABILITIES"
)
@ -44,7 +43,6 @@ type nvidiaConfig struct {
Devices string
MigConfigDevices string
MigMonitorDevices string
FabricDevices string
DriverCapabilities string
Requirements []string
DisableRequire bool
@ -318,13 +316,6 @@ func getMigMonitorDevices(env map[string]string) *string {
return nil
}
func getFabricDevices(env map[string]string) *string {
if devices, ok := env[envNVFabricDevices]; ok {
return &devices
}
return nil
}
func getDriverCapabilities(env map[string]string, legacyImage bool) *string {
// Grab a reference to the capabilities from the envvar
// if it actually exists in the environment.
@ -403,11 +394,6 @@ func getNvidiaConfig(hookConfig *HookConfig, env map[string]string, mounts []Mou
driverCapabilities = *c
}
var nvFabricDevices string
if d := getFabricDevices(env); d != nil {
nvFabricDevices = *d
}
requirements := getRequirements(env, legacyImage)
// Don't fail on invalid values.
@ -417,7 +403,6 @@ func getNvidiaConfig(hookConfig *HookConfig, env map[string]string, mounts []Mou
Devices: devices,
MigConfigDevices: migConfigDevices,
MigMonitorDevices: migMonitorDevices,
FabricDevices: nvFabricDevices,
DriverCapabilities: driverCapabilities,
Requirements: requirements,
DisableRequire: disableRequire,

View File

@ -403,30 +403,6 @@ func TestGetNvidiaConfig(t *testing.T) {
privileged: false,
expectedPanic: true,
},
{
description: "fabric devices selected",
env: map[string]string{
envNVVisibleDevices: "all",
envNVFabricDevices: "all",
},
expectedConfig: &nvidiaConfig{
Devices: "all",
FabricDevices: "all",
DriverCapabilities: defaultDriverCapabilities,
},
},
{
description: "fabric devices selected empty",
env: map[string]string{
envNVVisibleDevices: "all",
envNVFabricDevices: "",
},
expectedConfig: &nvidiaConfig{
Devices: "all",
FabricDevices: "",
DriverCapabilities: defaultDriverCapabilities,
},
},
}
for _, tc := range tests {
t.Run(tc.description, func(t *testing.T) {

View File

@ -132,9 +132,6 @@ func doPrestart() {
if len(nvidia.MigMonitorDevices) > 0 {
args = append(args, fmt.Sprintf("--mig-monitor=%s", nvidia.MigMonitorDevices))
}
if len(nvidia.FabricDevices) > 0 {
args = append(args, fmt.Sprintf("--fabric-device=%s", nvidia.FabricDevices))
}
for _, cap := range strings.Split(nvidia.DriverCapabilities, ",") {
if len(cap) == 0 {

View File

@ -1,9 +1,3 @@
nvidia-container-toolkit (1.6.0~rc.1-1) UNRELEASED; urgency=medium
* Add support for NVIDIA_FABRIC_DEVICES to select nvlink and nvswitch devices
-- NVIDIA CORPORATION <cudatools@nvidia.com> Fri, 13 Aug 2021 09:00:00 -0700
nvidia-container-toolkit (1.5.1-1) UNRELEASED; urgency=medium
* Fix bug where Docker Swarm device selection is ignored if

View File

@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9)
Package: nvidia-container-toolkit
Architecture: any
Depends: ${misc:Depends}, libnvidia-container-tools (>= 1.5.0~rc.1), libnvidia-container-tools (<< 2.0.0)
Depends: ${misc:Depends}, libnvidia-container-tools (>= 1.4.0), libnvidia-container-tools (<< 2.0.0)
Breaks: nvidia-container-runtime (<< 2.0.0), nvidia-container-runtime-hook
Replaces: nvidia-container-runtime (<< 2.0.0), nvidia-container-runtime-hook
Description: NVIDIA container runtime hook

View File

@ -18,7 +18,7 @@ Source4: LICENSE
Obsoletes: nvidia-container-runtime < 2.0.0, nvidia-container-runtime-hook
Provides: nvidia-container-runtime-hook
Requires: libnvidia-container-tools >= 1.5.0-0.1.rc.1, libnvidia-container-tools < 2.0.0
Requires: libnvidia-container-tools >= 1.4.0, libnvidia-container-tools < 2.0.0
%description
Provides a OCI hook to enable GPU support in containers.
@ -53,10 +53,8 @@ rm -f %{_bindir}/nvidia-container-runtime-hook
/usr/share/containers/oci/hooks.d/oci-nvidia-hook.json
%changelog
* Fri Aug 13 2021 NVIDIA CORPORATION <cudatools@nvidia.com> 1.6.0-0.1.rc.1
- Add support for NVIDIA_FABRIC_DEVICES to select nvlink and nvswitch devices
* Mon Jun 14 2021 NVIDIA CORPORATION <cudatools@nvidia.com> 1.5.1-1
- Fix bug where Docker Swarm device selection is ignored if NVIDIA_VISIBLE_DEVICES is also set
- Improve unit testing by using require package and adding coverage reports
- Remove unneeded go dependencies by running go mod tidy