ixml

package
v0.0.0-...-8cae99c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package IXML Bindings

Index

Constants

View Source
const (
	// GPM_METRICS_GET_VERSION as defined in ixml/api.h:400
	GPM_METRICS_GET_VERSION = 1
	// GPM_SUPPORT_VERSION as defined in ixml/api.h:411
	GPM_SUPPORT_VERSION = 1
	// DEVICE_UUID_BUFFER_SIZE as defined in ixml/api.h:415
	DEVICE_UUID_BUFFER_SIZE = 80
	// SYSTEM_DRIVER_VERSION_BUFFER_SIZE as defined in ixml/api.h:420
	SYSTEM_DRIVER_VERSION_BUFFER_SIZE = 80
	// DEVICE_NAME_BUFFER_SIZE as defined in ixml/api.h:425
	DEVICE_NAME_BUFFER_SIZE = 64
	// DEVICE_NAME_V2_BUFFER_SIZE as defined in ixml/api.h:430
	DEVICE_NAME_V2_BUFFER_SIZE = 96
	// DEVICE_PCI_BUS_ID_BUFFER_SIZE as defined in ixml/api.h:435
	DEVICE_PCI_BUS_ID_BUFFER_SIZE = 32
	// DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE as defined in ixml/api.h:440
	DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE = 16
	// HealthSYSHUBError as defined in ixml/api.h:442
	HealthSYSHUBError = int64(0x0000000000000001)
	// HealthMCError as defined in ixml/api.h:443
	HealthMCError = int64(0x0000000000000002)
	// HealthOverTempError as defined in ixml/api.h:444
	HealthOverTempError = int64(0x0000000000000004)
	// HealthOverVoltageError as defined in ixml/api.h:445
	HealthOverVoltageError = int64(0x0000000000000008)
	// HealthECCError as defined in ixml/api.h:446
	HealthECCError = int64(0x0000000000000010)
	// HealthMemoryError as defined in ixml/api.h:447
	HealthMemoryError = int64(0x0000000000000020)
	// HealthPCIEError as defined in ixml/api.h:448
	HealthPCIEError = int64(0x0000000000000040)
	// HealthOK as defined in ixml/api.h:449
	HealthOK = int64(0x0000000000000000)
	// NO_UNVERSIONED_FUNC_DEFS as defined in go-ixml/<predefined>:349
	NO_UNVERSIONED_FUNC_DEFS = 1
)

Variables

This section is empty.

Functions

func GetHandleByUUID

func GetHandleByUUID(Uuid string) (Device, Return)

func GpmSampleAlloc

func GpmSampleAlloc() (GpmSample, Return)

Types

type ClockInfo

type ClockInfo struct {
	Sm  uint32
	Mem uint32
}

type ClockType

type ClockType int32

ClockType as declared in ixml/api.h:217

const (
	CLOCK_GRAPHICS ClockType = iota
	CLOCK_SM       ClockType = 1
	CLOCK_MEM      ClockType = 2
	CLOCK_VIDEO    ClockType = 3
	CLOCK_COUNT    ClockType = 4
)

ClockType enumeration from ixml/api.h:217

type Device

type Device struct {
	Handle *_Ctype_struct_nvmlDevice_st
}

func NewDevice

func NewDevice() *Device

NewDevice allocates a new C object of this type and converts the reference into a raw struct reference without wrapping.

func NewDeviceRef

func NewDeviceRef(ref unsafe.Pointer) *Device

NewDeviceRef converts the C object reference into a raw struct reference without wrapping.

func (*Device) Free

func (x *Device) Free()

Free cleanups the referenced memory using C free.

func (Device) GetBoardPosition

func (device Device) GetBoardPosition() (uint32, Return)

func (Device) GetClockInfo

func (device Device) GetClockInfo() (ClockInfo, Return)

func (Device) GetComputeRunningProcesses

func (device Device) GetComputeRunningProcesses() ([]Info, Return)

func (Device) GetCurrentClocksThrottleReasons

