Skip to content

Commit 9b69e94

Browse files
authored
Merge pull request #1930 from NVIDIA/dependabot/go_modules/main/github.com/NVIDIA/go-nvml-0.13.3-1
build(deps): Bump github.com/NVIDIA/go-nvml from 0.13.3-0 to 0.13.3-1
2 parents 32a6bc5 + a7146e6 commit 9b69e94

18 files changed

Lines changed: 2894 additions & 926 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
"github.com/NVIDIA/go-nvml/pkg/nvml"
2727
"github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100"
28+
mockserver "github.com/NVIDIA/go-nvml/pkg/nvml/mock/server"
2829
testlog "github.com/sirupsen/logrus/hooks/test"
2930
"github.com/stretchr/testify/require"
3031
"tags.cncf.io/container-device-interface/specs-go"
@@ -502,7 +503,7 @@ containerEdits:
502503
}
503504
for _, d := range server.Devices {
504505
// TODO: This is not implemented in the mock.
505-
(d.(*dgxa100.Device)).GetMaxMigDeviceCountFunc = func() (int, nvml.Return) {
506+
(d.(*mockserver.Device)).GetMaxMigDeviceCountFunc = func() (int, nvml.Return) {
506507
return 0, nvml.SUCCESS
507508
}
508509
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.25.0
55
require (
66
github.com/Masterminds/semver/v3 v3.5.0
77
github.com/NVIDIA/go-nvlib v0.11.0
8-
github.com/NVIDIA/go-nvml v0.13.3-0
8+
github.com/NVIDIA/go-nvml v0.13.3-1
99
github.com/containerd/nri v0.12.0
1010
github.com/cyphar/filepath-securejoin v0.7.0
1111
github.com/google/uuid v1.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/Masterminds/semver/v3 v3.5.0 h1:kQceYJfbupGfZOKZQg0kou0DgAKhzDg2NZPAw
44
github.com/Masterminds/semver/v3 v3.5.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
55
github.com/NVIDIA/go-nvlib v0.11.0 h1:J6c9deWGJ1x4yY7fKg+aOdm2v5+WmCIeCLsuaO3tRtA=
66
github.com/NVIDIA/go-nvlib v0.11.0/go.mod h1:uQNH63NoDuSfn/1lixD1D1Hvhko/xdnBHmc4H1mFUlY=
7-
github.com/NVIDIA/go-nvml v0.13.3-0 h1:oJZ4+VTtPI/XT7XCfo5NvE9XTNrH8I3/KHy89rHxDxY=
8-
github.com/NVIDIA/go-nvml v0.13.3-0/go.mod h1:ahi2psRYoa+wYUBIrZPRO+wJs9lcvMhxSSkjjvsJJNQ=
7+
github.com/NVIDIA/go-nvml v0.13.3-1 h1:P76U2h88OZSiMtdhRsJjSF5DXyXUqHIXKeDicVAaae0=
8+
github.com/NVIDIA/go-nvml v0.13.3-1/go.mod h1:ahi2psRYoa+wYUBIrZPRO+wJs9lcvMhxSSkjjvsJJNQ=
99
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
1010
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
1111
github.com/brianvoe/gofakeit/v7 v7.12.1 h1:df1tiI4SL1dR5Ix4D/r6a3a+nXBJ/OBGU5jEKRBmmqg=

pkg/nvcdi/lib-nvml_test.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/NVIDIA/go-nvml/pkg/nvml"
2424
mocknvml "github.com/NVIDIA/go-nvml/pkg/nvml/mock"
2525
"github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100"
26+
mockserver "github.com/NVIDIA/go-nvml/pkg/nvml/mock/server"
2627
"github.com/stretchr/testify/require"
2728

2829
"github.com/NVIDIA/go-nvlib/pkg/nvlib/device"
@@ -32,7 +33,7 @@ func TestNvmllibGetDeviceSpecGeneratorsForIDs(t *testing.T) {
3233
testCases := []struct {
3334
name string
3435
ids []string
35-
setupMock func(*dgxa100.Server)
36+
setupMock func(*mockserver.Server)
3637
expectedError error
3738
expectedLength int
3839
expectedGenerators DeviceSpecGenerators
@@ -46,10 +47,10 @@ func TestNvmllibGetDeviceSpecGeneratorsForIDs(t *testing.T) {
4647
{
4748
name: "single GPU index",
4849
ids: []string{"0"},
49-
setupMock: func(server *dgxa100.Server) {
50+
setupMock: func(server *mockserver.Server) {
5051
for _, d := range server.Devices {
5152
// TODO: This is not implemented in the mock.
52-
(d.(*dgxa100.Device)).IsMigDeviceHandleFunc = func() (bool, nvml.Return) {
53+
(d.(*mockserver.Device)).IsMigDeviceHandleFunc = func() (bool, nvml.Return) {
5354
return false, nvml.SUCCESS
5455
}
5556
}
@@ -60,10 +61,10 @@ func TestNvmllibGetDeviceSpecGeneratorsForIDs(t *testing.T) {
6061
{
6162
name: "single UUID",
6263
ids: []string{"GPU-12345678-1234-1234-1234-123456789abc"},
63-
setupMock: func(server *dgxa100.Server) {
64+
setupMock: func(server *mockserver.Server) {
6465
for _, d := range server.Devices {
6566
// TODO: This is not implemented in the mock.
66-
(d.(*dgxa100.Device)).IsMigDeviceHandleFunc = func() (bool, nvml.Return) {
67+
(d.(*mockserver.Device)).IsMigDeviceHandleFunc = func() (bool, nvml.Return) {
6768
return false, nvml.SUCCESS
6869
}
6970
}
@@ -80,7 +81,7 @@ func TestNvmllibGetDeviceSpecGeneratorsForIDs(t *testing.T) {
8081
{
8182
name: "MIG device index",
8283
ids: []string{"0:0"},
83-
setupMock: func(server *dgxa100.Server) {
84+
setupMock: func(server *mockserver.Server) {
8485
mig := &mocknvml.Device{
8586
IsMigDeviceHandleFunc: func() (bool, nvml.Return) {
8687
return true, nvml.SUCCESS
@@ -96,7 +97,7 @@ func TestNvmllibGetDeviceSpecGeneratorsForIDs(t *testing.T) {
9697
},
9798
}
9899

99-
server.Devices[0].(*dgxa100.Device).GetMigDeviceHandleByIndexFunc = func(n int) (nvml.Device, nvml.Return) {
100+
server.Devices[0].(*mockserver.Device).GetMigDeviceHandleByIndexFunc = func(n int) (nvml.Device, nvml.Return) {
100101
if n != 0 {
101102
return nil, nvml.ERROR_INVALID_ARGUMENT
102103
}
@@ -143,17 +144,17 @@ func TestNvmllibGetDeviceSpecGeneratorsForIDs(t *testing.T) {
143144
}
144145

145146
// TODO: These need to be implemented in go-nvlib
146-
func mockOverrides(server *dgxa100.Server) {
147+
func mockOverrides(server *mockserver.Server) {
147148
for i, d := range server.Devices {
148149
// TODO: This is not implemented in the mock.
149-
(d.(*dgxa100.Device)).GetMaxMigDeviceCountFunc = func() (int, nvml.Return) {
150+
(d.(*mockserver.Device)).GetMaxMigDeviceCountFunc = func() (int, nvml.Return) {
150151
return 0, nvml.SUCCESS
151152
}
152-
(d.(*dgxa100.Device)).GetIndexFunc = func() (int, nvml.Return) {
153+
(d.(*mockserver.Device)).GetIndexFunc = func() (int, nvml.Return) {
153154
return i, nvml.SUCCESS
154155
}
155-
(d.(*dgxa100.Device)).GetUUIDFunc = func() (string, nvml.Return) {
156-
return d.(*dgxa100.Device).UUID, nvml.SUCCESS
156+
(d.(*mockserver.Device)).GetUUIDFunc = func() (string, nvml.Return) {
157+
return d.(*mockserver.Device).UUID, nvml.SUCCESS
157158
}
158159
}
159160
}

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

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)