Skip to content

Commit e4b46a0

Browse files
authored
Merge pull request #516 from elezar/update-infolib-construction
Update infolib construction
2 parents b407109 + 8fc4b9c commit e4b46a0

File tree

10 files changed

+25
-25
lines changed

10 files changed

+25
-25
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/NVIDIA/nvidia-container-toolkit
33
go 1.20
44

55
require (
6-
github.com/NVIDIA/go-nvlib v0.4.0
6+
github.com/NVIDIA/go-nvlib v0.5.0
77
github.com/NVIDIA/go-nvml v0.12.0-6
88
github.com/fsnotify/fsnotify v1.7.0
99
github.com/opencontainers/runtime-spec v1.2.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/NVIDIA/go-nvlib v0.4.0 h1:dvuqjjSamBODFuxttPg4H/xtNVQRZOSlwFtuNKybcGI=
2-
github.com/NVIDIA/go-nvlib v0.4.0/go.mod h1:87z49ULPr4GWPSGfSIp3taU4XENRYN/enIg88MzcL4k=
1+
github.com/NVIDIA/go-nvlib v0.5.0 h1:951KGrfr+p3cs89alO9z/ZxPPWKxwht9tx9rxiADoLI=
2+
github.com/NVIDIA/go-nvlib v0.5.0/go.mod h1:87z49ULPr4GWPSGfSIp3taU4XENRYN/enIg88MzcL4k=
33
github.com/NVIDIA/go-nvml v0.12.0-6 h1:FJYc2KrpvX+VOC/8QQvMiQMmZ/nPMRpdJO/Ik4xfcr0=
44
github.com/NVIDIA/go-nvml v0.12.0-6/go.mod h1:8Llmj+1Rr+9VGGwZuRer5N/aCjxGuR5nPb/9ebBiIEQ=
55
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=

internal/info/additional_info_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func TestUsesNVGPUModule(t *testing.T) {
243243
t.Run(tc.description, func(t *testing.T) {
244244
sut := additionalInfo{
245245
nvmllib: tc.nvmllib,
246-
devicelib: device.New(device.WithNvml(tc.nvmllib)),
246+
devicelib: device.New(tc.nvmllib),
247247
}
248248

249249
flag, _ := sut.UsesNVGPUModule()

pkg/nvcdi/lib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func New(opts ...Option) (Interface, error) {
9999
l.nvmllib = nvml.New()
100100
}
101101
if l.devicelib == nil {
102-
l.devicelib = device.New(device.WithNvml(l.nvmllib))
102+
l.devicelib = device.New(l.nvmllib)
103103
}
104104
if l.infolib == nil {
105105
l.infolib = info.New(

pkg/nvcdi/options.go

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package nvcdi
1818

1919
import (
2020
"github.com/NVIDIA/go-nvlib/pkg/nvlib/device"
21+
"github.com/NVIDIA/go-nvlib/pkg/nvlib/info"
2122
"github.com/NVIDIA/go-nvml/pkg/nvml"
2223

2324
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
@@ -34,6 +35,13 @@ func WithDeviceLib(devicelib device.Interface) Option {
3435
}
3536
}
3637

38+
// WithInfoLib sets the info library for CDI spec generation.
39+
func WithInfoLib(infolib info.Interface) Option {
40+
return func(l *nvcdilib) {
41+
l.infolib = infolib
42+
}
43+
}
44+
3745
// WithDeviceNamers sets the device namer for the library
3846
func WithDeviceNamers(namers ...DeviceNamer) Option {
3947
return func(l *nvcdilib) {

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

+5-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/NVIDIA/go-nvlib/pkg/nvlib/info/builder.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# github.com/NVIDIA/go-nvlib v0.4.0
1+
# github.com/NVIDIA/go-nvlib v0.5.0
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)