Skip to content

Commit f5b4c15

Browse files
authored
Merge pull request #1319 from elezar/bump-github.com/NVIDIA/go-nvlib-0.8.1
Disable generation of nvidia.com/gpu.[non]coherent CDI specs by default
2 parents c51b2ea + ea82489 commit f5b4c15

File tree

9 files changed

+12
-16
lines changed

9 files changed

+12
-16
lines changed

CHANGELOG.md

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

3+
## v1.18.0-rc.5
4+
- Update go-nvlib to restrict nvidia.com/gpu.coherent devices to devices with an ATS addressing mode.
5+
36
## v1.18.0-rc.4
47

58
- Add drop-in file support for containerd and crio

cmd/nvidia-ctk/cdi/generate/generate_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"tags.cncf.io/container-device-interface/specs-go"
3030

3131
"github.com/NVIDIA/nvidia-container-toolkit/internal/test"
32-
"github.com/NVIDIA/nvidia-container-toolkit/pkg/nvcdi"
3332
)
3433

3534
func TestGenerateSpec(t *testing.T) {
@@ -478,7 +477,6 @@ containerEdits:
478477
}
479478
tc.options.nvmllib = server
480479

481-
tc.options.featureFlags = []string{string(nvcdi.FeatureDisableCoherentAnnotations)}
482480
specs, err := c.generateSpecs(&tc.options)
483481
require.ErrorIs(t, err, tc.expectedError)
484482

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.0
55
toolchain go1.24.4
66

77
require (
8-
github.com/NVIDIA/go-nvlib v0.8.0
8+
github.com/NVIDIA/go-nvlib v0.8.1
99
github.com/NVIDIA/go-nvml v0.13.0-1
1010
github.com/cyphar/filepath-securejoin v0.5.0
1111
github.com/moby/sys/reexec v0.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/NVIDIA/go-nvlib v0.8.0 h1:vorMvnsJYvZaxiluSXFd+fIFeQFPWSiSjNPiJyvDs0c=
2-
github.com/NVIDIA/go-nvlib v0.8.0/go.mod h1:bV+OEgjJCbFXf5T8c082mVPFuiF+gKwf9CMT7DWGUBI=
1+
github.com/NVIDIA/go-nvlib v0.8.1 h1:OPEHVvn3zcV5OXB68A7WRpeCnYMRSPl7LdeJH/d3gZI=
2+
github.com/NVIDIA/go-nvlib v0.8.1/go.mod h1:7mzx9FSdO9fXWP9NKuZmWkCwhkEcSWQFe2tmFwtLb9c=
33
github.com/NVIDIA/go-nvml v0.13.0-1 h1:OLX8Jq3dONuPOQPC7rndB6+iDmDakw0XTYgzMxObkEw=
44
github.com/NVIDIA/go-nvml v0.13.0-1/go.mod h1:+KNA7c7gIBH7SKSJ1ntlwkfN80zdx8ovl4hrK3LmPt4=
55
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=

pkg/nvcdi/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const (
8080
// FeatureDisableNvsandboxUtils disables the use of nvsandboxutils when
8181
// querying devices.
8282
FeatureDisableNvsandboxUtils = FeatureFlag("disable-nvsandbox-utils")
83-
// FeatureDisableCoherentAnnotations disables the addition of annotations
83+
// FeatureEnableCoherentAnnotations enables the addition of annotations
8484
// coherent or non-coherent devices.
85-
FeatureDisableCoherentAnnotations = FeatureFlag("disable-coherent-annotations")
85+
FeatureEnableCoherentAnnotations = FeatureFlag("enable-coherent-annotations")
8686
)

pkg/nvcdi/full-gpu-nvml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (l *fullGPUDeviceSpecGenerator) device() (device.Device, error) {
112112
}
113113

114114
func (l *fullGPUDeviceSpecGenerator) getDeviceAnnotations() (map[string]string, error) {
115-
if l.featureFlags[FeatureDisableCoherentAnnotations] {
115+
if !l.featureFlags[FeatureEnableCoherentAnnotations] {
116116
return nil, nil
117117
}
118118

pkg/nvcdi/mig-device-nvml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (l *migDeviceSpecGenerator) GetUUID() (string, error) {
4141
}
4242

4343
func (l *nvmllib) newMIGDeviceSpecGeneratorFromDevice(i int, d device.Device, j int, m device.MigDevice) (*migDeviceSpecGenerator, error) {
44-
parent, err := l.newFullGPUDeviceSpecGeneratorFromDevice(i, d, map[FeatureFlag]bool{FeatureDisableCoherentAnnotations: true})
44+
parent, err := l.newFullGPUDeviceSpecGeneratorFromDevice(i, d, make(map[FeatureFlag]bool))
4545
if err != nil {
4646
return nil, err
4747
}

vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/device/device.go

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# github.com/NVIDIA/go-nvlib v0.8.0
1+
# github.com/NVIDIA/go-nvlib v0.8.1
22
## explicit; go 1.20
33
github.com/NVIDIA/go-nvlib/pkg/nvlib/device
44
github.com/NVIDIA/go-nvlib/pkg/nvlib/info

0 commit comments

Comments
 (0)