Skip to content

Commit

Permalink
Merge pull request #32 from klueska/update-go-nvml
Browse files Browse the repository at this point in the history
Update to incorporate go-nvml updates to expose interface types
  • Loading branch information
klueska authored Apr 13, 2024
2 parents 3c1b6c2 + 153699b commit 094481f
Show file tree
Hide file tree
Showing 46 changed files with 28,246 additions and 5,694 deletions.
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

0 comments on commit 094481f

Please sign in to comment.