mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Bump github.com/NVIDIA/go-nvml from 0.12.0-3 to 0.12.0-4
Bumps [github.com/NVIDIA/go-nvml](https://github.com/NVIDIA/go-nvml) from 0.12.0-3 to 0.12.0-4. - [Commits](https://github.com/NVIDIA/go-nvml/compare/v0.12.0-3...v0.12.0-4) --- updated-dependencies: - dependency-name: github.com/NVIDIA/go-nvml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
b3af77166b
commit
50dd460eaa
2
go.mod
2
go.mod
@ -4,7 +4,7 @@ go 1.20
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/NVIDIA/go-nvlib v0.2.0
|
github.com/NVIDIA/go-nvlib v0.2.0
|
||||||
github.com/NVIDIA/go-nvml v0.12.0-3
|
github.com/NVIDIA/go-nvml v0.12.0-4
|
||||||
github.com/fsnotify/fsnotify v1.7.0
|
github.com/fsnotify/fsnotify v1.7.0
|
||||||
github.com/opencontainers/runtime-spec v1.2.0
|
github.com/opencontainers/runtime-spec v1.2.0
|
||||||
github.com/pelletier/go-toml v1.9.5
|
github.com/pelletier/go-toml v1.9.5
|
||||||
|
4
go.sum
4
go.sum
@ -1,7 +1,7 @@
|
|||||||
github.com/NVIDIA/go-nvlib v0.2.0 h1:roq+SDstbP1fcy2XVH7wB2Gz2/Ud7Q+NGQYOcVITVrA=
|
github.com/NVIDIA/go-nvlib v0.2.0 h1:roq+SDstbP1fcy2XVH7wB2Gz2/Ud7Q+NGQYOcVITVrA=
|
||||||
github.com/NVIDIA/go-nvlib v0.2.0/go.mod h1:kFuLNTyD1tF6FbRFlk+/EdUW5BrkE+v1Y3A3/9zKSjA=
|
github.com/NVIDIA/go-nvlib v0.2.0/go.mod h1:kFuLNTyD1tF6FbRFlk+/EdUW5BrkE+v1Y3A3/9zKSjA=
|
||||||
github.com/NVIDIA/go-nvml v0.12.0-3 h1:QwfjYxEqIQVRhl8327g2Y3ZvKResPydpGSKtCIIK9jE=
|
github.com/NVIDIA/go-nvml v0.12.0-4 h1:BvPjnjJr6qje0zov57Md7TwEA8i/12kZeUQIpyWzTEE=
|
||||||
github.com/NVIDIA/go-nvml v0.12.0-3/go.mod h1:SOufGc5Wql+cxrIZ8RyJwVKDYxfbs4WPkHXqadcbfvA=
|
github.com/NVIDIA/go-nvml v0.12.0-4/go.mod h1:8Llmj+1Rr+9VGGwZuRer5N/aCjxGuR5nPb/9ebBiIEQ=
|
||||||
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
||||||
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
||||||
|
47
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go
generated
vendored
47
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/api.go
generated
vendored
@ -16,22 +16,41 @@
|
|||||||
|
|
||||||
package nvml
|
package nvml
|
||||||
|
|
||||||
// Library defines a set of functions defined on the underlying dynamic library.
|
// ExtendedInterface defines a set of extensions to the core NVML API.
|
||||||
type Library interface {
|
//
|
||||||
Lookup(string) error
|
// TODO: For now the list of methods in this interface need to be kept in sync
|
||||||
|
// with the list of excluded methods for the Interface type in
|
||||||
|
// gen/nvml/generateapi.go. In the future we should automate this.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/extendedinterface.go -pkg mock . ExtendedInterface:ExtendedInterface
|
||||||
|
type ExtendedInterface interface {
|
||||||
|
LookupSymbol(string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// dynamicLibrary is an interface for abstacting the underlying library.
|
// libraryOptions hold the paramaters than can be set by a LibraryOption
|
||||||
// This also allows for mocking and testing.
|
type libraryOptions struct {
|
||||||
|
path string
|
||||||
//go:generate moq -stub -out dynamicLibrary_mock.go . dynamicLibrary
|
flags int
|
||||||
type dynamicLibrary interface {
|
|
||||||
Lookup(string) error
|
|
||||||
Open() error
|
|
||||||
Close() error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface represents the interface for the NVML library.
|
// LibraryOption represents a functional option to configure the underlying NVML library
|
||||||
type Interface interface {
|
type LibraryOption func(*libraryOptions)
|
||||||
GetLibrary() Library
|
|
||||||
|
// WithLibraryPath provides an option to set the library name to be used by the NVML library.
|
||||||
|
func WithLibraryPath(path string) LibraryOption {
|
||||||
|
return func(o *libraryOptions) {
|
||||||
|
o.path = path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLibraryOptions applies the specified options to the NVML library.
|
||||||
|
// If this is called when a library is already loaded, an error is raised.
|
||||||
|
func SetLibraryOptions(opts ...LibraryOption) error {
|
||||||
|
libnvml.Lock()
|
||||||
|
defer libnvml.Unlock()
|
||||||
|
if libnvml.refcount != 0 {
|
||||||
|
return errLibraryAlreadyLoaded
|
||||||
|
}
|
||||||
|
libnvml.init(opts...)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,17 @@ func uint32SliceToIntSlice(s []uint32) []int {
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func convertSlice[T any, I any](input []T) []I {
|
||||||
|
output := make([]I, len(input))
|
||||||
|
for i, obj := range input {
|
||||||
|
switch v := any(obj).(type) {
|
||||||
|
case I:
|
||||||
|
output[i] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
// packPCharString creates a Go string backed by *C.char and avoids copying.
|
// packPCharString creates a Go string backed by *C.char and avoids copying.
|
||||||
func packPCharString(p *C.char) (raw string) {
|
func packPCharString(p *C.char) (raw string) {
|
||||||
if p != nil && *p != 0 {
|
if p != nil && *p != 0 {
|
2851
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go
generated
vendored
2851
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/device.go
generated
vendored
File diff suppressed because it is too large
Load Diff
55
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go
generated
vendored
55
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/event_set.go
generated
vendored
@ -14,29 +14,60 @@
|
|||||||
|
|
||||||
package nvml
|
package nvml
|
||||||
|
|
||||||
|
// EventData includes an interface type for Device instead of nvmlDevice
|
||||||
|
type EventData struct {
|
||||||
|
Device Device
|
||||||
|
EventType uint64
|
||||||
|
EventData uint64
|
||||||
|
GpuInstanceId uint32
|
||||||
|
ComputeInstanceId uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e EventData) convert() nvmlEventData {
|
||||||
|
out := nvmlEventData{
|
||||||
|
Device: e.Device.(nvmlDevice),
|
||||||
|
EventType: e.EventType,
|
||||||
|
EventData: e.EventData,
|
||||||
|
GpuInstanceId: e.GpuInstanceId,
|
||||||
|
ComputeInstanceId: e.ComputeInstanceId,
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e nvmlEventData) convert() EventData {
|
||||||
|
out := EventData{
|
||||||
|
Device: e.Device,
|
||||||
|
EventType: e.EventType,
|
||||||
|
EventData: e.EventData,
|
||||||
|
GpuInstanceId: e.GpuInstanceId,
|
||||||
|
ComputeInstanceId: e.ComputeInstanceId,
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// nvml.EventSetCreate()
|
// nvml.EventSetCreate()
|
||||||
func EventSetCreate() (EventSet, Return) {
|
func (l *library) EventSetCreate() (EventSet, Return) {
|
||||||
var Set EventSet
|
var Set nvmlEventSet
|
||||||
ret := nvmlEventSetCreate(&Set)
|
ret := nvmlEventSetCreate(&Set)
|
||||||
return Set, ret
|
return Set, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.EventSetWait()
|
// nvml.EventSetWait()
|
||||||
func EventSetWait(Set EventSet, Timeoutms uint32) (EventData, Return) {
|
func (l *library) EventSetWait(set EventSet, timeoutms uint32) (EventData, Return) {
|
||||||
var Data EventData
|
return set.Wait(timeoutms)
|
||||||
ret := nvmlEventSetWait(Set, &Data, Timeoutms)
|
|
||||||
return Data, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Set EventSet) Wait(Timeoutms uint32) (EventData, Return) {
|
func (set nvmlEventSet) Wait(timeoutms uint32) (EventData, Return) {
|
||||||
return EventSetWait(Set, Timeoutms)
|
var data nvmlEventData
|
||||||
|
ret := nvmlEventSetWait(set, &data, timeoutms)
|
||||||
|
return data.convert(), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.EventSetFree()
|
// nvml.EventSetFree()
|
||||||
func EventSetFree(Set EventSet) Return {
|
func (l *library) EventSetFree(set EventSet) Return {
|
||||||
return nvmlEventSetFree(Set)
|
return set.Free()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Set EventSet) Free() Return {
|
func (set nvmlEventSet) Free() Return {
|
||||||
return EventSetFree(Set)
|
return nvmlEventSetFree(set)
|
||||||
}
|
}
|
||||||
|
128
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go
generated
vendored
128
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/gpm.go
generated
vendored
@ -14,80 +14,128 @@
|
|||||||
|
|
||||||
package nvml
|
package nvml
|
||||||
|
|
||||||
|
// GpmMetricsGetType includes interface types for GpmSample instead of nvmlGpmSample
|
||||||
|
type GpmMetricsGetType struct {
|
||||||
|
Version uint32
|
||||||
|
NumMetrics uint32
|
||||||
|
Sample1 GpmSample
|
||||||
|
Sample2 GpmSample
|
||||||
|
Metrics [98]GpmMetric
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GpmMetricsGetType) convert() *nvmlGpmMetricsGetType {
|
||||||
|
out := &nvmlGpmMetricsGetType{
|
||||||
|
Version: g.Version,
|
||||||
|
NumMetrics: g.NumMetrics,
|
||||||
|
Sample1: g.Sample1.(nvmlGpmSample),
|
||||||
|
Sample2: g.Sample2.(nvmlGpmSample),
|
||||||
|
}
|
||||||
|
for i := range g.Metrics {
|
||||||
|
out.Metrics[i] = g.Metrics[i]
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *nvmlGpmMetricsGetType) convert() *GpmMetricsGetType {
|
||||||
|
out := &GpmMetricsGetType{
|
||||||
|
Version: g.Version,
|
||||||
|
NumMetrics: g.NumMetrics,
|
||||||
|
Sample1: g.Sample1,
|
||||||
|
Sample2: g.Sample2,
|
||||||
|
}
|
||||||
|
for i := range g.Metrics {
|
||||||
|
out.Metrics[i] = g.Metrics[i]
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// nvml.GpmMetricsGet()
|
// nvml.GpmMetricsGet()
|
||||||
type GpmMetricsGetVType struct {
|
type GpmMetricsGetVType struct {
|
||||||
metricsGet *GpmMetricsGetType
|
metricsGet *nvmlGpmMetricsGetType
|
||||||
}
|
}
|
||||||
|
|
||||||
func GpmMetricsGetV(MetricsGet *GpmMetricsGetType) GpmMetricsGetVType {
|
func (l *library) GpmMetricsGetV(metricsGet *GpmMetricsGetType) GpmMetricsGetVType {
|
||||||
return GpmMetricsGetVType{MetricsGet}
|
return GpmMetricsGetVType{metricsGet.convert()}
|
||||||
|
}
|
||||||
|
func (metricsGetV GpmMetricsGetVType) V1() Return {
|
||||||
|
metricsGetV.metricsGet.Version = 1
|
||||||
|
return nvmlGpmMetricsGet(metricsGetV.metricsGet)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (MetricsGetV GpmMetricsGetVType) V1() Return {
|
func (l *library) GpmMetricsGet(metricsGet *GpmMetricsGetType) Return {
|
||||||
MetricsGetV.metricsGet.Version = 1
|
metricsGet.Version = GPM_METRICS_GET_VERSION
|
||||||
return nvmlGpmMetricsGet(MetricsGetV.metricsGet)
|
return nvmlGpmMetricsGet(metricsGet.convert())
|
||||||
}
|
|
||||||
|
|
||||||
func GpmMetricsGet(MetricsGet *GpmMetricsGetType) Return {
|
|
||||||
MetricsGet.Version = GPM_METRICS_GET_VERSION
|
|
||||||
return nvmlGpmMetricsGet(MetricsGet)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GpmSampleFree()
|
// nvml.GpmSampleFree()
|
||||||
func GpmSampleFree(GpmSample GpmSample) Return {
|
func (l *library) GpmSampleFree(gpmSample GpmSample) Return {
|
||||||
return nvmlGpmSampleFree(GpmSample)
|
return gpmSample.Free()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gpmSample nvmlGpmSample) Free() Return {
|
||||||
|
return nvmlGpmSampleFree(gpmSample)
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GpmSampleAlloc()
|
// nvml.GpmSampleAlloc()
|
||||||
func GpmSampleAlloc(GpmSample *GpmSample) Return {
|
func (l *library) GpmSampleAlloc() (GpmSample, Return) {
|
||||||
return nvmlGpmSampleAlloc(GpmSample)
|
var gpmSample nvmlGpmSample
|
||||||
|
ret := nvmlGpmSampleAlloc(&gpmSample)
|
||||||
|
return gpmSample, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GpmSampleGet()
|
// nvml.GpmSampleGet()
|
||||||
func GpmSampleGet(Device Device, GpmSample GpmSample) Return {
|
func (l *library) GpmSampleGet(device Device, gpmSample GpmSample) Return {
|
||||||
return nvmlGpmSampleGet(Device, GpmSample)
|
return gpmSample.Get(device)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Device Device) GpmSampleGet(GpmSample GpmSample) Return {
|
func (device nvmlDevice) GpmSampleGet(gpmSample GpmSample) Return {
|
||||||
return GpmSampleGet(Device, GpmSample)
|
return gpmSample.Get(device)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gpmSample nvmlGpmSample) Get(device Device) Return {
|
||||||
|
return nvmlGpmSampleGet(device.(nvmlDevice), gpmSample)
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GpmQueryDeviceSupport()
|
// nvml.GpmQueryDeviceSupport()
|
||||||
type GpmSupportV struct {
|
type GpmSupportV struct {
|
||||||
device Device
|
device nvmlDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
func GpmQueryDeviceSupportV(Device Device) GpmSupportV {
|
func (l *library) GpmQueryDeviceSupportV(device Device) GpmSupportV {
|
||||||
return GpmSupportV{Device}
|
return device.GpmQueryDeviceSupportV()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Device Device) GpmQueryDeviceSupportV() GpmSupportV {
|
func (device nvmlDevice) GpmQueryDeviceSupportV() GpmSupportV {
|
||||||
return GpmSupportV{Device}
|
return GpmSupportV{device}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (GpmSupportV GpmSupportV) V1() (GpmSupport, Return) {
|
func (gpmSupportV GpmSupportV) V1() (GpmSupport, Return) {
|
||||||
var GpmSupport GpmSupport
|
var gpmSupport GpmSupport
|
||||||
GpmSupport.Version = 1
|
gpmSupport.Version = 1
|
||||||
ret := nvmlGpmQueryDeviceSupport(GpmSupportV.device, &GpmSupport)
|
ret := nvmlGpmQueryDeviceSupport(gpmSupportV.device, &gpmSupport)
|
||||||
return GpmSupport, ret
|
return gpmSupport, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func GpmQueryDeviceSupport(Device Device) (GpmSupport, Return) {
|
func (l *library) GpmQueryDeviceSupport(device Device) (GpmSupport, Return) {
|
||||||
var GpmSupport GpmSupport
|
return device.GpmQueryDeviceSupport()
|
||||||
GpmSupport.Version = GPM_SUPPORT_VERSION
|
|
||||||
ret := nvmlGpmQueryDeviceSupport(Device, &GpmSupport)
|
|
||||||
return GpmSupport, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Device Device) GpmQueryDeviceSupport() (GpmSupport, Return) {
|
func (device nvmlDevice) GpmQueryDeviceSupport() (GpmSupport, Return) {
|
||||||
return GpmQueryDeviceSupport(Device)
|
var gpmSupport GpmSupport
|
||||||
|
gpmSupport.Version = GPM_SUPPORT_VERSION
|
||||||
|
ret := nvmlGpmQueryDeviceSupport(device, &gpmSupport)
|
||||||
|
return gpmSupport, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GpmMigSampleGet()
|
// nvml.GpmMigSampleGet()
|
||||||
func GpmMigSampleGet(Device Device, GpuInstanceId int, GpmSample GpmSample) Return {
|
func (l *library) GpmMigSampleGet(device Device, gpuInstanceId int, gpmSample GpmSample) Return {
|
||||||
return nvmlGpmMigSampleGet(Device, uint32(GpuInstanceId), GpmSample)
|
return gpmSample.MigGet(device, gpuInstanceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Device Device) GpmMigSampleGet(GpuInstanceId int, GpmSample GpmSample) Return {
|
func (device nvmlDevice) GpmMigSampleGet(gpuInstanceId int, gpmSample GpmSample) Return {
|
||||||
return GpmMigSampleGet(Device, GpuInstanceId, GpmSample)
|
return gpmSample.MigGet(device, gpuInstanceId)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gpmSample nvmlGpmSample) MigGet(device Device, gpuInstanceId int) Return {
|
||||||
|
return nvmlGpmMigSampleGet(device.(nvmlDevice), uint32(gpuInstanceId), gpmSample)
|
||||||
}
|
}
|
||||||
|
10
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go
generated
vendored
10
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/init.go
generated
vendored
@ -17,7 +17,7 @@ package nvml
|
|||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
// nvml.Init()
|
// nvml.Init()
|
||||||
func Init() Return {
|
func (l *library) Init() Return {
|
||||||
if err := libnvml.load(); err != nil {
|
if err := libnvml.load(); err != nil {
|
||||||
return ERROR_LIBRARY_NOT_FOUND
|
return ERROR_LIBRARY_NOT_FOUND
|
||||||
}
|
}
|
||||||
@ -25,15 +25,15 @@ func Init() Return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nvml.InitWithFlags()
|
// nvml.InitWithFlags()
|
||||||
func InitWithFlags(Flags uint32) Return {
|
func (l *library) InitWithFlags(flags uint32) Return {
|
||||||
if err := libnvml.load(); err != nil {
|
if err := libnvml.load(); err != nil {
|
||||||
return ERROR_LIBRARY_NOT_FOUND
|
return ERROR_LIBRARY_NOT_FOUND
|
||||||
}
|
}
|
||||||
return nvmlInitWithFlags(Flags)
|
return nvmlInitWithFlags(flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.Shutdown()
|
// nvml.Shutdown()
|
||||||
func Shutdown() Return {
|
func (l *library) Shutdown() Return {
|
||||||
ret := nvmlShutdown()
|
ret := nvmlShutdown()
|
||||||
if ret != SUCCESS {
|
if ret != SUCCESS {
|
||||||
return ret
|
return ret
|
||||||
@ -41,7 +41,7 @@ func Shutdown() Return {
|
|||||||
|
|
||||||
err := libnvml.close()
|
err := libnvml.close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return ERROR_UNKNOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
168
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go
generated
vendored
168
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/lib.go
generated
vendored
@ -34,48 +34,70 @@ const (
|
|||||||
var errLibraryNotLoaded = errors.New("library not loaded")
|
var errLibraryNotLoaded = errors.New("library not loaded")
|
||||||
var errLibraryAlreadyLoaded = errors.New("library already loaded")
|
var errLibraryAlreadyLoaded = errors.New("library already loaded")
|
||||||
|
|
||||||
|
// dynamicLibrary is an interface for abstacting the underlying library.
|
||||||
|
// This also allows for mocking and testing.
|
||||||
|
|
||||||
|
//go:generate moq -stub -out dynamicLibrary_mock.go . dynamicLibrary
|
||||||
|
type dynamicLibrary interface {
|
||||||
|
Lookup(string) error
|
||||||
|
Open() error
|
||||||
|
Close() error
|
||||||
|
}
|
||||||
|
|
||||||
// library represents an nvml library.
|
// library represents an nvml library.
|
||||||
// This includes a reference to the underlying DynamicLibrary
|
// This includes a reference to the underlying DynamicLibrary
|
||||||
type library struct {
|
type library struct {
|
||||||
sync.Mutex
|
sync.Mutex
|
||||||
path string
|
path string
|
||||||
flags int
|
|
||||||
refcount refcount
|
refcount refcount
|
||||||
dl dynamicLibrary
|
dl dynamicLibrary
|
||||||
}
|
}
|
||||||
|
|
||||||
// libnvml is a global instance of the nvml library.
|
|
||||||
var libnvml = library{
|
|
||||||
path: defaultNvmlLibraryName,
|
|
||||||
flags: defaultNvmlLibraryLoadFlags,
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ Interface = (*library)(nil)
|
var _ Interface = (*library)(nil)
|
||||||
|
|
||||||
// GetLibrary returns a the library as a Library interface.
|
// libnvml is a global instance of the nvml library.
|
||||||
func (l *library) GetLibrary() Library {
|
var libnvml = newLibrary()
|
||||||
|
|
||||||
|
func New(opts ...LibraryOption) Interface {
|
||||||
|
return newLibrary(opts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func newLibrary(opts ...LibraryOption) *library {
|
||||||
|
l := &library{}
|
||||||
|
l.init(opts...)
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLibrary returns a representation of the underlying library that implements the Library interface.
|
func (l *library) init(opts ...LibraryOption) {
|
||||||
func GetLibrary() Library {
|
o := libraryOptions{}
|
||||||
return libnvml.GetLibrary()
|
for _, opt := range opts {
|
||||||
|
opt(&o)
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.path == "" {
|
||||||
|
o.path = defaultNvmlLibraryName
|
||||||
|
}
|
||||||
|
if o.flags == 0 {
|
||||||
|
o.flags = defaultNvmlLibraryLoadFlags
|
||||||
|
}
|
||||||
|
|
||||||
|
l.path = o.path
|
||||||
|
l.dl = dl.New(o.path, o.flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lookup checks whether the specified library symbol exists in the library.
|
func (l *library) Extensions() ExtendedInterface {
|
||||||
|
return l
|
||||||
|
}
|
||||||
|
|
||||||
|
// LookupSymbol checks whether the specified library symbol exists in the library.
|
||||||
// Note that this requires that the library be loaded.
|
// Note that this requires that the library be loaded.
|
||||||
func (l *library) Lookup(name string) error {
|
func (l *library) LookupSymbol(name string) error {
|
||||||
if l == nil || l.dl == nil {
|
if l == nil || l.refcount == 0 {
|
||||||
return fmt.Errorf("error looking up %s: %w", name, errLibraryNotLoaded)
|
return fmt.Errorf("error looking up %s: %w", name, errLibraryNotLoaded)
|
||||||
}
|
}
|
||||||
return l.dl.Lookup(name)
|
return l.dl.Lookup(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// newDynamicLibrary is a function variable that can be overridden for testing.
|
|
||||||
var newDynamicLibrary = func(path string, flags int) dynamicLibrary {
|
|
||||||
return dl.New(path, flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
// load initializes the library and updates the versioned symbols.
|
// load initializes the library and updates the versioned symbols.
|
||||||
// Multiple calls to an already loaded library will return without error.
|
// Multiple calls to an already loaded library will return without error.
|
||||||
func (l *library) load() (rerr error) {
|
func (l *library) load() (rerr error) {
|
||||||
@ -87,12 +109,14 @@ func (l *library) load() (rerr error) {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
dl := newDynamicLibrary(l.path, l.flags)
|
if err := l.dl.Open(); err != nil {
|
||||||
if err := dl.Open(); err != nil {
|
|
||||||
return fmt.Errorf("error opening %s: %w", l.path, err)
|
return fmt.Errorf("error opening %s: %w", l.path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
l.dl = dl
|
// Update the errorStringFunc to point to nvml.ErrorString
|
||||||
|
errorStringFunc = nvmlErrorString
|
||||||
|
|
||||||
|
// Update all versioned symbols
|
||||||
l.updateVersionedSymbols()
|
l.updateVersionedSymbols()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -114,7 +138,8 @@ func (l *library) close() (rerr error) {
|
|||||||
return fmt.Errorf("error closing %s: %w", l.path, err)
|
return fmt.Errorf("error closing %s: %w", l.path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
l.dl = nil
|
// Update the errorStringFunc to point to defaultErrorStringFunc
|
||||||
|
errorStringFunc = defaultErrorStringFunc
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -131,9 +156,9 @@ var nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v1
|
|||||||
var nvmlEventSetWait = nvmlEventSetWait_v1
|
var nvmlEventSetWait = nvmlEventSetWait_v1
|
||||||
var nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v1
|
var nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v1
|
||||||
var nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v1
|
var nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v1
|
||||||
var DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v1
|
var deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v1
|
||||||
var DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v1
|
var deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v1
|
||||||
var DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v1
|
var deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v1
|
||||||
var GetBlacklistDeviceCount = GetExcludedDeviceCount
|
var GetBlacklistDeviceCount = GetExcludedDeviceCount
|
||||||
var GetBlacklistDeviceInfoByIndex = GetExcludedDeviceInfoByIndex
|
var GetBlacklistDeviceInfoByIndex = GetExcludedDeviceInfoByIndex
|
||||||
var nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v1
|
var nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v1
|
||||||
@ -173,127 +198,94 @@ func (pis ProcessInfo_v2Slice) ToProcessInfoSlice() []ProcessInfo {
|
|||||||
// When new versioned symbols are added, these would have to be initialized above and have
|
// When new versioned symbols are added, these would have to be initialized above and have
|
||||||
// corresponding checks and subsequent assignments added below.
|
// corresponding checks and subsequent assignments added below.
|
||||||
func (l *library) updateVersionedSymbols() {
|
func (l *library) updateVersionedSymbols() {
|
||||||
err := l.Lookup("nvmlInit_v2")
|
err := l.LookupSymbol("nvmlInit_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlInit = nvmlInit_v2
|
nvmlInit = nvmlInit_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetPciInfo_v2")
|
err = l.LookupSymbol("nvmlDeviceGetPciInfo_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v2
|
nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetPciInfo_v3")
|
err = l.LookupSymbol("nvmlDeviceGetPciInfo_v3")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v3
|
nvmlDeviceGetPciInfo = nvmlDeviceGetPciInfo_v3
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetCount_v2")
|
err = l.LookupSymbol("nvmlDeviceGetCount_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetCount = nvmlDeviceGetCount_v2
|
nvmlDeviceGetCount = nvmlDeviceGetCount_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetHandleByIndex_v2")
|
err = l.LookupSymbol("nvmlDeviceGetHandleByIndex_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetHandleByIndex = nvmlDeviceGetHandleByIndex_v2
|
nvmlDeviceGetHandleByIndex = nvmlDeviceGetHandleByIndex_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetHandleByPciBusId_v2")
|
err = l.LookupSymbol("nvmlDeviceGetHandleByPciBusId_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetHandleByPciBusId = nvmlDeviceGetHandleByPciBusId_v2
|
nvmlDeviceGetHandleByPciBusId = nvmlDeviceGetHandleByPciBusId_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetNvLinkRemotePciInfo_v2")
|
err = l.LookupSymbol("nvmlDeviceGetNvLinkRemotePciInfo_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetNvLinkRemotePciInfo = nvmlDeviceGetNvLinkRemotePciInfo_v2
|
nvmlDeviceGetNvLinkRemotePciInfo = nvmlDeviceGetNvLinkRemotePciInfo_v2
|
||||||
}
|
}
|
||||||
// Unable to overwrite nvmlDeviceRemoveGpu() because the v2 function takes
|
// Unable to overwrite nvmlDeviceRemoveGpu() because the v2 function takes
|
||||||
// a different set of parameters than the v1 function.
|
// a different set of parameters than the v1 function.
|
||||||
//err = l.Lookup("nvmlDeviceRemoveGpu_v2")
|
//err = l.LookupSymbol("nvmlDeviceRemoveGpu_v2")
|
||||||
//if err == nil {
|
//if err == nil {
|
||||||
// nvmlDeviceRemoveGpu = nvmlDeviceRemoveGpu_v2
|
// nvmlDeviceRemoveGpu = nvmlDeviceRemoveGpu_v2
|
||||||
//}
|
//}
|
||||||
err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v2")
|
err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v2
|
nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v3")
|
err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v3")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v3
|
nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v3
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetGridLicensableFeatures_v4")
|
err = l.LookupSymbol("nvmlDeviceGetGridLicensableFeatures_v4")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v4
|
nvmlDeviceGetGridLicensableFeatures = nvmlDeviceGetGridLicensableFeatures_v4
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlEventSetWait_v2")
|
err = l.LookupSymbol("nvmlEventSetWait_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlEventSetWait = nvmlEventSetWait_v2
|
nvmlEventSetWait = nvmlEventSetWait_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetAttributes_v2")
|
err = l.LookupSymbol("nvmlDeviceGetAttributes_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v2
|
nvmlDeviceGetAttributes = nvmlDeviceGetAttributes_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlComputeInstanceGetInfo_v2")
|
err = l.LookupSymbol("nvmlComputeInstanceGetInfo_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v2
|
nvmlComputeInstanceGetInfo = nvmlComputeInstanceGetInfo_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v2")
|
err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2
|
deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetComputeRunningProcesses_v3")
|
err = l.LookupSymbol("nvmlDeviceGetComputeRunningProcesses_v3")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
DeviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3
|
deviceGetComputeRunningProcesses = deviceGetComputeRunningProcesses_v3
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v2")
|
err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2
|
deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetGraphicsRunningProcesses_v3")
|
err = l.LookupSymbol("nvmlDeviceGetGraphicsRunningProcesses_v3")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
DeviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3
|
deviceGetGraphicsRunningProcesses = deviceGetGraphicsRunningProcesses_v3
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v2")
|
err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2
|
deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetMPSComputeRunningProcesses_v3")
|
err = l.LookupSymbol("nvmlDeviceGetMPSComputeRunningProcesses_v3")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
DeviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3
|
deviceGetMPSComputeRunningProcesses = deviceGetMPSComputeRunningProcesses_v3
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlDeviceGetGpuInstancePossiblePlacements_v2")
|
err = l.LookupSymbol("nvmlDeviceGetGpuInstancePossiblePlacements_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v2
|
nvmlDeviceGetGpuInstancePossiblePlacements = nvmlDeviceGetGpuInstancePossiblePlacements_v2
|
||||||
}
|
}
|
||||||
err = l.Lookup("nvmlVgpuInstanceGetLicenseInfo_v2")
|
err = l.LookupSymbol("nvmlVgpuInstanceGetLicenseInfo_v2")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v2
|
nvmlVgpuInstanceGetLicenseInfo = nvmlVgpuInstanceGetLicenseInfo_v2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LibraryOption represents a functional option to configure the underlying NVML library
|
|
||||||
type LibraryOption func(*library)
|
|
||||||
|
|
||||||
// WithLibraryPath provides an option to set the library name to be used by the NVML library.
|
|
||||||
func WithLibraryPath(path string) LibraryOption {
|
|
||||||
return func(l *library) {
|
|
||||||
l.path = path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetLibraryOptions applies the specified options to the NVML library.
|
|
||||||
// If this is called when a library is already loaded, and error is raised.
|
|
||||||
func SetLibraryOptions(opts ...LibraryOption) error {
|
|
||||||
libnvml.Lock()
|
|
||||||
defer libnvml.Unlock()
|
|
||||||
if libnvml.dl != nil {
|
|
||||||
return errLibraryAlreadyLoaded
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, opt := range opts {
|
|
||||||
opt(&libnvml)
|
|
||||||
}
|
|
||||||
|
|
||||||
if libnvml.path == "" {
|
|
||||||
libnvml.path = defaultNvmlLibraryName
|
|
||||||
}
|
|
||||||
if libnvml.flags == 0 {
|
|
||||||
libnvml.flags = defaultNvmlLibraryLoadFlags
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
1688
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go
generated
vendored
1688
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go
generated
vendored
File diff suppressed because it is too large
Load Diff
24
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go
generated
vendored
24
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/return.go
generated
vendored
@ -19,17 +19,27 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// nvml.ErrorString()
|
// nvml.ErrorString()
|
||||||
func ErrorString(r Return) string {
|
func (l *library) ErrorString(r Return) string {
|
||||||
if err := GetLibrary().Lookup("nvmlErrorString"); err != nil {
|
return r.Error()
|
||||||
return fallbackErrorStringFunc(r)
|
|
||||||
}
|
|
||||||
return nvmlErrorString(r)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallbackErrorStringFunc provides a basic nvmlErrorString implementation.
|
// String returns the string representation of a Return.
|
||||||
|
func (r Return) String() string {
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error returns the string representation of a Return.
|
||||||
|
func (r Return) Error() string {
|
||||||
|
return errorStringFunc(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assigned to nvml.ErrorString if the system nvml library is in use.
|
||||||
|
var errorStringFunc = defaultErrorStringFunc
|
||||||
|
|
||||||
|
// defaultErrorStringFunc provides a basic nvmlErrorString implementation.
|
||||||
// This allows the nvml.ErrorString function to be used even if the NVML library
|
// This allows the nvml.ErrorString function to be used even if the NVML library
|
||||||
// is not loaded.
|
// is not loaded.
|
||||||
var fallbackErrorStringFunc = func(r Return) string {
|
var defaultErrorStringFunc = func(r Return) string {
|
||||||
switch r {
|
switch r {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
return "SUCCESS"
|
return "SUCCESS"
|
||||||
|
42
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go
generated
vendored
42
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/system.go
generated
vendored
@ -15,67 +15,67 @@
|
|||||||
package nvml
|
package nvml
|
||||||
|
|
||||||
// nvml.SystemGetDriverVersion()
|
// nvml.SystemGetDriverVersion()
|
||||||
func SystemGetDriverVersion() (string, Return) {
|
func (l *library) SystemGetDriverVersion() (string, Return) {
|
||||||
Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
||||||
ret := nvmlSystemGetDriverVersion(&Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
ret := nvmlSystemGetDriverVersion(&Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
||||||
return string(Version[:clen(Version)]), ret
|
return string(Version[:clen(Version)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SystemGetNVMLVersion()
|
// nvml.SystemGetNVMLVersion()
|
||||||
func SystemGetNVMLVersion() (string, Return) {
|
func (l *library) SystemGetNVMLVersion() (string, Return) {
|
||||||
Version := make([]byte, SYSTEM_NVML_VERSION_BUFFER_SIZE)
|
Version := make([]byte, SYSTEM_NVML_VERSION_BUFFER_SIZE)
|
||||||
ret := nvmlSystemGetNVMLVersion(&Version[0], SYSTEM_NVML_VERSION_BUFFER_SIZE)
|
ret := nvmlSystemGetNVMLVersion(&Version[0], SYSTEM_NVML_VERSION_BUFFER_SIZE)
|
||||||
return string(Version[:clen(Version)]), ret
|
return string(Version[:clen(Version)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SystemGetCudaDriverVersion()
|
// nvml.SystemGetCudaDriverVersion()
|
||||||
func SystemGetCudaDriverVersion() (int, Return) {
|
func (l *library) SystemGetCudaDriverVersion() (int, Return) {
|
||||||
var CudaDriverVersion int32
|
var CudaDriverVersion int32
|
||||||
ret := nvmlSystemGetCudaDriverVersion(&CudaDriverVersion)
|
ret := nvmlSystemGetCudaDriverVersion(&CudaDriverVersion)
|
||||||
return int(CudaDriverVersion), ret
|
return int(CudaDriverVersion), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SystemGetCudaDriverVersion_v2()
|
// nvml.SystemGetCudaDriverVersion_v2()
|
||||||
func SystemGetCudaDriverVersion_v2() (int, Return) {
|
func (l *library) SystemGetCudaDriverVersion_v2() (int, Return) {
|
||||||
var CudaDriverVersion int32
|
var CudaDriverVersion int32
|
||||||
ret := nvmlSystemGetCudaDriverVersion_v2(&CudaDriverVersion)
|
ret := nvmlSystemGetCudaDriverVersion_v2(&CudaDriverVersion)
|
||||||
return int(CudaDriverVersion), ret
|
return int(CudaDriverVersion), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SystemGetProcessName()
|
// nvml.SystemGetProcessName()
|
||||||
func SystemGetProcessName(Pid int) (string, Return) {
|
func (l *library) SystemGetProcessName(pid int) (string, Return) {
|
||||||
Name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE)
|
name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE)
|
||||||
ret := nvmlSystemGetProcessName(uint32(Pid), &Name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE)
|
ret := nvmlSystemGetProcessName(uint32(pid), &name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE)
|
||||||
return string(Name[:clen(Name)]), ret
|
return string(name[:clen(name)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SystemGetHicVersion()
|
// nvml.SystemGetHicVersion()
|
||||||
func SystemGetHicVersion() ([]HwbcEntry, Return) {
|
func (l *library) SystemGetHicVersion() ([]HwbcEntry, Return) {
|
||||||
var HwbcCount uint32 = 1 // Will be reduced upon returning
|
var hwbcCount uint32 = 1 // Will be reduced upon returning
|
||||||
for {
|
for {
|
||||||
HwbcEntries := make([]HwbcEntry, HwbcCount)
|
hwbcEntries := make([]HwbcEntry, hwbcCount)
|
||||||
ret := nvmlSystemGetHicVersion(&HwbcCount, &HwbcEntries[0])
|
ret := nvmlSystemGetHicVersion(&hwbcCount, &hwbcEntries[0])
|
||||||
if ret == SUCCESS {
|
if ret == SUCCESS {
|
||||||
return HwbcEntries[:HwbcCount], ret
|
return hwbcEntries[:hwbcCount], ret
|
||||||
}
|
}
|
||||||
if ret != ERROR_INSUFFICIENT_SIZE {
|
if ret != ERROR_INSUFFICIENT_SIZE {
|
||||||
return nil, ret
|
return nil, ret
|
||||||
}
|
}
|
||||||
HwbcCount *= 2
|
hwbcCount *= 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SystemGetTopologyGpuSet()
|
// nvml.SystemGetTopologyGpuSet()
|
||||||
func SystemGetTopologyGpuSet(CpuNumber int) ([]Device, Return) {
|
func (l *library) SystemGetTopologyGpuSet(cpuNumber int) ([]Device, Return) {
|
||||||
var Count uint32
|
var count uint32
|
||||||
ret := nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, nil)
|
ret := nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, nil)
|
||||||
if ret != SUCCESS {
|
if ret != SUCCESS {
|
||||||
return nil, ret
|
return nil, ret
|
||||||
}
|
}
|
||||||
if Count == 0 {
|
if count == 0 {
|
||||||
return []Device{}, ret
|
return []Device{}, ret
|
||||||
}
|
}
|
||||||
DeviceArray := make([]Device, Count)
|
deviceArray := make([]nvmlDevice, count)
|
||||||
ret = nvmlSystemGetTopologyGpuSet(uint32(CpuNumber), &Count, &DeviceArray[0])
|
ret = nvmlSystemGetTopologyGpuSet(uint32(cpuNumber), &count, &deviceArray[0])
|
||||||
return DeviceArray, ret
|
return convertSlice[nvmlDevice, Device](deviceArray), ret
|
||||||
}
|
}
|
||||||
|
36
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go
generated
vendored
36
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/types_gen.go
generated
vendored
@ -5,7 +5,7 @@ package nvml
|
|||||||
|
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
type Device struct {
|
type nvmlDevice struct {
|
||||||
Handle *_Ctype_struct_nvmlDevice_st
|
Handle *_Ctype_struct_nvmlDevice_st
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,9 +143,9 @@ type ClkMonStatus struct {
|
|||||||
ClkMonList [32]ClkMonFaultInfo
|
ClkMonList [32]ClkMonFaultInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
type VgpuTypeId uint32
|
type nvmlVgpuTypeId uint32
|
||||||
|
|
||||||
type VgpuInstance uint32
|
type nvmlVgpuInstance uint32
|
||||||
|
|
||||||
type VgpuInstanceUtilizationSample struct {
|
type VgpuInstanceUtilizationSample struct {
|
||||||
VgpuInstance uint32
|
VgpuInstance uint32
|
||||||
@ -316,7 +316,7 @@ type FieldValue struct {
|
|||||||
Value [8]byte
|
Value [8]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
type Unit struct {
|
type nvmlUnit struct {
|
||||||
Handle *_Ctype_struct_nvmlUnit_st
|
Handle *_Ctype_struct_nvmlUnit_st
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,12 +354,12 @@ type UnitFanSpeeds struct {
|
|||||||
Count uint32
|
Count uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
type EventSet struct {
|
type nvmlEventSet struct {
|
||||||
Handle *_Ctype_struct_nvmlEventSet_st
|
Handle *_Ctype_struct_nvmlEventSet_st
|
||||||
}
|
}
|
||||||
|
|
||||||
type EventData struct {
|
type nvmlEventData struct {
|
||||||
Device Device
|
Device nvmlDevice
|
||||||
EventType uint64
|
EventType uint64
|
||||||
EventData uint64
|
EventData uint64
|
||||||
GpuInstanceId uint32
|
GpuInstanceId uint32
|
||||||
@ -494,14 +494,14 @@ type GpuInstanceProfileInfo_v2 struct {
|
|||||||
Name [96]int8
|
Name [96]int8
|
||||||
}
|
}
|
||||||
|
|
||||||
type GpuInstanceInfo struct {
|
type nvmlGpuInstanceInfo struct {
|
||||||
Device Device
|
Device nvmlDevice
|
||||||
Id uint32
|
Id uint32
|
||||||
ProfileId uint32
|
ProfileId uint32
|
||||||
Placement GpuInstancePlacement
|
Placement GpuInstancePlacement
|
||||||
}
|
}
|
||||||
|
|
||||||
type GpuInstance struct {
|
type nvmlGpuInstance struct {
|
||||||
Handle *_Ctype_struct_nvmlGpuInstance_st
|
Handle *_Ctype_struct_nvmlGpuInstance_st
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -536,19 +536,19 @@ type ComputeInstanceProfileInfo_v2 struct {
|
|||||||
Name [96]int8
|
Name [96]int8
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComputeInstanceInfo struct {
|
type nvmlComputeInstanceInfo struct {
|
||||||
Device Device
|
Device nvmlDevice
|
||||||
GpuInstance GpuInstance
|
GpuInstance nvmlGpuInstance
|
||||||
Id uint32
|
Id uint32
|
||||||
ProfileId uint32
|
ProfileId uint32
|
||||||
Placement ComputeInstancePlacement
|
Placement ComputeInstancePlacement
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComputeInstance struct {
|
type nvmlComputeInstance struct {
|
||||||
Handle *_Ctype_struct_nvmlComputeInstance_st
|
Handle *_Ctype_struct_nvmlComputeInstance_st
|
||||||
}
|
}
|
||||||
|
|
||||||
type GpmSample struct {
|
type nvmlGpmSample struct {
|
||||||
Handle *_Ctype_struct_nvmlGpmSample_st
|
Handle *_Ctype_struct_nvmlGpmSample_st
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,11 +565,11 @@ type GpmMetric struct {
|
|||||||
MetricInfo GpmMetricMetricInfo
|
MetricInfo GpmMetricMetricInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
type GpmMetricsGetType struct {
|
type nvmlGpmMetricsGetType struct {
|
||||||
Version uint32
|
Version uint32
|
||||||
NumMetrics uint32
|
NumMetrics uint32
|
||||||
Sample1 GpmSample
|
Sample1 nvmlGpmSample
|
||||||
Sample2 GpmSample
|
Sample2 nvmlGpmSample
|
||||||
Metrics [98]GpmMetric
|
Metrics [98]GpmMetric
|
||||||
}
|
}
|
||||||
|
|
||||||
|
98
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go
generated
vendored
98
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/unit.go
generated
vendored
@ -15,99 +15,99 @@
|
|||||||
package nvml
|
package nvml
|
||||||
|
|
||||||
// nvml.UnitGetCount()
|
// nvml.UnitGetCount()
|
||||||
func UnitGetCount() (int, Return) {
|
func (l *library) UnitGetCount() (int, Return) {
|
||||||
var UnitCount uint32
|
var UnitCount uint32
|
||||||
ret := nvmlUnitGetCount(&UnitCount)
|
ret := nvmlUnitGetCount(&UnitCount)
|
||||||
return int(UnitCount), ret
|
return int(UnitCount), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetHandleByIndex()
|
// nvml.UnitGetHandleByIndex()
|
||||||
func UnitGetHandleByIndex(Index int) (Unit, Return) {
|
func (l *library) UnitGetHandleByIndex(index int) (Unit, Return) {
|
||||||
var Unit Unit
|
var unit nvmlUnit
|
||||||
ret := nvmlUnitGetHandleByIndex(uint32(Index), &Unit)
|
ret := nvmlUnitGetHandleByIndex(uint32(index), &unit)
|
||||||
return Unit, ret
|
return unit, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetUnitInfo()
|
// nvml.UnitGetUnitInfo()
|
||||||
func UnitGetUnitInfo(Unit Unit) (UnitInfo, Return) {
|
func (l *library) UnitGetUnitInfo(unit Unit) (UnitInfo, Return) {
|
||||||
var Info UnitInfo
|
return unit.GetUnitInfo()
|
||||||
ret := nvmlUnitGetUnitInfo(Unit, &Info)
|
|
||||||
return Info, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) GetUnitInfo() (UnitInfo, Return) {
|
func (unit nvmlUnit) GetUnitInfo() (UnitInfo, Return) {
|
||||||
return UnitGetUnitInfo(Unit)
|
var info UnitInfo
|
||||||
|
ret := nvmlUnitGetUnitInfo(unit, &info)
|
||||||
|
return info, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetLedState()
|
// nvml.UnitGetLedState()
|
||||||
func UnitGetLedState(Unit Unit) (LedState, Return) {
|
func (l *library) UnitGetLedState(unit Unit) (LedState, Return) {
|
||||||
var State LedState
|
return unit.GetLedState()
|
||||||
ret := nvmlUnitGetLedState(Unit, &State)
|
|
||||||
return State, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) GetLedState() (LedState, Return) {
|
func (unit nvmlUnit) GetLedState() (LedState, Return) {
|
||||||
return UnitGetLedState(Unit)
|
var state LedState
|
||||||
|
ret := nvmlUnitGetLedState(unit, &state)
|
||||||
|
return state, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetPsuInfo()
|
// nvml.UnitGetPsuInfo()
|
||||||
func UnitGetPsuInfo(Unit Unit) (PSUInfo, Return) {
|
func (l *library) UnitGetPsuInfo(unit Unit) (PSUInfo, Return) {
|
||||||
var Psu PSUInfo
|
return unit.GetPsuInfo()
|
||||||
ret := nvmlUnitGetPsuInfo(Unit, &Psu)
|
|
||||||
return Psu, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) GetPsuInfo() (PSUInfo, Return) {
|
func (unit nvmlUnit) GetPsuInfo() (PSUInfo, Return) {
|
||||||
return UnitGetPsuInfo(Unit)
|
var psu PSUInfo
|
||||||
|
ret := nvmlUnitGetPsuInfo(unit, &psu)
|
||||||
|
return psu, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetTemperature()
|
// nvml.UnitGetTemperature()
|
||||||
func UnitGetTemperature(Unit Unit, Type int) (uint32, Return) {
|
func (l *library) UnitGetTemperature(unit Unit, ttype int) (uint32, Return) {
|
||||||
var Temp uint32
|
return unit.GetTemperature(ttype)
|
||||||
ret := nvmlUnitGetTemperature(Unit, uint32(Type), &Temp)
|
|
||||||
return Temp, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) GetTemperature(Type int) (uint32, Return) {
|
func (unit nvmlUnit) GetTemperature(ttype int) (uint32, Return) {
|
||||||
return UnitGetTemperature(Unit, Type)
|
var temp uint32
|
||||||
|
ret := nvmlUnitGetTemperature(unit, uint32(ttype), &temp)
|
||||||
|
return temp, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetFanSpeedInfo()
|
// nvml.UnitGetFanSpeedInfo()
|
||||||
func UnitGetFanSpeedInfo(Unit Unit) (UnitFanSpeeds, Return) {
|
func (l *library) UnitGetFanSpeedInfo(unit Unit) (UnitFanSpeeds, Return) {
|
||||||
var FanSpeeds UnitFanSpeeds
|
return unit.GetFanSpeedInfo()
|
||||||
ret := nvmlUnitGetFanSpeedInfo(Unit, &FanSpeeds)
|
|
||||||
return FanSpeeds, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) GetFanSpeedInfo() (UnitFanSpeeds, Return) {
|
func (unit nvmlUnit) GetFanSpeedInfo() (UnitFanSpeeds, Return) {
|
||||||
return UnitGetFanSpeedInfo(Unit)
|
var fanSpeeds UnitFanSpeeds
|
||||||
|
ret := nvmlUnitGetFanSpeedInfo(unit, &fanSpeeds)
|
||||||
|
return fanSpeeds, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.UnitGetDevices()
|
// nvml.UnitGetDevices()
|
||||||
func UnitGetDevices(Unit Unit) ([]Device, Return) {
|
func (l *library) UnitGetDevices(unit Unit) ([]Device, Return) {
|
||||||
var DeviceCount uint32 = 1 // Will be reduced upon returning
|
return unit.GetDevices()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (unit nvmlUnit) GetDevices() ([]Device, Return) {
|
||||||
|
var deviceCount uint32 = 1 // Will be reduced upon returning
|
||||||
for {
|
for {
|
||||||
Devices := make([]Device, DeviceCount)
|
devices := make([]nvmlDevice, deviceCount)
|
||||||
ret := nvmlUnitGetDevices(Unit, &DeviceCount, &Devices[0])
|
ret := nvmlUnitGetDevices(unit, &deviceCount, &devices[0])
|
||||||
if ret == SUCCESS {
|
if ret == SUCCESS {
|
||||||
return Devices[:DeviceCount], ret
|
return convertSlice[nvmlDevice, Device](devices[:deviceCount]), ret
|
||||||
}
|
}
|
||||||
if ret != ERROR_INSUFFICIENT_SIZE {
|
if ret != ERROR_INSUFFICIENT_SIZE {
|
||||||
return nil, ret
|
return nil, ret
|
||||||
}
|
}
|
||||||
DeviceCount *= 2
|
deviceCount *= 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) GetDevices() ([]Device, Return) {
|
|
||||||
return UnitGetDevices(Unit)
|
|
||||||
}
|
|
||||||
|
|
||||||
// nvml.UnitSetLedState()
|
// nvml.UnitSetLedState()
|
||||||
func UnitSetLedState(Unit Unit, Color LedColor) Return {
|
func (l *library) UnitSetLedState(unit Unit, color LedColor) Return {
|
||||||
return nvmlUnitSetLedState(Unit, Color)
|
return unit.SetLedState(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Unit Unit) SetLedState(Color LedColor) Return {
|
func (unit nvmlUnit) SetLedState(color LedColor) Return {
|
||||||
return UnitSetLedState(Unit, Color)
|
return nvmlUnitSetLedState(unit, color)
|
||||||
}
|
}
|
||||||
|
490
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go
generated
vendored
490
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/vgpu.go
generated
vendored
@ -31,450 +31,450 @@ type VgpuPgpuMetadata struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetClass()
|
// nvml.VgpuTypeGetClass()
|
||||||
func VgpuTypeGetClass(VgpuTypeId VgpuTypeId) (string, Return) {
|
func (l *library) VgpuTypeGetClass(vgpuTypeId VgpuTypeId) (string, Return) {
|
||||||
var Size uint32 = DEVICE_NAME_BUFFER_SIZE
|
return vgpuTypeId.GetClass()
|
||||||
VgpuTypeClass := make([]byte, DEVICE_NAME_BUFFER_SIZE)
|
|
||||||
ret := nvmlVgpuTypeGetClass(VgpuTypeId, &VgpuTypeClass[0], &Size)
|
|
||||||
return string(VgpuTypeClass[:clen(VgpuTypeClass)]), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetClass() (string, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetClass() (string, Return) {
|
||||||
return VgpuTypeGetClass(VgpuTypeId)
|
var size uint32 = DEVICE_NAME_BUFFER_SIZE
|
||||||
|
vgpuTypeClass := make([]byte, DEVICE_NAME_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuTypeGetClass(vgpuTypeId, &vgpuTypeClass[0], &size)
|
||||||
|
return string(vgpuTypeClass[:clen(vgpuTypeClass)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetName()
|
// nvml.VgpuTypeGetName()
|
||||||
func VgpuTypeGetName(VgpuTypeId VgpuTypeId) (string, Return) {
|
func (l *library) VgpuTypeGetName(vgpuTypeId VgpuTypeId) (string, Return) {
|
||||||
var Size uint32 = DEVICE_NAME_BUFFER_SIZE
|
return vgpuTypeId.GetName()
|
||||||
VgpuTypeName := make([]byte, DEVICE_NAME_BUFFER_SIZE)
|
|
||||||
ret := nvmlVgpuTypeGetName(VgpuTypeId, &VgpuTypeName[0], &Size)
|
|
||||||
return string(VgpuTypeName[:clen(VgpuTypeName)]), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetName() (string, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetName() (string, Return) {
|
||||||
return VgpuTypeGetName(VgpuTypeId)
|
var size uint32 = DEVICE_NAME_BUFFER_SIZE
|
||||||
|
vgpuTypeName := make([]byte, DEVICE_NAME_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuTypeGetName(vgpuTypeId, &vgpuTypeName[0], &size)
|
||||||
|
return string(vgpuTypeName[:clen(vgpuTypeName)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetGpuInstanceProfileId()
|
// nvml.VgpuTypeGetGpuInstanceProfileId()
|
||||||
func VgpuTypeGetGpuInstanceProfileId(VgpuTypeId VgpuTypeId) (uint32, Return) {
|
func (l *library) VgpuTypeGetGpuInstanceProfileId(vgpuTypeId VgpuTypeId) (uint32, Return) {
|
||||||
var Size uint32
|
return vgpuTypeId.GetGpuInstanceProfileId()
|
||||||
ret := nvmlVgpuTypeGetGpuInstanceProfileId(VgpuTypeId, &Size)
|
|
||||||
return Size, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetGpuInstanceProfileId() (uint32, Return) {
|
||||||
return VgpuTypeGetGpuInstanceProfileId(VgpuTypeId)
|
var size uint32
|
||||||
|
ret := nvmlVgpuTypeGetGpuInstanceProfileId(vgpuTypeId, &size)
|
||||||
|
return size, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetDeviceID()
|
// nvml.VgpuTypeGetDeviceID()
|
||||||
func VgpuTypeGetDeviceID(VgpuTypeId VgpuTypeId) (uint64, uint64, Return) {
|
func (l *library) VgpuTypeGetDeviceID(vgpuTypeId VgpuTypeId) (uint64, uint64, Return) {
|
||||||
var DeviceID, SubsystemID uint64
|
return vgpuTypeId.GetDeviceID()
|
||||||
ret := nvmlVgpuTypeGetDeviceID(VgpuTypeId, &DeviceID, &SubsystemID)
|
|
||||||
return DeviceID, SubsystemID, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetDeviceID() (uint64, uint64, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetDeviceID() (uint64, uint64, Return) {
|
||||||
return VgpuTypeGetDeviceID(VgpuTypeId)
|
var deviceID, subsystemID uint64
|
||||||
|
ret := nvmlVgpuTypeGetDeviceID(vgpuTypeId, &deviceID, &subsystemID)
|
||||||
|
return deviceID, subsystemID, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetFramebufferSize()
|
// nvml.VgpuTypeGetFramebufferSize()
|
||||||
func VgpuTypeGetFramebufferSize(VgpuTypeId VgpuTypeId) (uint64, Return) {
|
func (l *library) VgpuTypeGetFramebufferSize(vgpuTypeId VgpuTypeId) (uint64, Return) {
|
||||||
var FbSize uint64
|
return vgpuTypeId.GetFramebufferSize()
|
||||||
ret := nvmlVgpuTypeGetFramebufferSize(VgpuTypeId, &FbSize)
|
|
||||||
return FbSize, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetFramebufferSize() (uint64, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetFramebufferSize() (uint64, Return) {
|
||||||
return VgpuTypeGetFramebufferSize(VgpuTypeId)
|
var fbSize uint64
|
||||||
|
ret := nvmlVgpuTypeGetFramebufferSize(vgpuTypeId, &fbSize)
|
||||||
|
return fbSize, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetNumDisplayHeads()
|
// nvml.VgpuTypeGetNumDisplayHeads()
|
||||||
func VgpuTypeGetNumDisplayHeads(VgpuTypeId VgpuTypeId) (int, Return) {
|
func (l *library) VgpuTypeGetNumDisplayHeads(vgpuTypeId VgpuTypeId) (int, Return) {
|
||||||
var NumDisplayHeads uint32
|
return vgpuTypeId.GetNumDisplayHeads()
|
||||||
ret := nvmlVgpuTypeGetNumDisplayHeads(VgpuTypeId, &NumDisplayHeads)
|
|
||||||
return int(NumDisplayHeads), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetNumDisplayHeads() (int, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetNumDisplayHeads() (int, Return) {
|
||||||
return VgpuTypeGetNumDisplayHeads(VgpuTypeId)
|
var numDisplayHeads uint32
|
||||||
|
ret := nvmlVgpuTypeGetNumDisplayHeads(vgpuTypeId, &numDisplayHeads)
|
||||||
|
return int(numDisplayHeads), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetResolution()
|
// nvml.VgpuTypeGetResolution()
|
||||||
func VgpuTypeGetResolution(VgpuTypeId VgpuTypeId, DisplayIndex int) (uint32, uint32, Return) {
|
func (l *library) VgpuTypeGetResolution(vgpuTypeId VgpuTypeId, displayIndex int) (uint32, uint32, Return) {
|
||||||
var Xdim, Ydim uint32
|
return vgpuTypeId.GetResolution(displayIndex)
|
||||||
ret := nvmlVgpuTypeGetResolution(VgpuTypeId, uint32(DisplayIndex), &Xdim, &Ydim)
|
|
||||||
return Xdim, Ydim, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetResolution(DisplayIndex int) (uint32, uint32, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetResolution(displayIndex int) (uint32, uint32, Return) {
|
||||||
return VgpuTypeGetResolution(VgpuTypeId, DisplayIndex)
|
var xdim, ydim uint32
|
||||||
|
ret := nvmlVgpuTypeGetResolution(vgpuTypeId, uint32(displayIndex), &xdim, &ydim)
|
||||||
|
return xdim, ydim, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetLicense()
|
// nvml.VgpuTypeGetLicense()
|
||||||
func VgpuTypeGetLicense(VgpuTypeId VgpuTypeId) (string, Return) {
|
func (l *library) VgpuTypeGetLicense(vgpuTypeId VgpuTypeId) (string, Return) {
|
||||||
VgpuTypeLicenseString := make([]byte, GRID_LICENSE_BUFFER_SIZE)
|
return vgpuTypeId.GetLicense()
|
||||||
ret := nvmlVgpuTypeGetLicense(VgpuTypeId, &VgpuTypeLicenseString[0], GRID_LICENSE_BUFFER_SIZE)
|
|
||||||
return string(VgpuTypeLicenseString[:clen(VgpuTypeLicenseString)]), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetLicense() (string, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetLicense() (string, Return) {
|
||||||
return VgpuTypeGetLicense(VgpuTypeId)
|
vgpuTypeLicenseString := make([]byte, GRID_LICENSE_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuTypeGetLicense(vgpuTypeId, &vgpuTypeLicenseString[0], GRID_LICENSE_BUFFER_SIZE)
|
||||||
|
return string(vgpuTypeLicenseString[:clen(vgpuTypeLicenseString)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetFrameRateLimit()
|
// nvml.VgpuTypeGetFrameRateLimit()
|
||||||
func VgpuTypeGetFrameRateLimit(VgpuTypeId VgpuTypeId) (uint32, Return) {
|
func (l *library) VgpuTypeGetFrameRateLimit(vgpuTypeId VgpuTypeId) (uint32, Return) {
|
||||||
var FrameRateLimit uint32
|
return vgpuTypeId.GetFrameRateLimit()
|
||||||
ret := nvmlVgpuTypeGetFrameRateLimit(VgpuTypeId, &FrameRateLimit)
|
|
||||||
return FrameRateLimit, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetFrameRateLimit() (uint32, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetFrameRateLimit() (uint32, Return) {
|
||||||
return VgpuTypeGetFrameRateLimit(VgpuTypeId)
|
var frameRateLimit uint32
|
||||||
|
ret := nvmlVgpuTypeGetFrameRateLimit(vgpuTypeId, &frameRateLimit)
|
||||||
|
return frameRateLimit, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetMaxInstances()
|
// nvml.VgpuTypeGetMaxInstances()
|
||||||
func VgpuTypeGetMaxInstances(Device Device, VgpuTypeId VgpuTypeId) (int, Return) {
|
func (l *library) VgpuTypeGetMaxInstances(device Device, vgpuTypeId VgpuTypeId) (int, Return) {
|
||||||
var VgpuInstanceCount uint32
|
return vgpuTypeId.GetMaxInstances(device)
|
||||||
ret := nvmlVgpuTypeGetMaxInstances(Device, VgpuTypeId, &VgpuInstanceCount)
|
|
||||||
return int(VgpuInstanceCount), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Device Device) VgpuTypeGetMaxInstances(VgpuTypeId VgpuTypeId) (int, Return) {
|
func (device nvmlDevice) VgpuTypeGetMaxInstances(vgpuTypeId VgpuTypeId) (int, Return) {
|
||||||
return VgpuTypeGetMaxInstances(Device, VgpuTypeId)
|
return vgpuTypeId.GetMaxInstances(device)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetMaxInstances(Device Device) (int, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstances(device Device) (int, Return) {
|
||||||
return VgpuTypeGetMaxInstances(Device, VgpuTypeId)
|
var vgpuInstanceCount uint32
|
||||||
|
ret := nvmlVgpuTypeGetMaxInstances(device.(nvmlDevice), vgpuTypeId, &vgpuInstanceCount)
|
||||||
|
return int(vgpuInstanceCount), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetMaxInstancesPerVm()
|
// nvml.VgpuTypeGetMaxInstancesPerVm()
|
||||||
func VgpuTypeGetMaxInstancesPerVm(VgpuTypeId VgpuTypeId) (int, Return) {
|
func (l *library) VgpuTypeGetMaxInstancesPerVm(vgpuTypeId VgpuTypeId) (int, Return) {
|
||||||
var VgpuInstanceCountPerVm uint32
|
return vgpuTypeId.GetMaxInstancesPerVm()
|
||||||
ret := nvmlVgpuTypeGetMaxInstancesPerVm(VgpuTypeId, &VgpuInstanceCountPerVm)
|
|
||||||
return int(VgpuInstanceCountPerVm), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetMaxInstancesPerVm() (int, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetMaxInstancesPerVm() (int, Return) {
|
||||||
return VgpuTypeGetMaxInstancesPerVm(VgpuTypeId)
|
var vgpuInstanceCountPerVm uint32
|
||||||
|
ret := nvmlVgpuTypeGetMaxInstancesPerVm(vgpuTypeId, &vgpuInstanceCountPerVm)
|
||||||
|
return int(vgpuInstanceCountPerVm), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetVmID()
|
// nvml.VgpuInstanceGetVmID()
|
||||||
func VgpuInstanceGetVmID(VgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) {
|
func (l *library) VgpuInstanceGetVmID(vgpuInstance VgpuInstance) (string, VgpuVmIdType, Return) {
|
||||||
var VmIdType VgpuVmIdType
|
return vgpuInstance.GetVmID()
|
||||||
VmId := make([]byte, DEVICE_UUID_BUFFER_SIZE)
|
|
||||||
ret := nvmlVgpuInstanceGetVmID(VgpuInstance, &VmId[0], DEVICE_UUID_BUFFER_SIZE, &VmIdType)
|
|
||||||
return string(VmId[:clen(VmId)]), VmIdType, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetVmID() (string, VgpuVmIdType, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetVmID() (string, VgpuVmIdType, Return) {
|
||||||
return VgpuInstanceGetVmID(VgpuInstance)
|
var vmIdType VgpuVmIdType
|
||||||
|
vmId := make([]byte, DEVICE_UUID_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuInstanceGetVmID(vgpuInstance, &vmId[0], DEVICE_UUID_BUFFER_SIZE, &vmIdType)
|
||||||
|
return string(vmId[:clen(vmId)]), vmIdType, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetUUID()
|
// nvml.VgpuInstanceGetUUID()
|
||||||
func VgpuInstanceGetUUID(VgpuInstance VgpuInstance) (string, Return) {
|
func (l *library) VgpuInstanceGetUUID(vgpuInstance VgpuInstance) (string, Return) {
|
||||||
Uuid := make([]byte, DEVICE_UUID_BUFFER_SIZE)
|
return vgpuInstance.GetUUID()
|
||||||
ret := nvmlVgpuInstanceGetUUID(VgpuInstance, &Uuid[0], DEVICE_UUID_BUFFER_SIZE)
|
|
||||||
return string(Uuid[:clen(Uuid)]), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetUUID() (string, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetUUID() (string, Return) {
|
||||||
return VgpuInstanceGetUUID(VgpuInstance)
|
uuid := make([]byte, DEVICE_UUID_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuInstanceGetUUID(vgpuInstance, &uuid[0], DEVICE_UUID_BUFFER_SIZE)
|
||||||
|
return string(uuid[:clen(uuid)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetVmDriverVersion()
|
// nvml.VgpuInstanceGetVmDriverVersion()
|
||||||
func VgpuInstanceGetVmDriverVersion(VgpuInstance VgpuInstance) (string, Return) {
|
func (l *library) VgpuInstanceGetVmDriverVersion(vgpuInstance VgpuInstance) (string, Return) {
|
||||||
Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
return vgpuInstance.GetVmDriverVersion()
|
||||||
ret := nvmlVgpuInstanceGetVmDriverVersion(VgpuInstance, &Version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
|
||||||
return string(Version[:clen(Version)]), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetVmDriverVersion() (string, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetVmDriverVersion() (string, Return) {
|
||||||
return VgpuInstanceGetVmDriverVersion(VgpuInstance)
|
version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuInstanceGetVmDriverVersion(vgpuInstance, &version[0], SYSTEM_DRIVER_VERSION_BUFFER_SIZE)
|
||||||
|
return string(version[:clen(version)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetFbUsage()
|
// nvml.VgpuInstanceGetFbUsage()
|
||||||
func VgpuInstanceGetFbUsage(VgpuInstance VgpuInstance) (uint64, Return) {
|
func (l *library) VgpuInstanceGetFbUsage(vgpuInstance VgpuInstance) (uint64, Return) {
|
||||||
var FbUsage uint64
|
return vgpuInstance.GetFbUsage()
|
||||||
ret := nvmlVgpuInstanceGetFbUsage(VgpuInstance, &FbUsage)
|
|
||||||
return FbUsage, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetFbUsage() (uint64, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetFbUsage() (uint64, Return) {
|
||||||
return VgpuInstanceGetFbUsage(VgpuInstance)
|
var fbUsage uint64
|
||||||
|
ret := nvmlVgpuInstanceGetFbUsage(vgpuInstance, &fbUsage)
|
||||||
|
return fbUsage, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetLicenseInfo()
|
// nvml.VgpuInstanceGetLicenseInfo()
|
||||||
func VgpuInstanceGetLicenseInfo(VgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) {
|
func (l *library) VgpuInstanceGetLicenseInfo(vgpuInstance VgpuInstance) (VgpuLicenseInfo, Return) {
|
||||||
var LicenseInfo VgpuLicenseInfo
|
return vgpuInstance.GetLicenseInfo()
|
||||||
ret := nvmlVgpuInstanceGetLicenseInfo(VgpuInstance, &LicenseInfo)
|
|
||||||
return LicenseInfo, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetLicenseInfo() (VgpuLicenseInfo, Return) {
|
||||||
return VgpuInstanceGetLicenseInfo(VgpuInstance)
|
var licenseInfo VgpuLicenseInfo
|
||||||
|
ret := nvmlVgpuInstanceGetLicenseInfo(vgpuInstance, &licenseInfo)
|
||||||
|
return licenseInfo, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetLicenseStatus()
|
// nvml.VgpuInstanceGetLicenseStatus()
|
||||||
func VgpuInstanceGetLicenseStatus(VgpuInstance VgpuInstance) (int, Return) {
|
func (l *library) VgpuInstanceGetLicenseStatus(vgpuInstance VgpuInstance) (int, Return) {
|
||||||
var Licensed uint32
|
return vgpuInstance.GetLicenseStatus()
|
||||||
ret := nvmlVgpuInstanceGetLicenseStatus(VgpuInstance, &Licensed)
|
|
||||||
return int(Licensed), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetLicenseStatus() (int, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetLicenseStatus() (int, Return) {
|
||||||
return VgpuInstanceGetLicenseStatus(VgpuInstance)
|
var licensed uint32
|
||||||
|
ret := nvmlVgpuInstanceGetLicenseStatus(vgpuInstance, &licensed)
|
||||||
|
return int(licensed), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetType()
|
// nvml.VgpuInstanceGetType()
|
||||||
func VgpuInstanceGetType(VgpuInstance VgpuInstance) (VgpuTypeId, Return) {
|
func (l *library) VgpuInstanceGetType(vgpuInstance VgpuInstance) (VgpuTypeId, Return) {
|
||||||
var VgpuTypeId VgpuTypeId
|
return vgpuInstance.GetType()
|
||||||
ret := nvmlVgpuInstanceGetType(VgpuInstance, &VgpuTypeId)
|
|
||||||
return VgpuTypeId, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetType() (VgpuTypeId, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetType() (VgpuTypeId, Return) {
|
||||||
return VgpuInstanceGetType(VgpuInstance)
|
var vgpuTypeId nvmlVgpuTypeId
|
||||||
|
ret := nvmlVgpuInstanceGetType(vgpuInstance, &vgpuTypeId)
|
||||||
|
return vgpuTypeId, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetFrameRateLimit()
|
// nvml.VgpuInstanceGetFrameRateLimit()
|
||||||
func VgpuInstanceGetFrameRateLimit(VgpuInstance VgpuInstance) (uint32, Return) {
|
func (l *library) VgpuInstanceGetFrameRateLimit(vgpuInstance VgpuInstance) (uint32, Return) {
|
||||||
var FrameRateLimit uint32
|
return vgpuInstance.GetFrameRateLimit()
|
||||||
ret := nvmlVgpuInstanceGetFrameRateLimit(VgpuInstance, &FrameRateLimit)
|
|
||||||
return FrameRateLimit, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetFrameRateLimit() (uint32, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetFrameRateLimit() (uint32, Return) {
|
||||||
return VgpuInstanceGetFrameRateLimit(VgpuInstance)
|
var frameRateLimit uint32
|
||||||
|
ret := nvmlVgpuInstanceGetFrameRateLimit(vgpuInstance, &frameRateLimit)
|
||||||
|
return frameRateLimit, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetEccMode()
|
// nvml.VgpuInstanceGetEccMode()
|
||||||
func VgpuInstanceGetEccMode(VgpuInstance VgpuInstance) (EnableState, Return) {
|
func (l *library) VgpuInstanceGetEccMode(vgpuInstance VgpuInstance) (EnableState, Return) {
|
||||||
var EccMode EnableState
|
return vgpuInstance.GetEccMode()
|
||||||
ret := nvmlVgpuInstanceGetEccMode(VgpuInstance, &EccMode)
|
|
||||||
return EccMode, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetEccMode() (EnableState, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetEccMode() (EnableState, Return) {
|
||||||
return VgpuInstanceGetEccMode(VgpuInstance)
|
var eccMode EnableState
|
||||||
|
ret := nvmlVgpuInstanceGetEccMode(vgpuInstance, &eccMode)
|
||||||
|
return eccMode, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetEncoderCapacity()
|
// nvml.VgpuInstanceGetEncoderCapacity()
|
||||||
func VgpuInstanceGetEncoderCapacity(VgpuInstance VgpuInstance) (int, Return) {
|
func (l *library) VgpuInstanceGetEncoderCapacity(vgpuInstance VgpuInstance) (int, Return) {
|
||||||
var EncoderCapacity uint32
|
return vgpuInstance.GetEncoderCapacity()
|
||||||
ret := nvmlVgpuInstanceGetEncoderCapacity(VgpuInstance, &EncoderCapacity)
|
|
||||||
return int(EncoderCapacity), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetEncoderCapacity() (int, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetEncoderCapacity() (int, Return) {
|
||||||
return VgpuInstanceGetEncoderCapacity(VgpuInstance)
|
var encoderCapacity uint32
|
||||||
|
ret := nvmlVgpuInstanceGetEncoderCapacity(vgpuInstance, &encoderCapacity)
|
||||||
|
return int(encoderCapacity), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceSetEncoderCapacity()
|
// nvml.VgpuInstanceSetEncoderCapacity()
|
||||||
func VgpuInstanceSetEncoderCapacity(VgpuInstance VgpuInstance, EncoderCapacity int) Return {
|
func (l *library) VgpuInstanceSetEncoderCapacity(vgpuInstance VgpuInstance, encoderCapacity int) Return {
|
||||||
return nvmlVgpuInstanceSetEncoderCapacity(VgpuInstance, uint32(EncoderCapacity))
|
return vgpuInstance.SetEncoderCapacity(encoderCapacity)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) SetEncoderCapacity(EncoderCapacity int) Return {
|
func (vgpuInstance nvmlVgpuInstance) SetEncoderCapacity(encoderCapacity int) Return {
|
||||||
return VgpuInstanceSetEncoderCapacity(VgpuInstance, EncoderCapacity)
|
return nvmlVgpuInstanceSetEncoderCapacity(vgpuInstance, uint32(encoderCapacity))
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetEncoderStats()
|
// nvml.VgpuInstanceGetEncoderStats()
|
||||||
func VgpuInstanceGetEncoderStats(VgpuInstance VgpuInstance) (int, uint32, uint32, Return) {
|
func (l *library) VgpuInstanceGetEncoderStats(vgpuInstance VgpuInstance) (int, uint32, uint32, Return) {
|
||||||
var SessionCount, AverageFps, AverageLatency uint32
|
return vgpuInstance.GetEncoderStats()
|
||||||
ret := nvmlVgpuInstanceGetEncoderStats(VgpuInstance, &SessionCount, &AverageFps, &AverageLatency)
|
|
||||||
return int(SessionCount), AverageFps, AverageLatency, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetEncoderStats() (int, uint32, uint32, Return) {
|
||||||
return VgpuInstanceGetEncoderStats(VgpuInstance)
|
var sessionCount, averageFps, averageLatency uint32
|
||||||
|
ret := nvmlVgpuInstanceGetEncoderStats(vgpuInstance, &sessionCount, &averageFps, &averageLatency)
|
||||||
|
return int(sessionCount), averageFps, averageLatency, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetEncoderSessions()
|
// nvml.VgpuInstanceGetEncoderSessions()
|
||||||
func VgpuInstanceGetEncoderSessions(VgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) {
|
func (l *library) VgpuInstanceGetEncoderSessions(vgpuInstance VgpuInstance) (int, EncoderSessionInfo, Return) {
|
||||||
var SessionCount uint32
|
return vgpuInstance.GetEncoderSessions()
|
||||||
var SessionInfo EncoderSessionInfo
|
|
||||||
ret := nvmlVgpuInstanceGetEncoderSessions(VgpuInstance, &SessionCount, &SessionInfo)
|
|
||||||
return int(SessionCount), SessionInfo, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetEncoderSessions() (int, EncoderSessionInfo, Return) {
|
||||||
return VgpuInstanceGetEncoderSessions(VgpuInstance)
|
var sessionCount uint32
|
||||||
|
var sessionInfo EncoderSessionInfo
|
||||||
|
ret := nvmlVgpuInstanceGetEncoderSessions(vgpuInstance, &sessionCount, &sessionInfo)
|
||||||
|
return int(sessionCount), sessionInfo, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetFBCStats()
|
// nvml.VgpuInstanceGetFBCStats()
|
||||||
func VgpuInstanceGetFBCStats(VgpuInstance VgpuInstance) (FBCStats, Return) {
|
func (l *library) VgpuInstanceGetFBCStats(vgpuInstance VgpuInstance) (FBCStats, Return) {
|
||||||
var FbcStats FBCStats
|
return vgpuInstance.GetFBCStats()
|
||||||
ret := nvmlVgpuInstanceGetFBCStats(VgpuInstance, &FbcStats)
|
|
||||||
return FbcStats, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetFBCStats() (FBCStats, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetFBCStats() (FBCStats, Return) {
|
||||||
return VgpuInstanceGetFBCStats(VgpuInstance)
|
var fbcStats FBCStats
|
||||||
|
ret := nvmlVgpuInstanceGetFBCStats(vgpuInstance, &fbcStats)
|
||||||
|
return fbcStats, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetFBCSessions()
|
// nvml.VgpuInstanceGetFBCSessions()
|
||||||
func VgpuInstanceGetFBCSessions(VgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) {
|
func (l *library) VgpuInstanceGetFBCSessions(vgpuInstance VgpuInstance) (int, FBCSessionInfo, Return) {
|
||||||
var SessionCount uint32
|
return vgpuInstance.GetFBCSessions()
|
||||||
var SessionInfo FBCSessionInfo
|
|
||||||
ret := nvmlVgpuInstanceGetFBCSessions(VgpuInstance, &SessionCount, &SessionInfo)
|
|
||||||
return int(SessionCount), SessionInfo, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetFBCSessions() (int, FBCSessionInfo, Return) {
|
||||||
return VgpuInstanceGetFBCSessions(VgpuInstance)
|
var sessionCount uint32
|
||||||
|
var sessionInfo FBCSessionInfo
|
||||||
|
ret := nvmlVgpuInstanceGetFBCSessions(vgpuInstance, &sessionCount, &sessionInfo)
|
||||||
|
return int(sessionCount), sessionInfo, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetGpuInstanceId()
|
// nvml.VgpuInstanceGetGpuInstanceId()
|
||||||
func VgpuInstanceGetGpuInstanceId(VgpuInstance VgpuInstance) (int, Return) {
|
func (l *library) VgpuInstanceGetGpuInstanceId(vgpuInstance VgpuInstance) (int, Return) {
|
||||||
|
return vgpuInstance.GetGpuInstanceId()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (vgpuInstance nvmlVgpuInstance) GetGpuInstanceId() (int, Return) {
|
||||||
var gpuInstanceId uint32
|
var gpuInstanceId uint32
|
||||||
ret := nvmlVgpuInstanceGetGpuInstanceId(VgpuInstance, &gpuInstanceId)
|
ret := nvmlVgpuInstanceGetGpuInstanceId(vgpuInstance, &gpuInstanceId)
|
||||||
return int(gpuInstanceId), ret
|
return int(gpuInstanceId), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetGpuInstanceId() (int, Return) {
|
// nvml.VgpuInstanceGetGpuPciId()
|
||||||
return VgpuInstanceGetGpuInstanceId(VgpuInstance)
|
func (l *library) VgpuInstanceGetGpuPciId(vgpuInstance VgpuInstance) (string, Return) {
|
||||||
|
return vgpuInstance.GetGpuPciId()
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetGpuPciId()
|
func (vgpuInstance nvmlVgpuInstance) GetGpuPciId() (string, Return) {
|
||||||
func VgpuInstanceGetGpuPciId(VgpuInstance VgpuInstance) (string, Return) {
|
var length uint32 = 1 // Will be reduced upon returning
|
||||||
var Length uint32 = 1 // Will be reduced upon returning
|
|
||||||
for {
|
for {
|
||||||
VgpuPciId := make([]byte, Length)
|
vgpuPciId := make([]byte, length)
|
||||||
ret := nvmlVgpuInstanceGetGpuPciId(VgpuInstance, &VgpuPciId[0], &Length)
|
ret := nvmlVgpuInstanceGetGpuPciId(vgpuInstance, &vgpuPciId[0], &length)
|
||||||
if ret == SUCCESS {
|
if ret == SUCCESS {
|
||||||
return string(VgpuPciId[:clen(VgpuPciId)]), ret
|
return string(vgpuPciId[:clen(vgpuPciId)]), ret
|
||||||
}
|
}
|
||||||
if ret != ERROR_INSUFFICIENT_SIZE {
|
if ret != ERROR_INSUFFICIENT_SIZE {
|
||||||
return "", ret
|
return "", ret
|
||||||
}
|
}
|
||||||
Length *= 2
|
length *= 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetGpuPciId() (string, Return) {
|
|
||||||
return VgpuInstanceGetGpuPciId(VgpuInstance)
|
|
||||||
}
|
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetMetadata()
|
// nvml.VgpuInstanceGetMetadata()
|
||||||
func VgpuInstanceGetMetadata(VgpuInstance VgpuInstance) (VgpuMetadata, Return) {
|
func (l *library) VgpuInstanceGetMetadata(vgpuInstance VgpuInstance) (VgpuMetadata, Return) {
|
||||||
var VgpuMetadata VgpuMetadata
|
return vgpuInstance.GetMetadata()
|
||||||
OpaqueDataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata.OpaqueData)
|
}
|
||||||
VgpuMetadataSize := unsafe.Sizeof(VgpuMetadata.nvmlVgpuMetadata) - OpaqueDataSize
|
|
||||||
|
func (vgpuInstance nvmlVgpuInstance) GetMetadata() (VgpuMetadata, Return) {
|
||||||
|
var vgpuMetadata VgpuMetadata
|
||||||
|
opaqueDataSize := unsafe.Sizeof(vgpuMetadata.nvmlVgpuMetadata.OpaqueData)
|
||||||
|
vgpuMetadataSize := unsafe.Sizeof(vgpuMetadata.nvmlVgpuMetadata) - opaqueDataSize
|
||||||
for {
|
for {
|
||||||
BufferSize := uint32(VgpuMetadataSize + OpaqueDataSize)
|
bufferSize := uint32(vgpuMetadataSize + opaqueDataSize)
|
||||||
Buffer := make([]byte, BufferSize)
|
buffer := make([]byte, bufferSize)
|
||||||
nvmlVgpuMetadataPtr := (*nvmlVgpuMetadata)(unsafe.Pointer(&Buffer[0]))
|
nvmlVgpuMetadataPtr := (*nvmlVgpuMetadata)(unsafe.Pointer(&buffer[0]))
|
||||||
ret := nvmlVgpuInstanceGetMetadata(VgpuInstance, nvmlVgpuMetadataPtr, &BufferSize)
|
ret := nvmlVgpuInstanceGetMetadata(vgpuInstance, nvmlVgpuMetadataPtr, &bufferSize)
|
||||||
if ret == SUCCESS {
|
if ret == SUCCESS {
|
||||||
VgpuMetadata.nvmlVgpuMetadata = *nvmlVgpuMetadataPtr
|
vgpuMetadata.nvmlVgpuMetadata = *nvmlVgpuMetadataPtr
|
||||||
VgpuMetadata.OpaqueData = Buffer[VgpuMetadataSize:BufferSize]
|
vgpuMetadata.OpaqueData = buffer[vgpuMetadataSize:bufferSize]
|
||||||
return VgpuMetadata, ret
|
return vgpuMetadata, ret
|
||||||
}
|
}
|
||||||
if ret != ERROR_INSUFFICIENT_SIZE {
|
if ret != ERROR_INSUFFICIENT_SIZE {
|
||||||
return VgpuMetadata, ret
|
return vgpuMetadata, ret
|
||||||
}
|
}
|
||||||
OpaqueDataSize = 2 * OpaqueDataSize
|
opaqueDataSize = 2 * opaqueDataSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetMetadata() (VgpuMetadata, Return) {
|
|
||||||
return VgpuInstanceGetMetadata(VgpuInstance)
|
|
||||||
}
|
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetAccountingMode()
|
// nvml.VgpuInstanceGetAccountingMode()
|
||||||
func VgpuInstanceGetAccountingMode(VgpuInstance VgpuInstance) (EnableState, Return) {
|
func (l *library) VgpuInstanceGetAccountingMode(vgpuInstance VgpuInstance) (EnableState, Return) {
|
||||||
var Mode EnableState
|
return vgpuInstance.GetAccountingMode()
|
||||||
ret := nvmlVgpuInstanceGetAccountingMode(VgpuInstance, &Mode)
|
|
||||||
return Mode, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetAccountingMode() (EnableState, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetAccountingMode() (EnableState, Return) {
|
||||||
return VgpuInstanceGetAccountingMode(VgpuInstance)
|
var mode EnableState
|
||||||
|
ret := nvmlVgpuInstanceGetAccountingMode(vgpuInstance, &mode)
|
||||||
|
return mode, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetAccountingPids()
|
// nvml.VgpuInstanceGetAccountingPids()
|
||||||
func VgpuInstanceGetAccountingPids(VgpuInstance VgpuInstance) ([]int, Return) {
|
func (l *library) VgpuInstanceGetAccountingPids(vgpuInstance VgpuInstance) ([]int, Return) {
|
||||||
var Count uint32 = 1 // Will be reduced upon returning
|
return vgpuInstance.GetAccountingPids()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (vgpuInstance nvmlVgpuInstance) GetAccountingPids() ([]int, Return) {
|
||||||
|
var count uint32 = 1 // Will be reduced upon returning
|
||||||
for {
|
for {
|
||||||
Pids := make([]uint32, Count)
|
pids := make([]uint32, count)
|
||||||
ret := nvmlVgpuInstanceGetAccountingPids(VgpuInstance, &Count, &Pids[0])
|
ret := nvmlVgpuInstanceGetAccountingPids(vgpuInstance, &count, &pids[0])
|
||||||
if ret == SUCCESS {
|
if ret == SUCCESS {
|
||||||
return uint32SliceToIntSlice(Pids[:Count]), ret
|
return uint32SliceToIntSlice(pids[:count]), ret
|
||||||
}
|
}
|
||||||
if ret != ERROR_INSUFFICIENT_SIZE {
|
if ret != ERROR_INSUFFICIENT_SIZE {
|
||||||
return nil, ret
|
return nil, ret
|
||||||
}
|
}
|
||||||
Count *= 2
|
count *= 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetAccountingPids() ([]int, Return) {
|
|
||||||
return VgpuInstanceGetAccountingPids(VgpuInstance)
|
|
||||||
}
|
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetAccountingStats()
|
// nvml.VgpuInstanceGetAccountingStats()
|
||||||
func VgpuInstanceGetAccountingStats(VgpuInstance VgpuInstance, Pid int) (AccountingStats, Return) {
|
func (l *library) VgpuInstanceGetAccountingStats(vgpuInstance VgpuInstance, pid int) (AccountingStats, Return) {
|
||||||
var Stats AccountingStats
|
return vgpuInstance.GetAccountingStats(pid)
|
||||||
ret := nvmlVgpuInstanceGetAccountingStats(VgpuInstance, uint32(Pid), &Stats)
|
|
||||||
return Stats, ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetAccountingStats(Pid int) (AccountingStats, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetAccountingStats(pid int) (AccountingStats, Return) {
|
||||||
return VgpuInstanceGetAccountingStats(VgpuInstance, Pid)
|
var stats AccountingStats
|
||||||
|
ret := nvmlVgpuInstanceGetAccountingStats(vgpuInstance, uint32(pid), &stats)
|
||||||
|
return stats, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GetVgpuCompatibility()
|
// nvml.GetVgpuCompatibility()
|
||||||
func GetVgpuCompatibility(nvmlVgpuMetadata *nvmlVgpuMetadata, PgpuMetadata *nvmlVgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) {
|
func (l *library) GetVgpuCompatibility(vgpuMetadata *VgpuMetadata, pgpuMetadata *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return) {
|
||||||
var CompatibilityInfo VgpuPgpuCompatibility
|
var compatibilityInfo VgpuPgpuCompatibility
|
||||||
ret := nvmlGetVgpuCompatibility(nvmlVgpuMetadata, PgpuMetadata, &CompatibilityInfo)
|
ret := nvmlGetVgpuCompatibility(&vgpuMetadata.nvmlVgpuMetadata, &pgpuMetadata.nvmlVgpuPgpuMetadata, &compatibilityInfo)
|
||||||
return CompatibilityInfo, ret
|
return compatibilityInfo, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GetVgpuVersion()
|
// nvml.GetVgpuVersion()
|
||||||
func GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) {
|
func (l *library) GetVgpuVersion() (VgpuVersion, VgpuVersion, Return) {
|
||||||
var Supported, Current VgpuVersion
|
var supported, current VgpuVersion
|
||||||
ret := nvmlGetVgpuVersion(&Supported, &Current)
|
ret := nvmlGetVgpuVersion(&supported, ¤t)
|
||||||
return Supported, Current, ret
|
return supported, current, ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.SetVgpuVersion()
|
// nvml.SetVgpuVersion()
|
||||||
func SetVgpuVersion(VgpuVersion *VgpuVersion) Return {
|
func (l *library) SetVgpuVersion(vgpuVersion *VgpuVersion) Return {
|
||||||
return nvmlSetVgpuVersion(VgpuVersion)
|
return nvmlSetVgpuVersion(vgpuVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceClearAccountingPids()
|
// nvml.VgpuInstanceClearAccountingPids()
|
||||||
func VgpuInstanceClearAccountingPids(VgpuInstance VgpuInstance) Return {
|
func (l *library) VgpuInstanceClearAccountingPids(vgpuInstance VgpuInstance) Return {
|
||||||
return nvmlVgpuInstanceClearAccountingPids(VgpuInstance)
|
return vgpuInstance.ClearAccountingPids()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) ClearAccountingPids() Return {
|
func (vgpuInstance nvmlVgpuInstance) ClearAccountingPids() Return {
|
||||||
return VgpuInstanceClearAccountingPids(VgpuInstance)
|
return nvmlVgpuInstanceClearAccountingPids(vgpuInstance)
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuInstanceGetMdevUUID()
|
// nvml.VgpuInstanceGetMdevUUID()
|
||||||
func VgpuInstanceGetMdevUUID(VgpuInstance VgpuInstance) (string, Return) {
|
func (l *library) VgpuInstanceGetMdevUUID(vgpuInstance VgpuInstance) (string, Return) {
|
||||||
MdevUuid := make([]byte, DEVICE_UUID_BUFFER_SIZE)
|
return vgpuInstance.GetMdevUUID()
|
||||||
ret := nvmlVgpuInstanceGetMdevUUID(VgpuInstance, &MdevUuid[0], DEVICE_UUID_BUFFER_SIZE)
|
|
||||||
return string(MdevUuid[:clen(MdevUuid)]), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuInstance VgpuInstance) GetMdevUUID() (string, Return) {
|
func (vgpuInstance nvmlVgpuInstance) GetMdevUUID() (string, Return) {
|
||||||
return VgpuInstanceGetMdevUUID(VgpuInstance)
|
mdevUUID := make([]byte, DEVICE_UUID_BUFFER_SIZE)
|
||||||
|
ret := nvmlVgpuInstanceGetMdevUUID(vgpuInstance, &mdevUUID[0], DEVICE_UUID_BUFFER_SIZE)
|
||||||
|
return string(mdevUUID[:clen(mdevUUID)]), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.VgpuTypeGetCapabilities()
|
// nvml.VgpuTypeGetCapabilities()
|
||||||
func VgpuTypeGetCapabilities(VgpuTypeId VgpuTypeId, Capability VgpuCapability) (bool, Return) {
|
func (l *library) VgpuTypeGetCapabilities(vgpuTypeId VgpuTypeId, capability VgpuCapability) (bool, Return) {
|
||||||
var CapResult uint32
|
return vgpuTypeId.GetCapabilities(capability)
|
||||||
ret := nvmlVgpuTypeGetCapabilities(VgpuTypeId, Capability, &CapResult)
|
|
||||||
return (CapResult != 0), ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (VgpuTypeId VgpuTypeId) GetCapabilities(Capability VgpuCapability) (bool, Return) {
|
func (vgpuTypeId nvmlVgpuTypeId) GetCapabilities(capability VgpuCapability) (bool, Return) {
|
||||||
return VgpuTypeGetCapabilities(VgpuTypeId, Capability)
|
var capResult uint32
|
||||||
|
ret := nvmlVgpuTypeGetCapabilities(vgpuTypeId, capability, &capResult)
|
||||||
|
return (capResult != 0), ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvml.GetVgpuDriverCapabilities()
|
// nvml.GetVgpuDriverCapabilities()
|
||||||
func GetVgpuDriverCapabilities(Capability VgpuDriverCapability) (bool, Return) {
|
func (l *library) GetVgpuDriverCapabilities(capability VgpuDriverCapability) (bool, Return) {
|
||||||
var CapResult uint32
|
var capResult uint32
|
||||||
ret := nvmlGetVgpuDriverCapabilities(Capability, &CapResult)
|
ret := nvmlGetVgpuDriverCapabilities(capability, &capResult)
|
||||||
return (CapResult != 0), ret
|
return (capResult != 0), ret
|
||||||
}
|
}
|
||||||
|
919
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go
generated
vendored
Normal file
919
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/zz_generated.api.go
generated
vendored
Normal file
@ -0,0 +1,919 @@
|
|||||||
|
/**
|
||||||
|
# Copyright 2024 NVIDIA CORPORATION
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
**/
|
||||||
|
|
||||||
|
// Generated Code; DO NOT EDIT.
|
||||||
|
|
||||||
|
package nvml
|
||||||
|
|
||||||
|
// The variables below represent package level methods from the library type.
|
||||||
|
var (
|
||||||
|
ComputeInstanceDestroy = libnvml.ComputeInstanceDestroy
|
||||||
|
ComputeInstanceGetInfo = libnvml.ComputeInstanceGetInfo
|
||||||
|
DeviceCcuGetStreamState = libnvml.DeviceCcuGetStreamState
|
||||||
|
DeviceCcuSetStreamState = libnvml.DeviceCcuSetStreamState
|
||||||
|
DeviceClearAccountingPids = libnvml.DeviceClearAccountingPids
|
||||||
|
DeviceClearCpuAffinity = libnvml.DeviceClearCpuAffinity
|
||||||
|
DeviceClearEccErrorCounts = libnvml.DeviceClearEccErrorCounts
|
||||||
|
DeviceClearFieldValues = libnvml.DeviceClearFieldValues
|
||||||
|
DeviceCreateGpuInstance = libnvml.DeviceCreateGpuInstance
|
||||||
|
DeviceCreateGpuInstanceWithPlacement = libnvml.DeviceCreateGpuInstanceWithPlacement
|
||||||
|
DeviceDiscoverGpus = libnvml.DeviceDiscoverGpus
|
||||||
|
DeviceFreezeNvLinkUtilizationCounter = libnvml.DeviceFreezeNvLinkUtilizationCounter
|
||||||
|
DeviceGetAPIRestriction = libnvml.DeviceGetAPIRestriction
|
||||||
|
DeviceGetAccountingBufferSize = libnvml.DeviceGetAccountingBufferSize
|
||||||
|
DeviceGetAccountingMode = libnvml.DeviceGetAccountingMode
|
||||||
|
DeviceGetAccountingPids = libnvml.DeviceGetAccountingPids
|
||||||
|
DeviceGetAccountingStats = libnvml.DeviceGetAccountingStats
|
||||||
|
DeviceGetActiveVgpus = libnvml.DeviceGetActiveVgpus
|
||||||
|
DeviceGetAdaptiveClockInfoStatus = libnvml.DeviceGetAdaptiveClockInfoStatus
|
||||||
|
DeviceGetApplicationsClock = libnvml.DeviceGetApplicationsClock
|
||||||
|
DeviceGetArchitecture = libnvml.DeviceGetArchitecture
|
||||||
|
DeviceGetAttributes = libnvml.DeviceGetAttributes
|
||||||
|
DeviceGetAutoBoostedClocksEnabled = libnvml.DeviceGetAutoBoostedClocksEnabled
|
||||||
|
DeviceGetBAR1MemoryInfo = libnvml.DeviceGetBAR1MemoryInfo
|
||||||
|
DeviceGetBoardId = libnvml.DeviceGetBoardId
|
||||||
|
DeviceGetBoardPartNumber = libnvml.DeviceGetBoardPartNumber
|
||||||
|
DeviceGetBrand = libnvml.DeviceGetBrand
|
||||||
|
DeviceGetBridgeChipInfo = libnvml.DeviceGetBridgeChipInfo
|
||||||
|
DeviceGetBusType = libnvml.DeviceGetBusType
|
||||||
|
DeviceGetClkMonStatus = libnvml.DeviceGetClkMonStatus
|
||||||
|
DeviceGetClock = libnvml.DeviceGetClock
|
||||||
|
DeviceGetClockInfo = libnvml.DeviceGetClockInfo
|
||||||
|
DeviceGetComputeInstanceId = libnvml.DeviceGetComputeInstanceId
|
||||||
|
DeviceGetComputeMode = libnvml.DeviceGetComputeMode
|
||||||
|
DeviceGetComputeRunningProcesses = libnvml.DeviceGetComputeRunningProcesses
|
||||||
|
DeviceGetCount = libnvml.DeviceGetCount
|
||||||
|
DeviceGetCpuAffinity = libnvml.DeviceGetCpuAffinity
|
||||||
|
DeviceGetCpuAffinityWithinScope = libnvml.DeviceGetCpuAffinityWithinScope
|
||||||
|
DeviceGetCreatableVgpus = libnvml.DeviceGetCreatableVgpus
|
||||||
|
DeviceGetCudaComputeCapability = libnvml.DeviceGetCudaComputeCapability
|
||||||
|
DeviceGetCurrPcieLinkGeneration = libnvml.DeviceGetCurrPcieLinkGeneration
|
||||||
|
DeviceGetCurrPcieLinkWidth = libnvml.DeviceGetCurrPcieLinkWidth
|
||||||
|
DeviceGetCurrentClocksThrottleReasons = libnvml.DeviceGetCurrentClocksThrottleReasons
|
||||||
|
DeviceGetDecoderUtilization = libnvml.DeviceGetDecoderUtilization
|
||||||
|
DeviceGetDefaultApplicationsClock = libnvml.DeviceGetDefaultApplicationsClock
|
||||||
|
DeviceGetDefaultEccMode = libnvml.DeviceGetDefaultEccMode
|
||||||
|
DeviceGetDetailedEccErrors = libnvml.DeviceGetDetailedEccErrors
|
||||||
|
DeviceGetDeviceHandleFromMigDeviceHandle = libnvml.DeviceGetDeviceHandleFromMigDeviceHandle
|
||||||
|
DeviceGetDisplayActive = libnvml.DeviceGetDisplayActive
|
||||||
|
DeviceGetDisplayMode = libnvml.DeviceGetDisplayMode
|
||||||
|
DeviceGetDriverModel = libnvml.DeviceGetDriverModel
|
||||||
|
DeviceGetDynamicPstatesInfo = libnvml.DeviceGetDynamicPstatesInfo
|
||||||
|
DeviceGetEccMode = libnvml.DeviceGetEccMode
|
||||||
|
DeviceGetEncoderCapacity = libnvml.DeviceGetEncoderCapacity
|
||||||
|
DeviceGetEncoderSessions = libnvml.DeviceGetEncoderSessions
|
||||||
|
DeviceGetEncoderStats = libnvml.DeviceGetEncoderStats
|
||||||
|
DeviceGetEncoderUtilization = libnvml.DeviceGetEncoderUtilization
|
||||||
|
DeviceGetEnforcedPowerLimit = libnvml.DeviceGetEnforcedPowerLimit
|
||||||
|
DeviceGetFBCSessions = libnvml.DeviceGetFBCSessions
|
||||||
|
DeviceGetFBCStats = libnvml.DeviceGetFBCStats
|
||||||
|
DeviceGetFanControlPolicy_v2 = libnvml.DeviceGetFanControlPolicy_v2
|
||||||
|
DeviceGetFanSpeed = libnvml.DeviceGetFanSpeed
|
||||||
|
DeviceGetFanSpeed_v2 = libnvml.DeviceGetFanSpeed_v2
|
||||||
|
DeviceGetFieldValues = libnvml.DeviceGetFieldValues
|
||||||
|
DeviceGetGpcClkMinMaxVfOffset = libnvml.DeviceGetGpcClkMinMaxVfOffset
|
||||||
|
DeviceGetGpcClkVfOffset = libnvml.DeviceGetGpcClkVfOffset
|
||||||
|
DeviceGetGpuFabricInfo = libnvml.DeviceGetGpuFabricInfo
|
||||||
|
DeviceGetGpuInstanceById = libnvml.DeviceGetGpuInstanceById
|
||||||
|
DeviceGetGpuInstanceId = libnvml.DeviceGetGpuInstanceId
|
||||||
|
DeviceGetGpuInstancePossiblePlacements = libnvml.DeviceGetGpuInstancePossiblePlacements
|
||||||
|
DeviceGetGpuInstanceProfileInfo = libnvml.DeviceGetGpuInstanceProfileInfo
|
||||||
|
DeviceGetGpuInstanceProfileInfoV = libnvml.DeviceGetGpuInstanceProfileInfoV
|
||||||
|
DeviceGetGpuInstanceRemainingCapacity = libnvml.DeviceGetGpuInstanceRemainingCapacity
|
||||||
|
DeviceGetGpuInstances = libnvml.DeviceGetGpuInstances
|
||||||
|
DeviceGetGpuMaxPcieLinkGeneration = libnvml.DeviceGetGpuMaxPcieLinkGeneration
|
||||||
|
DeviceGetGpuOperationMode = libnvml.DeviceGetGpuOperationMode
|
||||||
|
DeviceGetGraphicsRunningProcesses = libnvml.DeviceGetGraphicsRunningProcesses
|
||||||
|
DeviceGetGridLicensableFeatures = libnvml.DeviceGetGridLicensableFeatures
|
||||||
|
DeviceGetGspFirmwareMode = libnvml.DeviceGetGspFirmwareMode
|
||||||
|
DeviceGetGspFirmwareVersion = libnvml.DeviceGetGspFirmwareVersion
|
||||||
|
DeviceGetHandleByIndex = libnvml.DeviceGetHandleByIndex
|
||||||
|
DeviceGetHandleByPciBusId = libnvml.DeviceGetHandleByPciBusId
|
||||||
|
DeviceGetHandleBySerial = libnvml.DeviceGetHandleBySerial
|
||||||
|
DeviceGetHandleByUUID = libnvml.DeviceGetHandleByUUID
|
||||||
|
DeviceGetHostVgpuMode = libnvml.DeviceGetHostVgpuMode
|
||||||
|
DeviceGetIndex = libnvml.DeviceGetIndex
|
||||||
|
DeviceGetInforomConfigurationChecksum = libnvml.DeviceGetInforomConfigurationChecksum
|
||||||
|
DeviceGetInforomImageVersion = libnvml.DeviceGetInforomImageVersion
|
||||||
|
DeviceGetInforomVersion = libnvml.DeviceGetInforomVersion
|
||||||
|
DeviceGetIrqNum = libnvml.DeviceGetIrqNum
|
||||||
|
DeviceGetMPSComputeRunningProcesses = libnvml.DeviceGetMPSComputeRunningProcesses
|
||||||
|
DeviceGetMaxClockInfo = libnvml.DeviceGetMaxClockInfo
|
||||||
|
DeviceGetMaxCustomerBoostClock = libnvml.DeviceGetMaxCustomerBoostClock
|
||||||
|
DeviceGetMaxMigDeviceCount = libnvml.DeviceGetMaxMigDeviceCount
|
||||||
|
DeviceGetMaxPcieLinkGeneration = libnvml.DeviceGetMaxPcieLinkGeneration
|
||||||
|
DeviceGetMaxPcieLinkWidth = libnvml.DeviceGetMaxPcieLinkWidth
|
||||||
|
DeviceGetMemClkMinMaxVfOffset = libnvml.DeviceGetMemClkMinMaxVfOffset
|
||||||
|
DeviceGetMemClkVfOffset = libnvml.DeviceGetMemClkVfOffset
|
||||||
|
DeviceGetMemoryAffinity = libnvml.DeviceGetMemoryAffinity
|
||||||
|
DeviceGetMemoryBusWidth = libnvml.DeviceGetMemoryBusWidth
|
||||||
|
DeviceGetMemoryErrorCounter = libnvml.DeviceGetMemoryErrorCounter
|
||||||
|
DeviceGetMemoryInfo = libnvml.DeviceGetMemoryInfo
|
||||||
|
DeviceGetMemoryInfo_v2 = libnvml.DeviceGetMemoryInfo_v2
|
||||||
|
DeviceGetMigDeviceHandleByIndex = libnvml.DeviceGetMigDeviceHandleByIndex
|
||||||
|
DeviceGetMigMode = libnvml.DeviceGetMigMode
|
||||||
|
DeviceGetMinMaxClockOfPState = libnvml.DeviceGetMinMaxClockOfPState
|
||||||
|
DeviceGetMinMaxFanSpeed = libnvml.DeviceGetMinMaxFanSpeed
|
||||||
|
DeviceGetMinorNumber = libnvml.DeviceGetMinorNumber
|
||||||
|
DeviceGetMultiGpuBoard = libnvml.DeviceGetMultiGpuBoard
|
||||||
|
DeviceGetName = libnvml.DeviceGetName
|
||||||
|
DeviceGetNumFans = libnvml.DeviceGetNumFans
|
||||||
|
DeviceGetNumGpuCores = libnvml.DeviceGetNumGpuCores
|
||||||
|
DeviceGetNvLinkCapability = libnvml.DeviceGetNvLinkCapability
|
||||||
|
DeviceGetNvLinkErrorCounter = libnvml.DeviceGetNvLinkErrorCounter
|
||||||
|
DeviceGetNvLinkRemoteDeviceType = libnvml.DeviceGetNvLinkRemoteDeviceType
|
||||||
|
DeviceGetNvLinkRemotePciInfo = libnvml.DeviceGetNvLinkRemotePciInfo
|
||||||
|
DeviceGetNvLinkState = libnvml.DeviceGetNvLinkState
|
||||||
|
DeviceGetNvLinkUtilizationControl = libnvml.DeviceGetNvLinkUtilizationControl
|
||||||
|
DeviceGetNvLinkUtilizationCounter = libnvml.DeviceGetNvLinkUtilizationCounter
|
||||||
|
DeviceGetNvLinkVersion = libnvml.DeviceGetNvLinkVersion
|
||||||
|
DeviceGetP2PStatus = libnvml.DeviceGetP2PStatus
|
||||||
|
DeviceGetPciInfo = libnvml.DeviceGetPciInfo
|
||||||
|
DeviceGetPcieLinkMaxSpeed = libnvml.DeviceGetPcieLinkMaxSpeed
|
||||||
|
DeviceGetPcieReplayCounter = libnvml.DeviceGetPcieReplayCounter
|
||||||
|
DeviceGetPcieSpeed = libnvml.DeviceGetPcieSpeed
|
||||||
|
DeviceGetPcieThroughput = libnvml.DeviceGetPcieThroughput
|
||||||
|
DeviceGetPerformanceState = libnvml.DeviceGetPerformanceState
|
||||||
|
DeviceGetPersistenceMode = libnvml.DeviceGetPersistenceMode
|
||||||
|
DeviceGetPgpuMetadataString = libnvml.DeviceGetPgpuMetadataString
|
||||||
|
DeviceGetPowerManagementDefaultLimit = libnvml.DeviceGetPowerManagementDefaultLimit
|
||||||
|
DeviceGetPowerManagementLimit = libnvml.DeviceGetPowerManagementLimit
|
||||||
|
DeviceGetPowerManagementLimitConstraints = libnvml.DeviceGetPowerManagementLimitConstraints
|
||||||
|
DeviceGetPowerManagementMode = libnvml.DeviceGetPowerManagementMode
|
||||||
|
DeviceGetPowerSource = libnvml.DeviceGetPowerSource
|
||||||
|
DeviceGetPowerState = libnvml.DeviceGetPowerState
|
||||||
|
DeviceGetPowerUsage = libnvml.DeviceGetPowerUsage
|
||||||
|
DeviceGetProcessUtilization = libnvml.DeviceGetProcessUtilization
|
||||||
|
DeviceGetRemappedRows = libnvml.DeviceGetRemappedRows
|
||||||
|
DeviceGetRetiredPages = libnvml.DeviceGetRetiredPages
|
||||||
|
DeviceGetRetiredPagesPendingStatus = libnvml.DeviceGetRetiredPagesPendingStatus
|
||||||
|
DeviceGetRetiredPages_v2 = libnvml.DeviceGetRetiredPages_v2
|
||||||
|
DeviceGetRowRemapperHistogram = libnvml.DeviceGetRowRemapperHistogram
|
||||||
|
DeviceGetSamples = libnvml.DeviceGetSamples
|
||||||
|
DeviceGetSerial = libnvml.DeviceGetSerial
|
||||||
|
DeviceGetSupportedClocksThrottleReasons = libnvml.DeviceGetSupportedClocksThrottleReasons
|
||||||
|
DeviceGetSupportedEventTypes = libnvml.DeviceGetSupportedEventTypes
|
||||||
|
DeviceGetSupportedGraphicsClocks = libnvml.DeviceGetSupportedGraphicsClocks
|
||||||
|
DeviceGetSupportedMemoryClocks = libnvml.DeviceGetSupportedMemoryClocks
|
||||||
|
DeviceGetSupportedPerformanceStates = libnvml.DeviceGetSupportedPerformanceStates
|
||||||
|
DeviceGetSupportedVgpus = libnvml.DeviceGetSupportedVgpus
|
||||||
|
DeviceGetTargetFanSpeed = libnvml.DeviceGetTargetFanSpeed
|
||||||
|
DeviceGetTemperature = libnvml.DeviceGetTemperature
|
||||||
|
DeviceGetTemperatureThreshold = libnvml.DeviceGetTemperatureThreshold
|
||||||
|
DeviceGetThermalSettings = libnvml.DeviceGetThermalSettings
|
||||||
|
DeviceGetTopologyCommonAncestor = libnvml.DeviceGetTopologyCommonAncestor
|
||||||
|
DeviceGetTopologyNearestGpus = libnvml.DeviceGetTopologyNearestGpus
|
||||||
|
DeviceGetTotalEccErrors = libnvml.DeviceGetTotalEccErrors
|
||||||
|
DeviceGetTotalEnergyConsumption = libnvml.DeviceGetTotalEnergyConsumption
|
||||||
|
DeviceGetUUID = libnvml.DeviceGetUUID
|
||||||
|
DeviceGetUtilizationRates = libnvml.DeviceGetUtilizationRates
|
||||||
|
DeviceGetVbiosVersion = libnvml.DeviceGetVbiosVersion
|
||||||
|
DeviceGetVgpuCapabilities = libnvml.DeviceGetVgpuCapabilities
|
||||||
|
DeviceGetVgpuMetadata = libnvml.DeviceGetVgpuMetadata
|
||||||
|
DeviceGetVgpuProcessUtilization = libnvml.DeviceGetVgpuProcessUtilization
|
||||||
|
DeviceGetVgpuSchedulerCapabilities = libnvml.DeviceGetVgpuSchedulerCapabilities
|
||||||
|
DeviceGetVgpuSchedulerLog = libnvml.DeviceGetVgpuSchedulerLog
|
||||||
|
DeviceGetVgpuSchedulerState = libnvml.DeviceGetVgpuSchedulerState
|
||||||
|
DeviceGetVgpuUtilization = libnvml.DeviceGetVgpuUtilization
|
||||||
|
DeviceGetViolationStatus = libnvml.DeviceGetViolationStatus
|
||||||
|
DeviceGetVirtualizationMode = libnvml.DeviceGetVirtualizationMode
|
||||||
|
DeviceIsMigDeviceHandle = libnvml.DeviceIsMigDeviceHandle
|
||||||
|
DeviceModifyDrainState = libnvml.DeviceModifyDrainState
|
||||||
|
DeviceOnSameBoard = libnvml.DeviceOnSameBoard
|
||||||
|
DeviceQueryDrainState = libnvml.DeviceQueryDrainState
|
||||||
|
DeviceRegisterEvents = libnvml.DeviceRegisterEvents
|
||||||
|
DeviceRemoveGpu = libnvml.DeviceRemoveGpu
|
||||||
|
DeviceRemoveGpu_v2 = libnvml.DeviceRemoveGpu_v2
|
||||||
|
DeviceResetApplicationsClocks = libnvml.DeviceResetApplicationsClocks
|
||||||
|
DeviceResetGpuLockedClocks = libnvml.DeviceResetGpuLockedClocks
|
||||||
|
DeviceResetMemoryLockedClocks = libnvml.DeviceResetMemoryLockedClocks
|
||||||
|
DeviceResetNvLinkErrorCounters = libnvml.DeviceResetNvLinkErrorCounters
|
||||||
|
DeviceResetNvLinkUtilizationCounter = libnvml.DeviceResetNvLinkUtilizationCounter
|
||||||
|
DeviceSetAPIRestriction = libnvml.DeviceSetAPIRestriction
|
||||||
|
DeviceSetAccountingMode = libnvml.DeviceSetAccountingMode
|
||||||
|
DeviceSetApplicationsClocks = libnvml.DeviceSetApplicationsClocks
|
||||||
|
DeviceSetAutoBoostedClocksEnabled = libnvml.DeviceSetAutoBoostedClocksEnabled
|
||||||
|
DeviceSetComputeMode = libnvml.DeviceSetComputeMode
|
||||||
|
DeviceSetCpuAffinity = libnvml.DeviceSetCpuAffinity
|
||||||
|
DeviceSetDefaultAutoBoostedClocksEnabled = libnvml.DeviceSetDefaultAutoBoostedClocksEnabled
|
||||||
|
DeviceSetDefaultFanSpeed_v2 = libnvml.DeviceSetDefaultFanSpeed_v2
|
||||||
|
DeviceSetDriverModel = libnvml.DeviceSetDriverModel
|
||||||
|
DeviceSetEccMode = libnvml.DeviceSetEccMode
|
||||||
|
DeviceSetFanControlPolicy = libnvml.DeviceSetFanControlPolicy
|
||||||
|
DeviceSetFanSpeed_v2 = libnvml.DeviceSetFanSpeed_v2
|
||||||
|
DeviceSetGpcClkVfOffset = libnvml.DeviceSetGpcClkVfOffset
|
||||||
|
DeviceSetGpuLockedClocks = libnvml.DeviceSetGpuLockedClocks
|
||||||
|
DeviceSetGpuOperationMode = libnvml.DeviceSetGpuOperationMode
|
||||||
|
DeviceSetMemClkVfOffset = libnvml.DeviceSetMemClkVfOffset
|
||||||
|
DeviceSetMemoryLockedClocks = libnvml.DeviceSetMemoryLockedClocks
|
||||||
|
DeviceSetMigMode = libnvml.DeviceSetMigMode
|
||||||
|
DeviceSetNvLinkDeviceLowPowerThreshold = libnvml.DeviceSetNvLinkDeviceLowPowerThreshold
|
||||||
|
DeviceSetNvLinkUtilizationControl = libnvml.DeviceSetNvLinkUtilizationControl
|
||||||
|
DeviceSetPersistenceMode = libnvml.DeviceSetPersistenceMode
|
||||||
|
DeviceSetPowerManagementLimit = libnvml.DeviceSetPowerManagementLimit
|
||||||
|
DeviceSetTemperatureThreshold = libnvml.DeviceSetTemperatureThreshold
|
||||||
|
DeviceSetVgpuSchedulerState = libnvml.DeviceSetVgpuSchedulerState
|
||||||
|
DeviceSetVirtualizationMode = libnvml.DeviceSetVirtualizationMode
|
||||||
|
DeviceValidateInforom = libnvml.DeviceValidateInforom
|
||||||
|
ErrorString = libnvml.ErrorString
|
||||||
|
EventSetCreate = libnvml.EventSetCreate
|
||||||
|
EventSetFree = libnvml.EventSetFree
|
||||||
|
EventSetWait = libnvml.EventSetWait
|
||||||
|
Extensions = libnvml.Extensions
|
||||||
|
GetExcludedDeviceCount = libnvml.GetExcludedDeviceCount
|
||||||
|
GetExcludedDeviceInfoByIndex = libnvml.GetExcludedDeviceInfoByIndex
|
||||||
|
GetVgpuCompatibility = libnvml.GetVgpuCompatibility
|
||||||
|
GetVgpuDriverCapabilities = libnvml.GetVgpuDriverCapabilities
|
||||||
|
GetVgpuVersion = libnvml.GetVgpuVersion
|
||||||
|
GpmMetricsGet = libnvml.GpmMetricsGet
|
||||||
|
GpmMetricsGetV = libnvml.GpmMetricsGetV
|
||||||
|
GpmMigSampleGet = libnvml.GpmMigSampleGet
|
||||||
|
GpmQueryDeviceSupport = libnvml.GpmQueryDeviceSupport
|
||||||
|
GpmQueryDeviceSupportV = libnvml.GpmQueryDeviceSupportV
|
||||||
|
GpmSampleAlloc = libnvml.GpmSampleAlloc
|
||||||
|
GpmSampleFree = libnvml.GpmSampleFree
|
||||||
|
GpmSampleGet = libnvml.GpmSampleGet
|
||||||
|
GpuInstanceCreateComputeInstance = libnvml.GpuInstanceCreateComputeInstance
|
||||||
|
GpuInstanceCreateComputeInstanceWithPlacement = libnvml.GpuInstanceCreateComputeInstanceWithPlacement
|
||||||
|
GpuInstanceDestroy = libnvml.GpuInstanceDestroy
|
||||||
|
GpuInstanceGetComputeInstanceById = libnvml.GpuInstanceGetComputeInstanceById
|
||||||
|
GpuInstanceGetComputeInstancePossiblePlacements = libnvml.GpuInstanceGetComputeInstancePossiblePlacements
|
||||||
|
GpuInstanceGetComputeInstanceProfileInfo = libnvml.GpuInstanceGetComputeInstanceProfileInfo
|
||||||
|
GpuInstanceGetComputeInstanceProfileInfoV = libnvml.GpuInstanceGetComputeInstanceProfileInfoV
|
||||||
|
GpuInstanceGetComputeInstanceRemainingCapacity = libnvml.GpuInstanceGetComputeInstanceRemainingCapacity
|
||||||
|
GpuInstanceGetComputeInstances = libnvml.GpuInstanceGetComputeInstances
|
||||||
|
GpuInstanceGetInfo = libnvml.GpuInstanceGetInfo
|
||||||
|
Init = libnvml.Init
|
||||||
|
InitWithFlags = libnvml.InitWithFlags
|
||||||
|
SetVgpuVersion = libnvml.SetVgpuVersion
|
||||||
|
Shutdown = libnvml.Shutdown
|
||||||
|
SystemGetCudaDriverVersion = libnvml.SystemGetCudaDriverVersion
|
||||||
|
SystemGetCudaDriverVersion_v2 = libnvml.SystemGetCudaDriverVersion_v2
|
||||||
|
SystemGetDriverVersion = libnvml.SystemGetDriverVersion
|
||||||
|
SystemGetHicVersion = libnvml.SystemGetHicVersion
|
||||||
|
SystemGetNVMLVersion = libnvml.SystemGetNVMLVersion
|
||||||
|
SystemGetProcessName = libnvml.SystemGetProcessName
|
||||||
|
SystemGetTopologyGpuSet = libnvml.SystemGetTopologyGpuSet
|
||||||
|
UnitGetCount = libnvml.UnitGetCount
|
||||||
|
UnitGetDevices = libnvml.UnitGetDevices
|
||||||
|
UnitGetFanSpeedInfo = libnvml.UnitGetFanSpeedInfo
|
||||||
|
UnitGetHandleByIndex = libnvml.UnitGetHandleByIndex
|
||||||
|
UnitGetLedState = libnvml.UnitGetLedState
|
||||||
|
UnitGetPsuInfo = libnvml.UnitGetPsuInfo
|
||||||
|
UnitGetTemperature = libnvml.UnitGetTemperature
|
||||||
|
UnitGetUnitInfo = libnvml.UnitGetUnitInfo
|
||||||
|
UnitSetLedState = libnvml.UnitSetLedState
|
||||||
|
VgpuInstanceClearAccountingPids = libnvml.VgpuInstanceClearAccountingPids
|
||||||
|
VgpuInstanceGetAccountingMode = libnvml.VgpuInstanceGetAccountingMode
|
||||||
|
VgpuInstanceGetAccountingPids = libnvml.VgpuInstanceGetAccountingPids
|
||||||
|
VgpuInstanceGetAccountingStats = libnvml.VgpuInstanceGetAccountingStats
|
||||||
|
VgpuInstanceGetEccMode = libnvml.VgpuInstanceGetEccMode
|
||||||
|
VgpuInstanceGetEncoderCapacity = libnvml.VgpuInstanceGetEncoderCapacity
|
||||||
|
VgpuInstanceGetEncoderSessions = libnvml.VgpuInstanceGetEncoderSessions
|
||||||
|
VgpuInstanceGetEncoderStats = libnvml.VgpuInstanceGetEncoderStats
|
||||||
|
VgpuInstanceGetFBCSessions = libnvml.VgpuInstanceGetFBCSessions
|
||||||
|
VgpuInstanceGetFBCStats = libnvml.VgpuInstanceGetFBCStats
|
||||||
|
VgpuInstanceGetFbUsage = libnvml.VgpuInstanceGetFbUsage
|
||||||
|
VgpuInstanceGetFrameRateLimit = libnvml.VgpuInstanceGetFrameRateLimit
|
||||||
|
VgpuInstanceGetGpuInstanceId = libnvml.VgpuInstanceGetGpuInstanceId
|
||||||
|
VgpuInstanceGetGpuPciId = libnvml.VgpuInstanceGetGpuPciId
|
||||||
|
VgpuInstanceGetLicenseInfo = libnvml.VgpuInstanceGetLicenseInfo
|
||||||
|
VgpuInstanceGetLicenseStatus = libnvml.VgpuInstanceGetLicenseStatus
|
||||||
|
VgpuInstanceGetMdevUUID = libnvml.VgpuInstanceGetMdevUUID
|
||||||
|
VgpuInstanceGetMetadata = libnvml.VgpuInstanceGetMetadata
|
||||||
|
VgpuInstanceGetType = libnvml.VgpuInstanceGetType
|
||||||
|
VgpuInstanceGetUUID = libnvml.VgpuInstanceGetUUID
|
||||||
|
VgpuInstanceGetVmDriverVersion = libnvml.VgpuInstanceGetVmDriverVersion
|
||||||
|
VgpuInstanceGetVmID = libnvml.VgpuInstanceGetVmID
|
||||||
|
VgpuInstanceSetEncoderCapacity = libnvml.VgpuInstanceSetEncoderCapacity
|
||||||
|
VgpuTypeGetCapabilities = libnvml.VgpuTypeGetCapabilities
|
||||||
|
VgpuTypeGetClass = libnvml.VgpuTypeGetClass
|
||||||
|
VgpuTypeGetDeviceID = libnvml.VgpuTypeGetDeviceID
|
||||||
|
VgpuTypeGetFrameRateLimit = libnvml.VgpuTypeGetFrameRateLimit
|
||||||
|
VgpuTypeGetFramebufferSize = libnvml.VgpuTypeGetFramebufferSize
|
||||||
|
VgpuTypeGetGpuInstanceProfileId = libnvml.VgpuTypeGetGpuInstanceProfileId
|
||||||
|
VgpuTypeGetLicense = libnvml.VgpuTypeGetLicense
|
||||||
|
VgpuTypeGetMaxInstances = libnvml.VgpuTypeGetMaxInstances
|
||||||
|
VgpuTypeGetMaxInstancesPerVm = libnvml.VgpuTypeGetMaxInstancesPerVm
|
||||||
|
VgpuTypeGetName = libnvml.VgpuTypeGetName
|
||||||
|
VgpuTypeGetNumDisplayHeads = libnvml.VgpuTypeGetNumDisplayHeads
|
||||||
|
VgpuTypeGetResolution = libnvml.VgpuTypeGetResolution
|
||||||
|
)
|
||||||
|
|
||||||
|
// Interface represents the interface for the library type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/interface.go -pkg mock . Interface:Interface
|
||||||
|
type Interface interface {
|
||||||
|
ComputeInstanceDestroy(ComputeInstance) Return
|
||||||
|
ComputeInstanceGetInfo(ComputeInstance) (ComputeInstanceInfo, Return)
|
||||||
|
DeviceCcuGetStreamState(Device) (int, Return)
|
||||||
|
DeviceCcuSetStreamState(Device, int) Return
|
||||||
|
DeviceClearAccountingPids(Device) Return
|
||||||
|
DeviceClearCpuAffinity(Device) Return
|
||||||
|
DeviceClearEccErrorCounts(Device, EccCounterType) Return
|
||||||
|
DeviceClearFieldValues(Device, []FieldValue) Return
|
||||||
|
DeviceCreateGpuInstance(Device, *GpuInstanceProfileInfo) (GpuInstance, Return)
|
||||||
|
DeviceCreateGpuInstanceWithPlacement(Device, *GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return)
|
||||||
|
DeviceDiscoverGpus() (PciInfo, Return)
|
||||||
|
DeviceFreezeNvLinkUtilizationCounter(Device, int, int, EnableState) Return
|
||||||
|
DeviceGetAPIRestriction(Device, RestrictedAPI) (EnableState, Return)
|
||||||
|
DeviceGetAccountingBufferSize(Device) (int, Return)
|
||||||
|
DeviceGetAccountingMode(Device) (EnableState, Return)
|
||||||
|
DeviceGetAccountingPids(Device) ([]int, Return)
|
||||||
|
DeviceGetAccountingStats(Device, uint32) (AccountingStats, Return)
|
||||||
|
DeviceGetActiveVgpus(Device) ([]VgpuInstance, Return)
|
||||||
|
DeviceGetAdaptiveClockInfoStatus(Device) (uint32, Return)
|
||||||
|
DeviceGetApplicationsClock(Device, ClockType) (uint32, Return)
|
||||||
|
DeviceGetArchitecture(Device) (DeviceArchitecture, Return)
|
||||||
|
DeviceGetAttributes(Device) (DeviceAttributes, Return)
|
||||||
|
DeviceGetAutoBoostedClocksEnabled(Device) (EnableState, EnableState, Return)
|
||||||
|
DeviceGetBAR1MemoryInfo(Device) (BAR1Memory, Return)
|
||||||
|
DeviceGetBoardId(Device) (uint32, Return)
|
||||||
|
DeviceGetBoardPartNumber(Device) (string, Return)
|
||||||
|
DeviceGetBrand(Device) (BrandType, Return)
|
||||||
|
DeviceGetBridgeChipInfo(Device) (BridgeChipHierarchy, Return)
|
||||||
|
DeviceGetBusType(Device) (BusType, Return)
|
||||||
|
DeviceGetClkMonStatus(Device) (ClkMonStatus, Return)
|
||||||
|
DeviceGetClock(Device, ClockType, ClockId) (uint32, Return)
|
||||||
|
DeviceGetClockInfo(Device, ClockType) (uint32, Return)
|
||||||
|
DeviceGetComputeInstanceId(Device) (int, Return)
|
||||||
|
DeviceGetComputeMode(Device) (ComputeMode, Return)
|
||||||
|
DeviceGetComputeRunningProcesses(Device) ([]ProcessInfo, Return)
|
||||||
|
DeviceGetCount() (int, Return)
|
||||||
|
DeviceGetCpuAffinity(Device, int) ([]uint, Return)
|
||||||
|
DeviceGetCpuAffinityWithinScope(Device, int, AffinityScope) ([]uint, Return)
|
||||||
|
DeviceGetCreatableVgpus(Device) ([]VgpuTypeId, Return)
|
||||||
|
DeviceGetCudaComputeCapability(Device) (int, int, Return)
|
||||||
|
DeviceGetCurrPcieLinkGeneration(Device) (int, Return)
|
||||||
|
DeviceGetCurrPcieLinkWidth(Device) (int, Return)
|
||||||
|
DeviceGetCurrentClocksThrottleReasons(Device) (uint64, Return)
|
||||||
|
DeviceGetDecoderUtilization(Device) (uint32, uint32, Return)
|
||||||
|
DeviceGetDefaultApplicationsClock(Device, ClockType) (uint32, Return)
|
||||||
|
DeviceGetDefaultEccMode(Device) (EnableState, Return)
|
||||||
|
DeviceGetDetailedEccErrors(Device, MemoryErrorType, EccCounterType) (EccErrorCounts, Return)
|
||||||
|
DeviceGetDeviceHandleFromMigDeviceHandle(Device) (Device, Return)
|
||||||
|
DeviceGetDisplayActive(Device) (EnableState, Return)
|
||||||
|
DeviceGetDisplayMode(Device) (EnableState, Return)
|
||||||
|
DeviceGetDriverModel(Device) (DriverModel, DriverModel, Return)
|
||||||
|
DeviceGetDynamicPstatesInfo(Device) (GpuDynamicPstatesInfo, Return)
|
||||||
|
DeviceGetEccMode(Device) (EnableState, EnableState, Return)
|
||||||
|
DeviceGetEncoderCapacity(Device, EncoderType) (int, Return)
|
||||||
|
DeviceGetEncoderSessions(Device) ([]EncoderSessionInfo, Return)
|
||||||
|
DeviceGetEncoderStats(Device) (int, uint32, uint32, Return)
|
||||||
|
DeviceGetEncoderUtilization(Device) (uint32, uint32, Return)
|
||||||
|
DeviceGetEnforcedPowerLimit(Device) (uint32, Return)
|
||||||
|
DeviceGetFBCSessions(Device) ([]FBCSessionInfo, Return)
|
||||||
|
DeviceGetFBCStats(Device) (FBCStats, Return)
|
||||||
|
DeviceGetFanControlPolicy_v2(Device, int) (FanControlPolicy, Return)
|
||||||
|
DeviceGetFanSpeed(Device) (uint32, Return)
|
||||||
|
DeviceGetFanSpeed_v2(Device, int) (uint32, Return)
|
||||||
|
DeviceGetFieldValues(Device, []FieldValue) Return
|
||||||
|
DeviceGetGpcClkMinMaxVfOffset(Device) (int, int, Return)
|
||||||
|
DeviceGetGpcClkVfOffset(Device) (int, Return)
|
||||||
|
DeviceGetGpuFabricInfo(Device) (GpuFabricInfo, Return)
|
||||||
|
DeviceGetGpuInstanceById(Device, int) (GpuInstance, Return)
|
||||||
|
DeviceGetGpuInstanceId(Device) (int, Return)
|
||||||
|
DeviceGetGpuInstancePossiblePlacements(Device, *GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return)
|
||||||
|
DeviceGetGpuInstanceProfileInfo(Device, int) (GpuInstanceProfileInfo, Return)
|
||||||
|
DeviceGetGpuInstanceProfileInfoV(Device, int) GpuInstanceProfileInfoV
|
||||||
|
DeviceGetGpuInstanceRemainingCapacity(Device, *GpuInstanceProfileInfo) (int, Return)
|
||||||
|
DeviceGetGpuInstances(Device, *GpuInstanceProfileInfo) ([]GpuInstance, Return)
|
||||||
|
DeviceGetGpuMaxPcieLinkGeneration(Device) (int, Return)
|
||||||
|
DeviceGetGpuOperationMode(Device) (GpuOperationMode, GpuOperationMode, Return)
|
||||||
|
DeviceGetGraphicsRunningProcesses(Device) ([]ProcessInfo, Return)
|
||||||
|
DeviceGetGridLicensableFeatures(Device) (GridLicensableFeatures, Return)
|
||||||
|
DeviceGetGspFirmwareMode(Device) (bool, bool, Return)
|
||||||
|
DeviceGetGspFirmwareVersion(Device) (string, Return)
|
||||||
|
DeviceGetHandleByIndex(int) (Device, Return)
|
||||||
|
DeviceGetHandleByPciBusId(string) (Device, Return)
|
||||||
|
DeviceGetHandleBySerial(string) (Device, Return)
|
||||||
|
DeviceGetHandleByUUID(string) (Device, Return)
|
||||||
|
DeviceGetHostVgpuMode(Device) (HostVgpuMode, Return)
|
||||||
|
DeviceGetIndex(Device) (int, Return)
|
||||||
|
DeviceGetInforomConfigurationChecksum(Device) (uint32, Return)
|
||||||
|
DeviceGetInforomImageVersion(Device) (string, Return)
|
||||||
|
DeviceGetInforomVersion(Device, InforomObject) (string, Return)
|
||||||
|
DeviceGetIrqNum(Device) (int, Return)
|
||||||
|
DeviceGetMPSComputeRunningProcesses(Device) ([]ProcessInfo, Return)
|
||||||
|
DeviceGetMaxClockInfo(Device, ClockType) (uint32, Return)
|
||||||
|
DeviceGetMaxCustomerBoostClock(Device, ClockType) (uint32, Return)
|
||||||
|
DeviceGetMaxMigDeviceCount(Device) (int, Return)
|
||||||
|
DeviceGetMaxPcieLinkGeneration(Device) (int, Return)
|
||||||
|
DeviceGetMaxPcieLinkWidth(Device) (int, Return)
|
||||||
|
DeviceGetMemClkMinMaxVfOffset(Device) (int, int, Return)
|
||||||
|
DeviceGetMemClkVfOffset(Device) (int, Return)
|
||||||
|
DeviceGetMemoryAffinity(Device, int, AffinityScope) ([]uint, Return)
|
||||||
|
DeviceGetMemoryBusWidth(Device) (uint32, Return)
|
||||||
|
DeviceGetMemoryErrorCounter(Device, MemoryErrorType, EccCounterType, MemoryLocation) (uint64, Return)
|
||||||
|
DeviceGetMemoryInfo(Device) (Memory, Return)
|
||||||
|
DeviceGetMemoryInfo_v2(Device) (Memory_v2, Return)
|
||||||
|
DeviceGetMigDeviceHandleByIndex(Device, int) (Device, Return)
|
||||||
|
DeviceGetMigMode(Device) (int, int, Return)
|
||||||
|
DeviceGetMinMaxClockOfPState(Device, ClockType, Pstates) (uint32, uint32, Return)
|
||||||
|
DeviceGetMinMaxFanSpeed(Device) (int, int, Return)
|
||||||
|
DeviceGetMinorNumber(Device) (int, Return)
|
||||||
|
DeviceGetMultiGpuBoard(Device) (int, Return)
|
||||||
|
DeviceGetName(Device) (string, Return)
|
||||||
|
DeviceGetNumFans(Device) (int, Return)
|
||||||
|
DeviceGetNumGpuCores(Device) (int, Return)
|
||||||
|
DeviceGetNvLinkCapability(Device, int, NvLinkCapability) (uint32, Return)
|
||||||
|
DeviceGetNvLinkErrorCounter(Device, int, NvLinkErrorCounter) (uint64, Return)
|
||||||
|
DeviceGetNvLinkRemoteDeviceType(Device, int) (IntNvLinkDeviceType, Return)
|
||||||
|
DeviceGetNvLinkRemotePciInfo(Device, int) (PciInfo, Return)
|
||||||
|
DeviceGetNvLinkState(Device, int) (EnableState, Return)
|
||||||
|
DeviceGetNvLinkUtilizationControl(Device, int, int) (NvLinkUtilizationControl, Return)
|
||||||
|
DeviceGetNvLinkUtilizationCounter(Device, int, int) (uint64, uint64, Return)
|
||||||
|
DeviceGetNvLinkVersion(Device, int) (uint32, Return)
|
||||||
|
DeviceGetP2PStatus(Device, Device, GpuP2PCapsIndex) (GpuP2PStatus, Return)
|
||||||
|
DeviceGetPciInfo(Device) (PciInfo, Return)
|
||||||
|
DeviceGetPcieLinkMaxSpeed(Device) (uint32, Return)
|
||||||
|
DeviceGetPcieReplayCounter(Device) (int, Return)
|
||||||
|
DeviceGetPcieSpeed(Device) (int, Return)
|
||||||
|
DeviceGetPcieThroughput(Device, PcieUtilCounter) (uint32, Return)
|
||||||
|
DeviceGetPerformanceState(Device) (Pstates, Return)
|
||||||
|
DeviceGetPersistenceMode(Device) (EnableState, Return)
|
||||||
|
DeviceGetPgpuMetadataString(Device) (string, Return)
|
||||||
|
DeviceGetPowerManagementDefaultLimit(Device) (uint32, Return)
|
||||||
|
DeviceGetPowerManagementLimit(Device) (uint32, Return)
|
||||||
|
DeviceGetPowerManagementLimitConstraints(Device) (uint32, uint32, Return)
|
||||||
|
DeviceGetPowerManagementMode(Device) (EnableState, Return)
|
||||||
|
DeviceGetPowerSource(Device) (PowerSource, Return)
|
||||||
|
DeviceGetPowerState(Device) (Pstates, Return)
|
||||||
|
DeviceGetPowerUsage(Device) (uint32, Return)
|
||||||
|
DeviceGetProcessUtilization(Device, uint64) ([]ProcessUtilizationSample, Return)
|
||||||
|
DeviceGetRemappedRows(Device) (int, int, bool, bool, Return)
|
||||||
|
DeviceGetRetiredPages(Device, PageRetirementCause) ([]uint64, Return)
|
||||||
|
DeviceGetRetiredPagesPendingStatus(Device) (EnableState, Return)
|
||||||
|
DeviceGetRetiredPages_v2(Device, PageRetirementCause) ([]uint64, []uint64, Return)
|
||||||
|
DeviceGetRowRemapperHistogram(Device) (RowRemapperHistogramValues, Return)
|
||||||
|
DeviceGetSamples(Device, SamplingType, uint64) (ValueType, []Sample, Return)
|
||||||
|
DeviceGetSerial(Device) (string, Return)
|
||||||
|
DeviceGetSupportedClocksThrottleReasons(Device) (uint64, Return)
|
||||||
|
DeviceGetSupportedEventTypes(Device) (uint64, Return)
|
||||||
|
DeviceGetSupportedGraphicsClocks(Device, int) (int, uint32, Return)
|
||||||
|
DeviceGetSupportedMemoryClocks(Device) (int, uint32, Return)
|
||||||
|
DeviceGetSupportedPerformanceStates(Device) ([]Pstates, Return)
|
||||||
|
DeviceGetSupportedVgpus(Device) ([]VgpuTypeId, Return)
|
||||||
|
DeviceGetTargetFanSpeed(Device, int) (int, Return)
|
||||||
|
DeviceGetTemperature(Device, TemperatureSensors) (uint32, Return)
|
||||||
|
DeviceGetTemperatureThreshold(Device, TemperatureThresholds) (uint32, Return)
|
||||||
|
DeviceGetThermalSettings(Device, uint32) (GpuThermalSettings, Return)
|
||||||
|
DeviceGetTopologyCommonAncestor(Device, Device) (GpuTopologyLevel, Return)
|
||||||
|
DeviceGetTopologyNearestGpus(Device, GpuTopologyLevel) ([]Device, Return)
|
||||||
|
DeviceGetTotalEccErrors(Device, MemoryErrorType, EccCounterType) (uint64, Return)
|
||||||
|
DeviceGetTotalEnergyConsumption(Device) (uint64, Return)
|
||||||
|
DeviceGetUUID(Device) (string, Return)
|
||||||
|
DeviceGetUtilizationRates(Device) (Utilization, Return)
|
||||||
|
DeviceGetVbiosVersion(Device) (string, Return)
|
||||||
|
DeviceGetVgpuCapabilities(Device, DeviceVgpuCapability) (bool, Return)
|
||||||
|
DeviceGetVgpuMetadata(Device) (VgpuPgpuMetadata, Return)
|
||||||
|
DeviceGetVgpuProcessUtilization(Device, uint64) ([]VgpuProcessUtilizationSample, Return)
|
||||||
|
DeviceGetVgpuSchedulerCapabilities(Device) (VgpuSchedulerCapabilities, Return)
|
||||||
|
DeviceGetVgpuSchedulerLog(Device) (VgpuSchedulerLog, Return)
|
||||||
|
DeviceGetVgpuSchedulerState(Device) (VgpuSchedulerGetState, Return)
|
||||||
|
DeviceGetVgpuUtilization(Device, uint64) (ValueType, []VgpuInstanceUtilizationSample, Return)
|
||||||
|
DeviceGetViolationStatus(Device, PerfPolicyType) (ViolationTime, Return)
|
||||||
|
DeviceGetVirtualizationMode(Device) (GpuVirtualizationMode, Return)
|
||||||
|
DeviceIsMigDeviceHandle(Device) (bool, Return)
|
||||||
|
DeviceModifyDrainState(*PciInfo, EnableState) Return
|
||||||
|
DeviceOnSameBoard(Device, Device) (int, Return)
|
||||||
|
DeviceQueryDrainState(*PciInfo) (EnableState, Return)
|
||||||
|
DeviceRegisterEvents(Device, uint64, EventSet) Return
|
||||||
|
DeviceRemoveGpu(*PciInfo) Return
|
||||||
|
DeviceRemoveGpu_v2(*PciInfo, DetachGpuState, PcieLinkState) Return
|
||||||
|
DeviceResetApplicationsClocks(Device) Return
|
||||||
|
DeviceResetGpuLockedClocks(Device) Return
|
||||||
|
DeviceResetMemoryLockedClocks(Device) Return
|
||||||
|
DeviceResetNvLinkErrorCounters(Device, int) Return
|
||||||
|
DeviceResetNvLinkUtilizationCounter(Device, int, int) Return
|
||||||
|
DeviceSetAPIRestriction(Device, RestrictedAPI, EnableState) Return
|
||||||
|
DeviceSetAccountingMode(Device, EnableState) Return
|
||||||
|
DeviceSetApplicationsClocks(Device, uint32, uint32) Return
|
||||||
|
DeviceSetAutoBoostedClocksEnabled(Device, EnableState) Return
|
||||||
|
DeviceSetComputeMode(Device, ComputeMode) Return
|
||||||
|
DeviceSetCpuAffinity(Device) Return
|
||||||
|
DeviceSetDefaultAutoBoostedClocksEnabled(Device, EnableState, uint32) Return
|
||||||
|
DeviceSetDefaultFanSpeed_v2(Device, int) Return
|
||||||
|
DeviceSetDriverModel(Device, DriverModel, uint32) Return
|
||||||
|
DeviceSetEccMode(Device, EnableState) Return
|
||||||
|
DeviceSetFanControlPolicy(Device, int, FanControlPolicy) Return
|
||||||
|
DeviceSetFanSpeed_v2(Device, int, int) Return
|
||||||
|
DeviceSetGpcClkVfOffset(Device, int) Return
|
||||||
|
DeviceSetGpuLockedClocks(Device, uint32, uint32) Return
|
||||||
|
DeviceSetGpuOperationMode(Device, GpuOperationMode) Return
|
||||||
|
DeviceSetMemClkVfOffset(Device, int) Return
|
||||||
|
DeviceSetMemoryLockedClocks(Device, uint32, uint32) Return
|
||||||
|
DeviceSetMigMode(Device, int) (Return, Return)
|
||||||
|
DeviceSetNvLinkDeviceLowPowerThreshold(Device, *NvLinkPowerThres) Return
|
||||||
|
DeviceSetNvLinkUtilizationControl(Device, int, int, *NvLinkUtilizationControl, bool) Return
|
||||||
|
DeviceSetPersistenceMode(Device, EnableState) Return
|
||||||
|
DeviceSetPowerManagementLimit(Device, uint32) Return
|
||||||
|
DeviceSetTemperatureThreshold(Device, TemperatureThresholds, int) Return
|
||||||
|
DeviceSetVgpuSchedulerState(Device, *VgpuSchedulerSetState) Return
|
||||||
|
DeviceSetVirtualizationMode(Device, GpuVirtualizationMode) Return
|
||||||
|
DeviceValidateInforom(Device) Return
|
||||||
|
ErrorString(Return) string
|
||||||
|
EventSetCreate() (EventSet, Return)
|
||||||
|
EventSetFree(EventSet) Return
|
||||||
|
EventSetWait(EventSet, uint32) (EventData, Return)
|
||||||
|
Extensions() ExtendedInterface
|
||||||
|
GetExcludedDeviceCount() (int, Return)
|
||||||
|
GetExcludedDeviceInfoByIndex(int) (ExcludedDeviceInfo, Return)
|
||||||
|
GetVgpuCompatibility(*VgpuMetadata, *VgpuPgpuMetadata) (VgpuPgpuCompatibility, Return)
|
||||||
|
GetVgpuDriverCapabilities(VgpuDriverCapability) (bool, Return)
|
||||||
|
GetVgpuVersion() (VgpuVersion, VgpuVersion, Return)
|
||||||
|
GpmMetricsGet(*GpmMetricsGetType) Return
|
||||||
|
GpmMetricsGetV(*GpmMetricsGetType) GpmMetricsGetVType
|
||||||
|
GpmMigSampleGet(Device, int, GpmSample) Return
|
||||||
|
GpmQueryDeviceSupport(Device) (GpmSupport, Return)
|
||||||
|
GpmQueryDeviceSupportV(Device) GpmSupportV
|
||||||
|
GpmSampleAlloc() (GpmSample, Return)
|
||||||
|
GpmSampleFree(GpmSample) Return
|
||||||
|
GpmSampleGet(Device, GpmSample) Return
|
||||||
|
GpuInstanceCreateComputeInstance(GpuInstance, *ComputeInstanceProfileInfo) (ComputeInstance, Return)
|
||||||
|
GpuInstanceCreateComputeInstanceWithPlacement(GpuInstance, *ComputeInstanceProfileInfo, *ComputeInstancePlacement) (ComputeInstance, Return)
|
||||||
|
GpuInstanceDestroy(GpuInstance) Return
|
||||||
|
GpuInstanceGetComputeInstanceById(GpuInstance, int) (ComputeInstance, Return)
|
||||||
|
GpuInstanceGetComputeInstancePossiblePlacements(GpuInstance, *ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return)
|
||||||
|
GpuInstanceGetComputeInstanceProfileInfo(GpuInstance, int, int) (ComputeInstanceProfileInfo, Return)
|
||||||
|
GpuInstanceGetComputeInstanceProfileInfoV(GpuInstance, int, int) ComputeInstanceProfileInfoV
|
||||||
|
GpuInstanceGetComputeInstanceRemainingCapacity(GpuInstance, *ComputeInstanceProfileInfo) (int, Return)
|
||||||
|
GpuInstanceGetComputeInstances(GpuInstance, *ComputeInstanceProfileInfo) ([]ComputeInstance, Return)
|
||||||
|
GpuInstanceGetInfo(GpuInstance) (GpuInstanceInfo, Return)
|
||||||
|
Init() Return
|
||||||
|
InitWithFlags(uint32) Return
|
||||||
|
SetVgpuVersion(*VgpuVersion) Return
|
||||||
|
Shutdown() Return
|
||||||
|
SystemGetCudaDriverVersion() (int, Return)
|
||||||
|
SystemGetCudaDriverVersion_v2() (int, Return)
|
||||||
|
SystemGetDriverVersion() (string, Return)
|
||||||
|
SystemGetHicVersion() ([]HwbcEntry, Return)
|
||||||
|
SystemGetNVMLVersion() (string, Return)
|
||||||
|
SystemGetProcessName(int) (string, Return)
|
||||||
|
SystemGetTopologyGpuSet(int) ([]Device, Return)
|
||||||
|
UnitGetCount() (int, Return)
|
||||||
|
UnitGetDevices(Unit) ([]Device, Return)
|
||||||
|
UnitGetFanSpeedInfo(Unit) (UnitFanSpeeds, Return)
|
||||||
|
UnitGetHandleByIndex(int) (Unit, Return)
|
||||||
|
UnitGetLedState(Unit) (LedState, Return)
|
||||||
|
UnitGetPsuInfo(Unit) (PSUInfo, Return)
|
||||||
|
UnitGetTemperature(Unit, int) (uint32, Return)
|
||||||
|
UnitGetUnitInfo(Unit) (UnitInfo, Return)
|
||||||
|
UnitSetLedState(Unit, LedColor) Return
|
||||||
|
VgpuInstanceClearAccountingPids(VgpuInstance) Return
|
||||||
|
VgpuInstanceGetAccountingMode(VgpuInstance) (EnableState, Return)
|
||||||
|
VgpuInstanceGetAccountingPids(VgpuInstance) ([]int, Return)
|
||||||
|
VgpuInstanceGetAccountingStats(VgpuInstance, int) (AccountingStats, Return)
|
||||||
|
VgpuInstanceGetEccMode(VgpuInstance) (EnableState, Return)
|
||||||
|
VgpuInstanceGetEncoderCapacity(VgpuInstance) (int, Return)
|
||||||
|
VgpuInstanceGetEncoderSessions(VgpuInstance) (int, EncoderSessionInfo, Return)
|
||||||
|
VgpuInstanceGetEncoderStats(VgpuInstance) (int, uint32, uint32, Return)
|
||||||
|
VgpuInstanceGetFBCSessions(VgpuInstance) (int, FBCSessionInfo, Return)
|
||||||
|
VgpuInstanceGetFBCStats(VgpuInstance) (FBCStats, Return)
|
||||||
|
VgpuInstanceGetFbUsage(VgpuInstance) (uint64, Return)
|
||||||
|
VgpuInstanceGetFrameRateLimit(VgpuInstance) (uint32, Return)
|
||||||
|
VgpuInstanceGetGpuInstanceId(VgpuInstance) (int, Return)
|
||||||
|
VgpuInstanceGetGpuPciId(VgpuInstance) (string, Return)
|
||||||
|
VgpuInstanceGetLicenseInfo(VgpuInstance) (VgpuLicenseInfo, Return)
|
||||||
|
VgpuInstanceGetLicenseStatus(VgpuInstance) (int, Return)
|
||||||
|
VgpuInstanceGetMdevUUID(VgpuInstance) (string, Return)
|
||||||
|
VgpuInstanceGetMetadata(VgpuInstance) (VgpuMetadata, Return)
|
||||||
|
VgpuInstanceGetType(VgpuInstance) (VgpuTypeId, Return)
|
||||||
|
VgpuInstanceGetUUID(VgpuInstance) (string, Return)
|
||||||
|
VgpuInstanceGetVmDriverVersion(VgpuInstance) (string, Return)
|
||||||
|
VgpuInstanceGetVmID(VgpuInstance) (string, VgpuVmIdType, Return)
|
||||||
|
VgpuInstanceSetEncoderCapacity(VgpuInstance, int) Return
|
||||||
|
VgpuTypeGetCapabilities(VgpuTypeId, VgpuCapability) (bool, Return)
|
||||||
|
VgpuTypeGetClass(VgpuTypeId) (string, Return)
|
||||||
|
VgpuTypeGetDeviceID(VgpuTypeId) (uint64, uint64, Return)
|
||||||
|
VgpuTypeGetFrameRateLimit(VgpuTypeId) (uint32, Return)
|
||||||
|
VgpuTypeGetFramebufferSize(VgpuTypeId) (uint64, Return)
|
||||||
|
VgpuTypeGetGpuInstanceProfileId(VgpuTypeId) (uint32, Return)
|
||||||
|
VgpuTypeGetLicense(VgpuTypeId) (string, Return)
|
||||||
|
VgpuTypeGetMaxInstances(Device, VgpuTypeId) (int, Return)
|
||||||
|
VgpuTypeGetMaxInstancesPerVm(VgpuTypeId) (int, Return)
|
||||||
|
VgpuTypeGetName(VgpuTypeId) (string, Return)
|
||||||
|
VgpuTypeGetNumDisplayHeads(VgpuTypeId) (int, Return)
|
||||||
|
VgpuTypeGetResolution(VgpuTypeId, int) (uint32, uint32, Return)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Device represents the interface for the nvmlDevice type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/device.go -pkg mock . Device:Device
|
||||||
|
type Device interface {
|
||||||
|
CcuGetStreamState() (int, Return)
|
||||||
|
CcuSetStreamState(int) Return
|
||||||
|
ClearAccountingPids() Return
|
||||||
|
ClearCpuAffinity() Return
|
||||||
|
ClearEccErrorCounts(EccCounterType) Return
|
||||||
|
ClearFieldValues([]FieldValue) Return
|
||||||
|
CreateGpuInstance(*GpuInstanceProfileInfo) (GpuInstance, Return)
|
||||||
|
CreateGpuInstanceWithPlacement(*GpuInstanceProfileInfo, *GpuInstancePlacement) (GpuInstance, Return)
|
||||||
|
FreezeNvLinkUtilizationCounter(int, int, EnableState) Return
|
||||||
|
GetAPIRestriction(RestrictedAPI) (EnableState, Return)
|
||||||
|
GetAccountingBufferSize() (int, Return)
|
||||||
|
GetAccountingMode() (EnableState, Return)
|
||||||
|
GetAccountingPids() ([]int, Return)
|
||||||
|
GetAccountingStats(uint32) (AccountingStats, Return)
|
||||||
|
GetActiveVgpus() ([]VgpuInstance, Return)
|
||||||
|
GetAdaptiveClockInfoStatus() (uint32, Return)
|
||||||
|
GetApplicationsClock(ClockType) (uint32, Return)
|
||||||
|
GetArchitecture() (DeviceArchitecture, Return)
|
||||||
|
GetAttributes() (DeviceAttributes, Return)
|
||||||
|
GetAutoBoostedClocksEnabled() (EnableState, EnableState, Return)
|
||||||
|
GetBAR1MemoryInfo() (BAR1Memory, Return)
|
||||||
|
GetBoardId() (uint32, Return)
|
||||||
|
GetBoardPartNumber() (string, Return)
|
||||||
|
GetBrand() (BrandType, Return)
|
||||||
|
GetBridgeChipInfo() (BridgeChipHierarchy, Return)
|
||||||
|
GetBusType() (BusType, Return)
|
||||||
|
GetClkMonStatus() (ClkMonStatus, Return)
|
||||||
|
GetClock(ClockType, ClockId) (uint32, Return)
|
||||||
|
GetClockInfo(ClockType) (uint32, Return)
|
||||||
|
GetComputeInstanceId() (int, Return)
|
||||||
|
GetComputeMode() (ComputeMode, Return)
|
||||||
|
GetComputeRunningProcesses() ([]ProcessInfo, Return)
|
||||||
|
GetCpuAffinity(int) ([]uint, Return)
|
||||||
|
GetCpuAffinityWithinScope(int, AffinityScope) ([]uint, Return)
|
||||||
|
GetCreatableVgpus() ([]VgpuTypeId, Return)
|
||||||
|
GetCudaComputeCapability() (int, int, Return)
|
||||||
|
GetCurrPcieLinkGeneration() (int, Return)
|
||||||
|
GetCurrPcieLinkWidth() (int, Return)
|
||||||
|
GetCurrentClocksThrottleReasons() (uint64, Return)
|
||||||
|
GetDecoderUtilization() (uint32, uint32, Return)
|
||||||
|
GetDefaultApplicationsClock(ClockType) (uint32, Return)
|
||||||
|
GetDefaultEccMode() (EnableState, Return)
|
||||||
|
GetDetailedEccErrors(MemoryErrorType, EccCounterType) (EccErrorCounts, Return)
|
||||||
|
GetDeviceHandleFromMigDeviceHandle() (Device, Return)
|
||||||
|
GetDisplayActive() (EnableState, Return)
|
||||||
|
GetDisplayMode() (EnableState, Return)
|
||||||
|
GetDriverModel() (DriverModel, DriverModel, Return)
|
||||||
|
GetDynamicPstatesInfo() (GpuDynamicPstatesInfo, Return)
|
||||||
|
GetEccMode() (EnableState, EnableState, Return)
|
||||||
|
GetEncoderCapacity(EncoderType) (int, Return)
|
||||||
|
GetEncoderSessions() ([]EncoderSessionInfo, Return)
|
||||||
|
GetEncoderStats() (int, uint32, uint32, Return)
|
||||||
|
GetEncoderUtilization() (uint32, uint32, Return)
|
||||||
|
GetEnforcedPowerLimit() (uint32, Return)
|
||||||
|
GetFBCSessions() ([]FBCSessionInfo, Return)
|
||||||
|
GetFBCStats() (FBCStats, Return)
|
||||||
|
GetFanControlPolicy_v2(int) (FanControlPolicy, Return)
|
||||||
|
GetFanSpeed() (uint32, Return)
|
||||||
|
GetFanSpeed_v2(int) (uint32, Return)
|
||||||
|
GetFieldValues([]FieldValue) Return
|
||||||
|
GetGpcClkMinMaxVfOffset() (int, int, Return)
|
||||||
|
GetGpcClkVfOffset() (int, Return)
|
||||||
|
GetGpuFabricInfo() (GpuFabricInfo, Return)
|
||||||
|
GetGpuInstanceById(int) (GpuInstance, Return)
|
||||||
|
GetGpuInstanceId() (int, Return)
|
||||||
|
GetGpuInstancePossiblePlacements(*GpuInstanceProfileInfo) ([]GpuInstancePlacement, Return)
|
||||||
|
GetGpuInstanceProfileInfo(int) (GpuInstanceProfileInfo, Return)
|
||||||
|
GetGpuInstanceProfileInfoV(int) GpuInstanceProfileInfoV
|
||||||
|
GetGpuInstanceRemainingCapacity(*GpuInstanceProfileInfo) (int, Return)
|
||||||
|
GetGpuInstances(*GpuInstanceProfileInfo) ([]GpuInstance, Return)
|
||||||
|
GetGpuMaxPcieLinkGeneration() (int, Return)
|
||||||
|
GetGpuOperationMode() (GpuOperationMode, GpuOperationMode, Return)
|
||||||
|
GetGraphicsRunningProcesses() ([]ProcessInfo, Return)
|
||||||
|
GetGridLicensableFeatures() (GridLicensableFeatures, Return)
|
||||||
|
GetGspFirmwareMode() (bool, bool, Return)
|
||||||
|
GetGspFirmwareVersion() (string, Return)
|
||||||
|
GetHostVgpuMode() (HostVgpuMode, Return)
|
||||||
|
GetIndex() (int, Return)
|
||||||
|
GetInforomConfigurationChecksum() (uint32, Return)
|
||||||
|
GetInforomImageVersion() (string, Return)
|
||||||
|
GetInforomVersion(InforomObject) (string, Return)
|
||||||
|
GetIrqNum() (int, Return)
|
||||||
|
GetMPSComputeRunningProcesses() ([]ProcessInfo, Return)
|
||||||
|
GetMaxClockInfo(ClockType) (uint32, Return)
|
||||||
|
GetMaxCustomerBoostClock(ClockType) (uint32, Return)
|
||||||
|
GetMaxMigDeviceCount() (int, Return)
|
||||||
|
GetMaxPcieLinkGeneration() (int, Return)
|
||||||
|
GetMaxPcieLinkWidth() (int, Return)
|
||||||
|
GetMemClkMinMaxVfOffset() (int, int, Return)
|
||||||
|
GetMemClkVfOffset() (int, Return)
|
||||||
|
GetMemoryAffinity(int, AffinityScope) ([]uint, Return)
|
||||||
|
GetMemoryBusWidth() (uint32, Return)
|
||||||
|
GetMemoryErrorCounter(MemoryErrorType, EccCounterType, MemoryLocation) (uint64, Return)
|
||||||
|
GetMemoryInfo() (Memory, Return)
|
||||||
|
GetMemoryInfo_v2() (Memory_v2, Return)
|
||||||
|
GetMigDeviceHandleByIndex(int) (Device, Return)
|
||||||
|
GetMigMode() (int, int, Return)
|
||||||
|
GetMinMaxClockOfPState(ClockType, Pstates) (uint32, uint32, Return)
|
||||||
|
GetMinMaxFanSpeed() (int, int, Return)
|
||||||
|
GetMinorNumber() (int, Return)
|
||||||
|
GetMultiGpuBoard() (int, Return)
|
||||||
|
GetName() (string, Return)
|
||||||
|
GetNumFans() (int, Return)
|
||||||
|
GetNumGpuCores() (int, Return)
|
||||||
|
GetNvLinkCapability(int, NvLinkCapability) (uint32, Return)
|
||||||
|
GetNvLinkErrorCounter(int, NvLinkErrorCounter) (uint64, Return)
|
||||||
|
GetNvLinkRemoteDeviceType(int) (IntNvLinkDeviceType, Return)
|
||||||
|
GetNvLinkRemotePciInfo(int) (PciInfo, Return)
|
||||||
|
GetNvLinkState(int) (EnableState, Return)
|
||||||
|
GetNvLinkUtilizationControl(int, int) (NvLinkUtilizationControl, Return)
|
||||||
|
GetNvLinkUtilizationCounter(int, int) (uint64, uint64, Return)
|
||||||
|
GetNvLinkVersion(int) (uint32, Return)
|
||||||
|
GetP2PStatus(Device, GpuP2PCapsIndex) (GpuP2PStatus, Return)
|
||||||
|
GetPciInfo() (PciInfo, Return)
|
||||||
|
GetPcieLinkMaxSpeed() (uint32, Return)
|
||||||
|
GetPcieReplayCounter() (int, Return)
|
||||||
|
GetPcieSpeed() (int, Return)
|
||||||
|
GetPcieThroughput(PcieUtilCounter) (uint32, Return)
|
||||||
|
GetPerformanceState() (Pstates, Return)
|
||||||
|
GetPersistenceMode() (EnableState, Return)
|
||||||
|
GetPgpuMetadataString() (string, Return)
|
||||||
|
GetPowerManagementDefaultLimit() (uint32, Return)
|
||||||
|
GetPowerManagementLimit() (uint32, Return)
|
||||||
|
GetPowerManagementLimitConstraints() (uint32, uint32, Return)
|
||||||
|
GetPowerManagementMode() (EnableState, Return)
|
||||||
|
GetPowerSource() (PowerSource, Return)
|
||||||
|
GetPowerState() (Pstates, Return)
|
||||||
|
GetPowerUsage() (uint32, Return)
|
||||||
|
GetProcessUtilization(uint64) ([]ProcessUtilizationSample, Return)
|
||||||
|
GetRemappedRows() (int, int, bool, bool, Return)
|
||||||
|
GetRetiredPages(PageRetirementCause) ([]uint64, Return)
|
||||||
|
GetRetiredPagesPendingStatus() (EnableState, Return)
|
||||||
|
GetRetiredPages_v2(PageRetirementCause) ([]uint64, []uint64, Return)
|
||||||
|
GetRowRemapperHistogram() (RowRemapperHistogramValues, Return)
|
||||||
|
GetSamples(SamplingType, uint64) (ValueType, []Sample, Return)
|
||||||
|
GetSerial() (string, Return)
|
||||||
|
GetSupportedClocksThrottleReasons() (uint64, Return)
|
||||||
|
GetSupportedEventTypes() (uint64, Return)
|
||||||
|
GetSupportedGraphicsClocks(int) (int, uint32, Return)
|
||||||
|
GetSupportedMemoryClocks() (int, uint32, Return)
|
||||||
|
GetSupportedPerformanceStates() ([]Pstates, Return)
|
||||||
|
GetSupportedVgpus() ([]VgpuTypeId, Return)
|
||||||
|
GetTargetFanSpeed(int) (int, Return)
|
||||||
|
GetTemperature(TemperatureSensors) (uint32, Return)
|
||||||
|
GetTemperatureThreshold(TemperatureThresholds) (uint32, Return)
|
||||||
|
GetThermalSettings(uint32) (GpuThermalSettings, Return)
|
||||||
|
GetTopologyCommonAncestor(Device) (GpuTopologyLevel, Return)
|
||||||
|
GetTopologyNearestGpus(GpuTopologyLevel) ([]Device, Return)
|
||||||
|
GetTotalEccErrors(MemoryErrorType, EccCounterType) (uint64, Return)
|
||||||
|
GetTotalEnergyConsumption() (uint64, Return)
|
||||||
|
GetUUID() (string, Return)
|
||||||
|
GetUtilizationRates() (Utilization, Return)
|
||||||
|
GetVbiosVersion() (string, Return)
|
||||||
|
GetVgpuCapabilities(DeviceVgpuCapability) (bool, Return)
|
||||||
|
GetVgpuMetadata() (VgpuPgpuMetadata, Return)
|
||||||
|
GetVgpuProcessUtilization(uint64) ([]VgpuProcessUtilizationSample, Return)
|
||||||
|
GetVgpuSchedulerCapabilities() (VgpuSchedulerCapabilities, Return)
|
||||||
|
GetVgpuSchedulerLog() (VgpuSchedulerLog, Return)
|
||||||
|
GetVgpuSchedulerState() (VgpuSchedulerGetState, Return)
|
||||||
|
GetVgpuUtilization(uint64) (ValueType, []VgpuInstanceUtilizationSample, Return)
|
||||||
|
GetViolationStatus(PerfPolicyType) (ViolationTime, Return)
|
||||||
|
GetVirtualizationMode() (GpuVirtualizationMode, Return)
|
||||||
|
GpmMigSampleGet(int, GpmSample) Return
|
||||||
|
GpmQueryDeviceSupport() (GpmSupport, Return)
|
||||||
|
GpmQueryDeviceSupportV() GpmSupportV
|
||||||
|
GpmSampleGet(GpmSample) Return
|
||||||
|
IsMigDeviceHandle() (bool, Return)
|
||||||
|
OnSameBoard(Device) (int, Return)
|
||||||
|
RegisterEvents(uint64, EventSet) Return
|
||||||
|
ResetApplicationsClocks() Return
|
||||||
|
ResetGpuLockedClocks() Return
|
||||||
|
ResetMemoryLockedClocks() Return
|
||||||
|
ResetNvLinkErrorCounters(int) Return
|
||||||
|
ResetNvLinkUtilizationCounter(int, int) Return
|
||||||
|
SetAPIRestriction(RestrictedAPI, EnableState) Return
|
||||||
|
SetAccountingMode(EnableState) Return
|
||||||
|
SetApplicationsClocks(uint32, uint32) Return
|
||||||
|
SetAutoBoostedClocksEnabled(EnableState) Return
|
||||||
|
SetComputeMode(ComputeMode) Return
|
||||||
|
SetCpuAffinity() Return
|
||||||
|
SetDefaultAutoBoostedClocksEnabled(EnableState, uint32) Return
|
||||||
|
SetDefaultFanSpeed_v2(int) Return
|
||||||
|
SetDriverModel(DriverModel, uint32) Return
|
||||||
|
SetEccMode(EnableState) Return
|
||||||
|
SetFanControlPolicy(int, FanControlPolicy) Return
|
||||||
|
SetFanSpeed_v2(int, int) Return
|
||||||
|
SetGpcClkVfOffset(int) Return
|
||||||
|
SetGpuLockedClocks(uint32, uint32) Return
|
||||||
|
SetGpuOperationMode(GpuOperationMode) Return
|
||||||
|
SetMemClkVfOffset(int) Return
|
||||||
|
SetMemoryLockedClocks(uint32, uint32) Return
|
||||||
|
SetMigMode(int) (Return, Return)
|
||||||
|
SetNvLinkDeviceLowPowerThreshold(*NvLinkPowerThres) Return
|
||||||
|
SetNvLinkUtilizationControl(int, int, *NvLinkUtilizationControl, bool) Return
|
||||||
|
SetPersistenceMode(EnableState) Return
|
||||||
|
SetPowerManagementLimit(uint32) Return
|
||||||
|
SetTemperatureThreshold(TemperatureThresholds, int) Return
|
||||||
|
SetVgpuSchedulerState(*VgpuSchedulerSetState) Return
|
||||||
|
SetVirtualizationMode(GpuVirtualizationMode) Return
|
||||||
|
ValidateInforom() Return
|
||||||
|
VgpuTypeGetMaxInstances(VgpuTypeId) (int, Return)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GpuInstance represents the interface for the nvmlGpuInstance type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/gpuinstance.go -pkg mock . GpuInstance:GpuInstance
|
||||||
|
type GpuInstance interface {
|
||||||
|
CreateComputeInstance(*ComputeInstanceProfileInfo) (ComputeInstance, Return)
|
||||||
|
CreateComputeInstanceWithPlacement(*ComputeInstanceProfileInfo, *ComputeInstancePlacement) (ComputeInstance, Return)
|
||||||
|
Destroy() Return
|
||||||
|
GetComputeInstanceById(int) (ComputeInstance, Return)
|
||||||
|
GetComputeInstancePossiblePlacements(*ComputeInstanceProfileInfo) ([]ComputeInstancePlacement, Return)
|
||||||
|
GetComputeInstanceProfileInfo(int, int) (ComputeInstanceProfileInfo, Return)
|
||||||
|
GetComputeInstanceProfileInfoV(int, int) ComputeInstanceProfileInfoV
|
||||||
|
GetComputeInstanceRemainingCapacity(*ComputeInstanceProfileInfo) (int, Return)
|
||||||
|
GetComputeInstances(*ComputeInstanceProfileInfo) ([]ComputeInstance, Return)
|
||||||
|
GetInfo() (GpuInstanceInfo, Return)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ComputeInstance represents the interface for the nvmlComputeInstance type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/computeinstance.go -pkg mock . ComputeInstance:ComputeInstance
|
||||||
|
type ComputeInstance interface {
|
||||||
|
Destroy() Return
|
||||||
|
GetInfo() (ComputeInstanceInfo, Return)
|
||||||
|
}
|
||||||
|
|
||||||
|
// EventSet represents the interface for the nvmlEventSet type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/eventset.go -pkg mock . EventSet:EventSet
|
||||||
|
type EventSet interface {
|
||||||
|
Free() Return
|
||||||
|
Wait(uint32) (EventData, Return)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GpmSample represents the interface for the nvmlGpmSample type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/gpmsample.go -pkg mock . GpmSample:GpmSample
|
||||||
|
type GpmSample interface {
|
||||||
|
Free() Return
|
||||||
|
Get(Device) Return
|
||||||
|
MigGet(Device, int) Return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unit represents the interface for the nvmlUnit type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/unit.go -pkg mock . Unit:Unit
|
||||||
|
type Unit interface {
|
||||||
|
GetDevices() ([]Device, Return)
|
||||||
|
GetFanSpeedInfo() (UnitFanSpeeds, Return)
|
||||||
|
GetLedState() (LedState, Return)
|
||||||
|
GetPsuInfo() (PSUInfo, Return)
|
||||||
|
GetTemperature(int) (uint32, Return)
|
||||||
|
GetUnitInfo() (UnitInfo, Return)
|
||||||
|
SetLedState(LedColor) Return
|
||||||
|
}
|
||||||
|
|
||||||
|
// VgpuInstance represents the interface for the nvmlVgpuInstance type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/vgpuinstance.go -pkg mock . VgpuInstance:VgpuInstance
|
||||||
|
type VgpuInstance interface {
|
||||||
|
ClearAccountingPids() Return
|
||||||
|
GetAccountingMode() (EnableState, Return)
|
||||||
|
GetAccountingPids() ([]int, Return)
|
||||||
|
GetAccountingStats(int) (AccountingStats, Return)
|
||||||
|
GetEccMode() (EnableState, Return)
|
||||||
|
GetEncoderCapacity() (int, Return)
|
||||||
|
GetEncoderSessions() (int, EncoderSessionInfo, Return)
|
||||||
|
GetEncoderStats() (int, uint32, uint32, Return)
|
||||||
|
GetFBCSessions() (int, FBCSessionInfo, Return)
|
||||||
|
GetFBCStats() (FBCStats, Return)
|
||||||
|
GetFbUsage() (uint64, Return)
|
||||||
|
GetFrameRateLimit() (uint32, Return)
|
||||||
|
GetGpuInstanceId() (int, Return)
|
||||||
|
GetGpuPciId() (string, Return)
|
||||||
|
GetLicenseInfo() (VgpuLicenseInfo, Return)
|
||||||
|
GetLicenseStatus() (int, Return)
|
||||||
|
GetMdevUUID() (string, Return)
|
||||||
|
GetMetadata() (VgpuMetadata, Return)
|
||||||
|
GetType() (VgpuTypeId, Return)
|
||||||
|
GetUUID() (string, Return)
|
||||||
|
GetVmDriverVersion() (string, Return)
|
||||||
|
GetVmID() (string, VgpuVmIdType, Return)
|
||||||
|
SetEncoderCapacity(int) Return
|
||||||
|
}
|
||||||
|
|
||||||
|
// VgpuTypeId represents the interface for the nvmlVgpuTypeId type.
|
||||||
|
//
|
||||||
|
//go:generate moq -out mock/vgputypeid.go -pkg mock . VgpuTypeId:VgpuTypeId
|
||||||
|
type VgpuTypeId interface {
|
||||||
|
GetCapabilities(VgpuCapability) (bool, Return)
|
||||||
|
GetClass() (string, Return)
|
||||||
|
GetDeviceID() (uint64, uint64, Return)
|
||||||
|
GetFrameRateLimit() (uint32, Return)
|
||||||
|
GetFramebufferSize() (uint64, Return)
|
||||||
|
GetGpuInstanceProfileId() (uint32, Return)
|
||||||
|
GetLicense() (string, Return)
|
||||||
|
GetMaxInstances(Device) (int, Return)
|
||||||
|
GetMaxInstancesPerVm() (int, Return)
|
||||||
|
GetName() (string, Return)
|
||||||
|
GetNumDisplayHeads() (int, Return)
|
||||||
|
GetResolution(int) (uint32, uint32, Return)
|
||||||
|
}
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -7,7 +7,7 @@ github.com/NVIDIA/go-nvlib/pkg/nvpci
|
|||||||
github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes
|
github.com/NVIDIA/go-nvlib/pkg/nvpci/bytes
|
||||||
github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio
|
github.com/NVIDIA/go-nvlib/pkg/nvpci/mmio
|
||||||
github.com/NVIDIA/go-nvlib/pkg/pciids
|
github.com/NVIDIA/go-nvlib/pkg/pciids
|
||||||
# github.com/NVIDIA/go-nvml v0.12.0-3
|
# github.com/NVIDIA/go-nvml v0.12.0-4
|
||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
github.com/NVIDIA/go-nvml/pkg/dl
|
github.com/NVIDIA/go-nvml/pkg/dl
|
||||||
github.com/NVIDIA/go-nvml/pkg/nvml
|
github.com/NVIDIA/go-nvml/pkg/nvml
|
||||||
|
Loading…
Reference in New Issue
Block a user