func (device Device) GetCurrentClocksThrottleReasons() (uint64, Return)

func (Device) GetEccErros

func (device Device) GetEccErros() (uint32, uint32, Return)

func (Device) GetFanSpeed

func (device Device) GetFanSpeed() (uint32, Return)

func (Device) GetFanSpeed_v2

func (device Device) GetFanSpeed_v2(Fan int) (uint32, Return)

func (Device) GetGPUVoltage

func (device Device) GetGPUVoltage() (uint32, uint32, Return)

func (Device) GetHealth

func (device Device) GetHealth() (uint64, Return)

func (Device) GetIndex

func (device Device) GetIndex() (int, Return)

func (Device) GetMemoryInfo

func (device Device) GetMemoryInfo() (Memory, Return)

func (Device) GetMemoryInfo_v2

func (device Device) GetMemoryInfo_v2() (Memory, Return)

func (Device) GetMinorNumber

func (device Device) GetMinorNumber() (int, Return)

func (Device) GetName

func (device Device) GetName() (string, Return)

func (Device) GetPciInfo

func (device Device) GetPciInfo() (PciInfo, Return)

func (Device) GetPcieReplayCounter

func (device Device) GetPcieReplayCounter() (uint32, Return)

func (Device) GetPowerManagementDefaultLimit

func (device Device) GetPowerManagementDefaultLimit() (uint32, Return)

func (Device) GetPowerManagementLimit

func (device Device) GetPowerManagementLimit() (uint32, Return)

func (Device) GetPowerManagementLimitConstraints

func (device Device) GetPowerManagementLimitConstraints() (uint32, uint32, Return)

func (Device) GetPowerUsage

func (device Device) GetPowerUsage() (uint32, Return)

func (Device) GetTemperature

func (device Device) GetTemperature() (uint32, Return)

func (Device) GetTemperatureThreshold

func (device Device) GetTemperatureThreshold(thresholdType TemperatureThresholds) (uint32, Return)

func (Device) GetTopology

func (device Device) GetTopology(device2 Device) (GpuTopologyLevel, Return)

func (Device) GetUUID

func (device Device) GetUUID() (string, Return)

func (Device) GetUtilizationRates

func (device Device) GetUtilizationRates() (Utilization, Return)

func (Device) GpmQueryDeviceSupport

func (device Device) GpmQueryDeviceSupport() (GpmSupport, Return)

func (Device) GpmSampleGet

func (device Device) GpmSampleGet(gpmSample GpmSample) Return

func (*Device) PassRef

func (x *Device) PassRef() *C.nvmlDevice_t

PassRef returns a reference to C object as it is or allocates a new C object of this type.

func (*Device) Ref

func (x *Device) Ref() *C.nvmlDevice_t

Ref returns a reference to C object as it is.

type EventSet

type EventSet struct {
	Handle *_Ctype_struct_nvmlEventSet_st
}

func NewEventSet

func NewEventSet() *EventSet

NewEventSet allocates a new C object of this type and converts the reference into a raw struct reference without wrapping.

func NewEventSetRef

func NewEventSetRef(ref unsafe.Pointer) *EventSet

NewEventSetRef converts the C object reference into a raw struct reference without wrapping.

func (*EventSet) Free

func (x *EventSet) Free()

Free cleanups the referenced memory using C free.

func (*EventSet) PassRef

func (x *EventSet) PassRef() *C.nvmlEventSet_t

PassRef returns a reference to C object as it is or allocates a new C object of this type.

func (*EventSet) Ref

func (x *EventSet) Ref() *C.nvmlEventSet_t

Ref returns a reference to C object as it is.

type GpmMetric

type GpmMetric struct {
	MetricId   uint32
	NvmlReturn uint32
	Value      float64
	MetricInfo _Ctype_struct___3
}

type GpmMetricId

type GpmMetricId int32

GpmMetricId as declared in ixml/api.h:345

