Skip to content

Commit 6b8589d

Browse files
Merge branch 'cherry-pick-v1.13.5' into 'release-1.13'
Cherry pick changes for v1.13.5 release See merge request nvidia/container-toolkit/container-toolkit!446
2 parents 206ac20 + 60a6077 commit 6b8589d

File tree

6 files changed

+70
-20
lines changed

6 files changed

+70
-20
lines changed

.nvidia-ci.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,6 @@ scan-centos7-amd64:
138138
needs:
139139
- image-centos7
140140

141-
scan-centos7-arm64:
142-
extends:
143-
- .dist-centos7
144-
- .platform-arm64
145-
- .scan
146-
needs:
147-
- image-centos7
148-
- scan-centos7-amd64
149-
allow_failure: true
150-
151141
scan-ubuntu20.04-amd64:
152142
extends:
153143
- .dist-ubuntu20.04

CHANGELOG.md

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

3+
## v1.13.5
4+
* Remove dependency on `coreutils` when installing the NVIDIA Container Toolkit on RPM-based systems.
5+
* Added support for detecting GSP firmware at custom paths when generating CDI specifications.
6+
7+
* [libnvidia-container] Include Shared Compiler Library (libnvidia-gpucomp.so) in the list of compute libaries.
8+
39
## v1.13.4
410
* [toolkit-container] Bump CUDA base image version to 12.2.0.
511

packaging/rpm/SPECS/nvidia-container-toolkit.spec

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ mkdir -p %{buildroot}/usr/share/containers/oci/hooks.d
5757
install -m 644 -t %{buildroot}/usr/share/containers/oci/hooks.d oci-nvidia-hook.json
5858

5959
%post
60-
mkdir -p %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
61-
cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
60+
if [ $1 -gt 1 ]; then # only on package upgrade
61+
mkdir -p %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
62+
cp -af %{_bindir}/nvidia-container-runtime-hook %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit
63+
fi
6264

6365
%posttrans
6466
if [ ! -e %{_bindir}/nvidia-container-runtime-hook ]; then
65-
# reparing lost file nvidia-container-runtime-hook
67+
# repairing lost file nvidia-container-runtime-hook
6668
cp -avf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit/nvidia-container-runtime-hook %{_bindir}
6769
fi
6870
rm -rf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit

pkg/nvcdi/driver-nvml.go

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package nvcdi
1818

1919
import (
2020
"fmt"
21+
"os"
2122
"path/filepath"
2223
"strings"
2324

@@ -26,6 +27,7 @@ import (
2627
"github.com/NVIDIA/nvidia-container-toolkit/internal/lookup/cuda"
2728
"github.com/sirupsen/logrus"
2829
"gitlab.com/nvidia/cloud-native/go-nvlib/pkg/nvml"
30+
"golang.org/x/sys/unix"
2931
)
3032

3133
// NewDriverDiscoverer creates a discoverer for the libraries and binaries associated with a driver installation.
@@ -55,7 +57,10 @@ func newDriverVersionDiscoverer(logger *logrus.Logger, driverRoot string, nvidia
5557
return nil, fmt.Errorf("failed to create discoverer for IPC sockets: %v", err)
5658
}
5759

58-
firmwares := NewDriverFirmwareDiscoverer(logger, driverRoot, version)
60+
firmwares, err := NewDriverFirmwareDiscoverer(logger, driverRoot, version)
61+
if err != nil {
62+
return nil, fmt.Errorf("failed to create discoverer for GSP firmware: %v", err)
63+
}
5964

6065
binaries := NewDriverBinariesDiscoverer(logger, driverRoot)
6166

@@ -100,18 +105,65 @@ func NewDriverLibraryDiscoverer(logger *logrus.Logger, driverRoot string, nvidia
100105
return d, nil
101106
}
102107

108+
func getUTSRelease() (string, error) {
109+
utsname := &unix.Utsname{}
110+
if err := unix.Uname(utsname); err != nil {
111+
return "", err
112+
}
113+
return unix.ByteSliceToString(utsname.Release[:]), nil
114+
}
115+
116+
func getFirmwareSearchPaths(logger *logrus.Logger) ([]string, error) {
117+
118+
var firmwarePaths []string
119+
if p := getCustomFirmwareClassPath(logger); p != "" {
120+
logger.Debugf("using custom firmware class path: %s", p)
121+
firmwarePaths = append(firmwarePaths, p)
122+
}
123+
124+
utsRelease, err := getUTSRelease()
125+
if err != nil {
126+
return nil, fmt.Errorf("failed to get UTS_RELEASE: %v", err)
127+
}
128+
129+
standardPaths := []string{
130+
filepath.Join("/lib/firmware/updates/", utsRelease),
131+
filepath.Join("/lib/firmware/updates/"),
132+
filepath.Join("/lib/firmware/", utsRelease),
133+
filepath.Join("/lib/firmware/"),
134+
}
135+
136+
return append(firmwarePaths, standardPaths...), nil
137+
}
138+
139+
// getCustomFirmwareClassPath returns the custom firmware class path if it exists.
140+
func getCustomFirmwareClassPath(logger *logrus.Logger) string {
141+
customFirmwareClassPath, err := os.ReadFile("/sys/module/firmware_class/parameters/path")
142+
if err != nil {
143+
logger.Warningf("failed to get custom firmware class path: %v", err)
144+
return ""
145+
}
146+
147+
return strings.TrimSpace(string(customFirmwareClassPath))
148+
}
149+
103150
// NewDriverFirmwareDiscoverer creates a discoverer for GSP firmware associated with the specified driver version.
104-
func NewDriverFirmwareDiscoverer(logger *logrus.Logger, driverRoot string, version string) discover.Discover {
105-
gspFirmwarePath := filepath.Join("/lib/firmware/nvidia", version, "gsp*.bin")
151+
func NewDriverFirmwareDiscoverer(logger *logrus.Logger, driverRoot string, version string) (discover.Discover, error) {
152+
gspFirmwareSearchPaths, err := getFirmwareSearchPaths(logger)
153+
if err != nil {
154+
return nil, fmt.Errorf("failed to get firmware search paths: %v", err)
155+
}
156+
gspFirmwarePaths := filepath.Join("nvidia", version, "gsp*.bin")
106157
return discover.NewMounts(
107158
logger,
108159
lookup.NewFileLocator(
109160
lookup.WithLogger(logger),
110161
lookup.WithRoot(driverRoot),
162+
lookup.WithSearchPaths(gspFirmwareSearchPaths...),
111163
),
112164
driverRoot,
113-
[]string{gspFirmwarePath},
114-
)
165+
[]string{gspFirmwarePaths},
166+
), nil
115167
}
116168

117169
// NewDriverBinariesDiscoverer creates a discoverer for GSP firmware associated with the GPU driver.

third_party/libnvidia-container

Submodule libnvidia-container updated from 31e068e to 66607bd

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.13.4
16+
LIB_VERSION := 1.13.5
1717
LIB_TAG :=
1818

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

0 commit comments

Comments
 (0)