Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to incorporate go-nvml updates to expose interface types #32

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/NVIDIA/go-nvlib
go 1.20

require (
github.com/NVIDIA/go-nvml v0.12.0-3
github.com/NVIDIA/go-nvml v0.12.0-4
github.com/google/uuid v1.6.0
github.com/stretchr/testify v1.9.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/NVIDIA/go-nvml v0.12.0-3 h1:QwfjYxEqIQVRhl8327g2Y3ZvKResPydpGSKtCIIK9jE=
github.com/NVIDIA/go-nvml v0.12.0-3/go.mod h1:SOufGc5Wql+cxrIZ8RyJwVKDYxfbs4WPkHXqadcbfvA=
github.com/NVIDIA/go-nvml v0.12.0-4 h1:BvPjnjJr6qje0zov57Md7TwEA8i/12kZeUQIpyWzTEE=
github.com/NVIDIA/go-nvml v0.12.0-4/go.mod h1:8Llmj+1Rr+9VGGwZuRer5N/aCjxGuR5nPb/9ebBiIEQ=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down
2 changes: 1 addition & 1 deletion pkg/nvlib/device/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package device

import (
"github.com/NVIDIA/go-nvlib/pkg/nvml"
"github.com/NVIDIA/go-nvml/pkg/nvml"
)

// Interface provides the API to the 'device' package.
Expand Down
4 changes: 2 additions & 2 deletions pkg/nvlib/device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package device
import (
"fmt"

"github.com/NVIDIA/go-nvlib/pkg/nvml"
"github.com/NVIDIA/go-nvml/pkg/nvml"
)

// Device defines the set of extended functions associated with a device.Device.
Expand Down Expand Up @@ -469,5 +469,5 @@ func (d *devicelib) hasSymbol(symbol string) bool {
return true
}

return d.nvml.Lookup(symbol) == nil
return d.nvml.Extensions().LookupSymbol(symbol) == nil
}
2 changes: 1 addition & 1 deletion pkg/nvlib/device/mig_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package device
import (
"fmt"

"github.com/NVIDIA/go-nvlib/pkg/nvml"
"github.com/NVIDIA/go-nvml/pkg/nvml"
)

// MigDevice defines the set of extended functions associated with a MIG device.
Expand Down
2 changes: 1 addition & 1 deletion pkg/nvlib/device/mig_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strconv"
"strings"

"github.com/NVIDIA/go-nvlib/pkg/nvml"
"github.com/NVIDIA/go-nvml/pkg/nvml"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions pkg/nvlib/device/mig_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ import (

"github.com/stretchr/testify/require"

"github.com/NVIDIA/go-nvlib/pkg/nvml"
"github.com/NVIDIA/go-nvml/pkg/nvml"
"github.com/NVIDIA/go-nvml/pkg/nvml/mock"
)

type MigProfileInfoWrapper struct {
MigProfileInfo
}

func newMockDeviceLib() Interface {
mockDevice := &nvml.DeviceMock{
mockDevice := &mock.Device{
GetNameFunc: func() (string, nvml.Return) {
return "MockDevice", nvml.SUCCESS
},
Expand Down Expand Up @@ -69,7 +70,7 @@ func newMockDeviceLib() Interface {
return info, nvml.SUCCESS
},
}
mockNvml := &nvml.InterfaceMock{
mockNvml := &mock.Interface{
DeviceGetCountFunc: func() (int, nvml.Return) {
return 1, nvml.SUCCESS
},
Expand Down
44 changes: 0 additions & 44 deletions pkg/nvml/ci.go

This file was deleted.

163 changes: 0 additions & 163 deletions pkg/nvml/consts.go

This file was deleted.

Loading