const (
	GPM_METRIC_GRAPHICS_UTIL           GpmMetricId = 1
	GPM_METRIC_SM_UTIL                 GpmMetricId = 2
	GPM_METRIC_SM_OCCUPANCY            GpmMetricId = 3
	GPM_METRIC_INTEGER_UTIL            GpmMetricId = 4
	GPM_METRIC_ANY_TENSOR_UTIL         GpmMetricId = 5
	GPM_METRIC_DFMA_TENSOR_UTIL        GpmMetricId = 6
	GPM_METRIC_HMMA_TENSOR_UTIL        GpmMetricId = 7
	GPM_METRIC_IMMA_TENSOR_UTIL        GpmMetricId = 9
	GPM_METRIC_DRAM_BW_UTIL            GpmMetricId = 10
	GPM_METRIC_FP64_UTIL               GpmMetricId = 11
	GPM_METRIC_FP32_UTIL               GpmMetricId = 12
	GPM_METRIC_FP16_UTIL               GpmMetricId = 13
	GPM_METRIC_PCIE_TX_PER_SEC         GpmMetricId = 20
	GPM_METRIC_PCIE_RX_PER_SEC         GpmMetricId = 21
	GPM_METRIC_NVDEC_0_UTIL            GpmMetricId = 30
	GPM_METRIC_NVDEC_1_UTIL            GpmMetricId = 31
	GPM_METRIC_NVDEC_2_UTIL            GpmMetricId = 32
	GPM_METRIC_NVDEC_3_UTIL            GpmMetricId = 33
	GPM_METRIC_NVDEC_4_UTIL            GpmMetricId = 34
	GPM_METRIC_NVDEC_5_UTIL            GpmMetricId = 35
	GPM_METRIC_NVDEC_6_UTIL            GpmMetricId = 36
	GPM_METRIC_NVDEC_7_UTIL            GpmMetricId = 37
	GPM_METRIC_NVJPG_0_UTIL            GpmMetricId = 40
	GPM_METRIC_NVJPG_1_UTIL            GpmMetricId = 41
	GPM_METRIC_NVJPG_2_UTIL            GpmMetricId = 42
	GPM_METRIC_NVJPG_3_UTIL            GpmMetricId = 43
	GPM_METRIC_NVJPG_4_UTIL            GpmMetricId = 44
	GPM_METRIC_NVJPG_5_UTIL            GpmMetricId = 45
	GPM_METRIC_NVJPG_6_UTIL            GpmMetricId = 46
	GPM_METRIC_NVJPG_7_UTIL            GpmMetricId = 47
	GPM_METRIC_NVOFA_0_UTIL            GpmMetricId = 50
	GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC GpmMetricId = 60
	GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC GpmMetricId = 61
	GPM_METRIC_NVLINK_L0_RX_PER_SEC    GpmMetricId = 62
	GPM_METRIC_NVLINK_L0_TX_PER_SEC    GpmMetricId = 63
	GPM_METRIC_NVLINK_L1_RX_PER_SEC    GpmMetricId = 64
	GPM_METRIC_NVLINK_L1_TX_PER_SEC    GpmMetricId = 65
	GPM_METRIC_NVLINK_L2_RX_PER_SEC    GpmMetricId = 66
	GPM_METRIC_NVLINK_L2_TX_PER_SEC    GpmMetricId = 67
	GPM_METRIC_NVLINK_L3_RX_PER_SEC    GpmMetricId = 68
	GPM_METRIC_NVLINK_L3_TX_PER_SEC    GpmMetricId = 69
	GPM_METRIC_NVLINK_L4_RX_PER_SEC    GpmMetricId = 70
	GPM_METRIC_NVLINK_L4_TX_PER_SEC    GpmMetricId = 71
	GPM_METRIC_NVLINK_L5_RX_PER_SEC    GpmMetricId = 72
	GPM_METRIC_NVLINK_L5_TX_PER_SEC    GpmMetricId = 73
	GPM_METRIC_NVLINK_L6_RX_PER_SEC    GpmMetricId = 74
	GPM_METRIC_NVLINK_L6_TX_PER_SEC    GpmMetricId = 75
	GPM_METRIC_NVLINK_L7_RX_PER_SEC    GpmMetricId = 76
	GPM_METRIC_NVLINK_L7_TX_PER_SEC    GpmMetricId = 77
	GPM_METRIC_NVLINK_L8_RX_PER_SEC    GpmMetricId = 78
	GPM_METRIC_NVLINK_L8_TX_PER_SEC    GpmMetricId = 79
	GPM_METRIC_NVLINK_L9_RX_PER_SEC    GpmMetricId = 80
	GPM_METRIC_NVLINK_L9_TX_PER_SEC    GpmMetricId = 81
	GPM_METRIC_NVLINK_L10_RX_PER_SEC   GpmMetricId = 82
	GPM_METRIC_NVLINK_L10_TX_PER_SEC   GpmMetricId = 83
	GPM_METRIC_NVLINK_L11_RX_PER_SEC   GpmMetricId = 84
	GPM_METRIC_NVLINK_L11_TX_PER_SEC   GpmMetricId = 85
	GPM_METRIC_NVLINK_L12_RX_PER_SEC   GpmMetricId = 86
	GPM_METRIC_NVLINK_L12_TX_PER_SEC   GpmMetricId = 87
	GPM_METRIC_NVLINK_L13_RX_PER_SEC   GpmMetricId = 88
	GPM_METRIC_NVLINK_L13_TX_PER_SEC   GpmMetricId = 89
	GPM_METRIC_NVLINK_L14_RX_PER_SEC   GpmMetricId = 90
	GPM_METRIC_NVLINK_L14_TX_PER_SEC   GpmMetricId = 91
	GPM_METRIC_NVLINK_L15_RX_PER_SEC   GpmMetricId = 92
	GPM_METRIC_NVLINK_L15_TX_PER_SEC   GpmMetricId = 93
	GPM_METRIC_NVLINK_L16_RX_PER_SEC   GpmMetricId = 94
	GPM_METRIC_NVLINK_L16_TX_PER_SEC   GpmMetricId = 95
	GPM_METRIC_NVLINK_L17_RX_PER_SEC   GpmMetricId = 96
	GPM_METRIC_NVLINK_L17_TX_PER_SEC   GpmMetricId = 97
	GPM_METRIC_MAX                     GpmMetricId = 98
)

