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

Switch to go-nvml Interfaces #31

Closed
wants to merge 2 commits into from
Closed
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: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/NVIDIA/go-nvml => ../go-nvml
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
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/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.GetExtendedInterface().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"
nvmlmock "github.com/NVIDIA/go-nvml/pkg/nvml/mock"
)

type MigProfileInfoWrapper struct {
MigProfileInfo
}

func newMockDeviceLib() Interface {
mockDevice := &nvml.DeviceMock{
mockDevice := &nvmlmock.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 := &nvmlmock.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
Loading