ixml

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCudaVersion

func GetCudaVersion() (string, error)

GetCudaVersion get which CUDA version is used.

func GetDeviceCount

func GetDeviceCount() (uint, error)

GetDeviceCount get the number of gpu.

func GetDriverVersion

func GetDriverVersion() (string, error)

GetDriverVersion get the current driver version.

func Init

func Init() error

Init

func Shutdown

func Shutdown() error

Shutdown

Types

type ClockInfo

type ClockInfo struct {
	Mem uint
	Sm  uint
}

ClockInfo contains of all clock information of a gpu device.

type Device

type Device interface {
	// DeviceGetName returns the name of the gpu.
	DeviceGetName() (string, error)

	// DeviceGetMinorNumber returns the minor number.
	DeviceGetMinorNumber() (uint, error)

	// DeviceGetMinorSlice returns the minor number slice.
	DeviceGetMinorSlice() ([]uint, error)

	// DeviceGetUUID returns the uuid of the gpu.
	DeviceGetUUID() (string, error)

	// DeviceGetUUIDSlice returns the uuid slice of the gpus on the same board.
	DeviceGetUUIDSlice() ([]string, error)

	// DeviceGetIndex returns the index of the gpu.
	DeviceGetIndex() (uint, error)

	// DeviceGetFanSpeed returns the value of the gpu fan speed.
	DeviceGetFanSpeed() (uint, error)

	// DeviceGetMemoryInfo returns the memory status of the gpu.
	DeviceGetMemoryInfo() (MemoryInfo, error)

	// DeviceGetTemperature returns the current temperature of the gpu.
	DeviceGetTemperature() (uint, error)

	// DeviceGetPciInfo returns the pci information of the gpu.
	DeviceGetPciInfo() (PciInfo, error)

	// DeviceGetPowerUsage returns the current power usage of the gpu.
	DeviceGetPowerUsage() (uint, error)

	// DeviceGetPowerLimitConstraints returns the power limitation of the gpu.
	DeviceGetPowerLimitConstraints() (PowerLimitConstraints, error)

	// DeviceGetClockInfo returns the sm clock and memory clock of the gpu.
	DeviceGetClockInfo() (ClockInfo, error)

	// DeviceGetUtilization returns gpu and memory used percent.
	DeviceGetUtilization() (Utilization, error)
}

Device defines the implementation of specified device.

func NewDeviceByIndex

func NewDeviceByIndex(index uint) (Device, error)

NewDeviceByIndex creates a device instance by index.

func NewDeviceByUUID

func NewDeviceByUUID(uuid string) (Device, error)

NewDeviceByUUID create a device instance by uuid.

type Event

type Event interface {
	// RegisterEventforDevice register a event for specified device.
	RegisterEventsForDevice(uuid string, eventType EventType) error

	// WaitForEvent wait a event during the timeout.
	WaitForEvent(timeout uint) (EventData, error)

	// DeleteEventSet delete the registered event.
	EventSetFree() error
}

Event defines the implementation of a event.

func NewEventSet

func NewEventSet() (Event, error)

NewEventSet create a device event.

type EventData

type EventData struct {
	Type EventType
	Data uint64
}

type EventType

type EventType uint64
const (
	XidCriticalError EventType = eventTypeXidCriticalError
)

type MemoryInfo

type MemoryInfo struct {
	Total uint64
	Used  uint64
	Free  uint64
}

MemoryInfo contains information of a gpu device.

type PciInfo

type PciInfo struct {
	Bus            uint
	BusId          string
	BusIdLegacy    string
	Device         uint
	Domain         uint
	PciDeviceId    uint
	PciSubSystemId uint
}

PciInfo contains of information of a gpu device.

type PowerLimitConstraints

type PowerLimitConstraints struct {
	MaxLimit uint
	MinLimit uint
}

PowerLimitConstraints contains of the limitation of a gpu device.

type Utilization

type Utilization struct {
	GPU uint
	Mem uint
}

Utilization contains of the percent of gpu and memory used.

Jump to

Keyboard shortcuts

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