GpmMetricId enumeration from ixml/api.h:345

type GpmMetricsGetType

type GpmMetricsGetType struct {
	Version    uint32
	NumMetrics uint32
	Sample1    GpmSample
	Sample2    GpmSample
	Metrics    [98]GpmMetric
}

GpmMetricsGetType includes interface types for GpmSample instead of nvmlGpmSample

type GpmSample

type GpmSample struct {
	Handle *_Ctype_struct_nvmlGpmSample_st
}

func (GpmSample) Free

func (gpmSample GpmSample) Free() Return

func (GpmSample) Get

func (gpmSample GpmSample) Get(device Device) Return

type GpmSupport

type GpmSupport struct {
	Version           uint32
	IsSupportedDevice uint32
}

type GpuTopologyLevel

type GpuTopologyLevel int32

GpuTopologyLevel as declared in ixml/api.h:256

const (
	TOPOLOGY_INTERNAL   GpuTopologyLevel = iota
	TOPOLOGY_SINGLE     GpuTopologyLevel = 10
	TOPOLOGY_MULTIPLE   GpuTopologyLevel = 20
	TOPOLOGY_HOSTBRIDGE GpuTopologyLevel = 30
	TOPOLOGY_NODE       GpuTopologyLevel = 40
	TOPOLOGY_SYSTEM     GpuTopologyLevel = 50
)

GpuTopologyLevel enumeration from ixml/api.h:256

type Info

type Info struct {
	Pid           uint32
	Name          string
	UsedGpuMemory uint64
}

type Memory

type Memory struct {
	Total uint64
	Free  uint64
	Used  uint64
}

func NewMemory

func NewMemory() *Memory

NewMemory allocates a new C object of this type and converts the reference into a raw struct reference without wrapping.

func NewMemoryRef

func NewMemoryRef(ref unsafe.Pointer) *Memory

NewMemoryRef converts the C object reference into a raw struct reference without wrapping.

func (*Memory) PassRef

func (x *Memory) PassRef() *C.nvmlMemory_t

PassRef returns a reference to C object as it is or allocates a new C object of this type.

func (*Memory) Ref

func (x *Memory) Ref() *C.nvmlMemory_t

Ref returns a reference to C object as it is.

type Memory_v2

type Memory_v2 struct {
	Version  uint32
	Total    uint64
	Reserved uint64
	Free     uint64
	Used     uint64
}

func NewMemory_v2

func NewMemory_v2() *Memory_v2

NewMemory_v2 allocates a new C object of this type and converts the reference into a raw struct reference without wrapping.

func NewMemory_v2Ref

func NewMemory_v2Ref(ref unsafe.Pointer) *Memory_v2

NewMemory_v2Ref converts the C object reference into a raw struct reference without wrapping.

func (*Memory_v2) PassRef

func (x *Memory_v2) PassRef() *C.nvmlMemory_v2_t

PassRef returns a reference to C object as it is or allocates a new C object of this type.

func (*Memory_v2) Ref

func (x *Memory_v2) Ref() *C.nvmlMemory_v2_t

Ref returns a reference to C object as it is.

type PciInfo

type PciInfo struct {
	BusIdLegacy    [16]int8
	Domain         uint32
	Bus            uint32
	Device         uint32
	PciDeviceId    uint32
	PciSubSystemId uint32
	BusId          [32]int8
}

func NewPciInfo

func NewPciInfo() *PciInfo

NewPciInfo allocates a new C object of this type and converts the reference into a raw struct reference without wrapping.

func NewPciInfoRef

func NewPciInfoRef(ref unsafe.Pointer) *PciInfo

NewPciInfoRef converts the C object reference into a raw struct reference without wrapping.

func (*PciInfo) Free

func (x *PciInfo) Free()

Free cleanups the referenced memory using C free.

func (*PciInfo) PassRef

func (x *PciInfo) PassRef() *C.nvmlPciInfo_t

PassRef returns a reference to C object as it is or allocates a new C object of this type.

func (*PciInfo) Ref

func (x *PciInfo) Ref() *C.nvmlPciInfo_t

Ref returns a reference to C object as it is.

type ProcessInfo

type ProcessInfo struct {
	Pid                      uint32
	UsedGpuMemory            uint64
	GpuInstanceId            uint32
	ComputeInstanceId        uint32
	UsedGpuCcProtectedMemory uint64
}

type ProcessInfo_v1

type ProcessInfo_v1 struct {
	Pid           uint32
	UsedGpuMemory uint64
}

type Return

type Return int32

Return as declared in ixml/api.h:129

const (
	SUCCESS                         Return = iota
	ERROR_UNINITIALIZED             Return = 1
	ERROR_INVALID_ARGUMENT          Return = 2
	ERROR_NOT_SUPPORTED             Return = 3
	ERROR_NO_PERMISSION             Return = 4
	ERROR_ALREADY_INITIALIZED       Return = 5
	ERROR_NOT_FOUND                 Return = 6
	ERROR_INSUFFICIENT_SIZE         Return = 7
	ERROR_INSUFFICIENT_POWER        Return = 8
	ERROR_DRIVER_NOT_LOADED         Return = 9
	ERROR_TIMEOUT                   Return = 10
	ERROR_IRQ_ISSUE                 Return = 11
	ERROR_LIBRARY_NOT_FOUND         Return = 12
	ERROR_FUNCTION_NOT_FOUND        Return = 13
	ERROR_CORRUPTED_INFOROM         Return = 14
	ERROR_GPU_IS_LOST               Return = 15
	ERROR_RESET_REQUIRED            Return = 16
	ERROR_OPERATING_SYSTEM          Return = 17
	ERROR_LIB_RM_VERSION_MISMATCH   Return = 18
	ERROR_IN_USE                    Return = 19
	ERROR_MEMORY                    Return = 20
	ERROR_NO_DATA                   Return = 21
	ERROR_VGPU_ECC_NOT_SUPPORTED    Return = 22
	ERROR_INSUFFICIENT_RESOURCES    Return = 23
	ERROR_FREQ_NOT_SUPPORTED        Return = 24
	ERROR_ARGUMENT_VERSION_MISMATCH Return = 25
	ERROR_UNKNOWN                   Return = 999
)

Return enumeration from ixml/api.h:129

func AbsInit

func AbsInit(path string) Return

func DeviceGetCount

func DeviceGetCount() (uint, Return)

func DeviceGetHandleByIndex

func DeviceGetHandleByIndex(Index uint, device *Device) Return

func DeviceGetPowerManagementDefaultLimit

func DeviceGetPowerManagementDefaultLimit(device Device) (uint32, Return)

func DeviceGetPowerManagementLimit

func DeviceGetPowerManagementLimit(device Device) (uint32, Return)

func DeviceGetPowerManagementLimitConstraints

func DeviceGetPowerManagementLimitConstraints(device Device) (uint32, uint32, Return)

func DeviceGetTemperatureThreshold

func DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThresholds) (uint32, Return)

func GetOnSameBoard

func GetOnSameBoard(device1, device2 Device) (int, Return)

func GpmMetricsGet

func GpmMetricsGet(metricsGet *GpmMetricsGetType) Return

func Init

func Init() Return

ixml_init()

func Shutdown

func Shutdown() Return

ixml_shutdown()

func SystemGetCudaDriverVersion

func SystemGetCudaDriverVersion() (string, Return)

func SystemGetCudaDriverVersion_v2

func SystemGetCudaDriverVersion_v2() (string, Return)

func SystemGetDriverVersion

func SystemGetDriverVersion() (string, Return)

type TemperatureSensors

type TemperatureSensors int32

TemperatureSensors as declared in ixml/api.h:201

const (
	TEMPERATURE_GPU   TemperatureSensors = iota
	TEMPERATURE_COUNT TemperatureSensors = 1
)

TemperatureSensors enumeration from ixml/api.h:201

type TemperatureThresholds

type TemperatureThresholds int32

TemperatureThresholds as declared in ixml/api.h:190

const (
	TEMPERATURE_THRESHOLD_SHUTDOWN      TemperatureThresholds = iota
	TEMPERATURE_THRESHOLD_SLOWDOWN      TemperatureThresholds = 1
	TEMPERATURE_THRESHOLD_MEM_MAX       TemperatureThresholds = 2
	TEMPERATURE_THRESHOLD_GPU_MAX       TemperatureThresholds = 3
	TEMPERATURE_THRESHOLD_ACOUSTIC_MIN  TemperatureThresholds = 4
	TEMPERATURE_THRESHOLD_ACOUSTIC_CURR TemperatureThresholds = 5
	TEMPERATURE_THRESHOLD_ACOUSTIC_MAX  TemperatureThresholds = 6
	TEMPERATURE_THRESHOLD_COUNT         TemperatureThresholds = 7
)

TemperatureThresholds enumeration from ixml/api.h:190

type Utilization

type Utilization struct {
	Gpu    uint32
	Memory uint32
}

func NewUtilization

func NewUtilization() *Utilization

NewUtilization allocates a new C object of this type and converts the reference into a raw struct reference without wrapping.

func NewUtilizationRef

func NewUtilizationRef(ref unsafe.Pointer) *Utilization

NewUtilizationRef converts the C object reference into a raw struct reference without wrapping.

func (*Utilization) Free

func (x *Utilization) Free()

Free cleanups the referenced memory using C free.

func (*Utilization) PassRef

func (x *Utilization) PassRef() *C.nvmlUtilization_t

PassRef returns a reference to C object as it is or allocates a new C object of this type.

func (*Utilization) Ref

func (x *Utilization) Ref() *C.nvmlUtilization_t

Ref returns a reference to C object as it is.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL