nvml

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UnavailableLib is returned when the nvml library could not be loaded.
	UnavailableLib = errors.New("could not load NVML library")
)

Functions

func NewNvmlClient

func NewNvmlClient() (*nvmlClient, error)

NewNvmlClient function creates new nvmlClient with real NvmlDriver implementation. Also, this func initializes NvmlDriver

Types

type DeviceData

type DeviceData struct {
	UUID       string
	DeviceName *string
	MemoryMiB  *uint64
	PowerW     *uint
	BAR1MiB    *uint64
}

DeviceData represents common fields for Nvidia device

type DeviceInfo

type DeviceInfo struct {
	// The following fields are guaranteed to be retrieved from nvml
	UUID            string
	PCIBusID        string
	DisplayState    string
	PersistenceMode string

	// The following fields can be nil after call to nvml, because nvml was
	// not able to retrieve this fields for specific nvidia card
	Name               *string
	MemoryMiB          *uint64
	PowerW             *uint
	BAR1MiB            *uint64
	PCIBandwidthMBPerS *uint
	CoresClockMHz      *uint
	MemoryClockMHz     *uint
}

DeviceInfo represents nvml device data this struct is returned by NvmlDriver DeviceInfoByIndex and DeviceInfoAndStatusByIndex methods

type DeviceStatus

type DeviceStatus struct {
	// The following fields can be nil after call to nvml, because nvml was
	// not able to retrieve this fields for specific nvidia card
	PowerUsageW        *uint
	TemperatureC       *uint
	GPUUtilization     *uint // %
	MemoryUtilization  *uint // %
	EncoderUtilization *uint // %
	DecoderUtilization *uint // %
	BAR1UsedMiB        *uint64
	UsedMemoryMiB      *uint64
	ECCErrorsL1Cache   *uint64
	ECCErrorsL2Cache   *uint64
	ECCErrorsDevice    *uint64
}

DeviceStatus represents nvml device status this struct is returned by NvmlDriver DeviceInfoAndStatusByIndex method

type FingerprintData

type FingerprintData struct {
	Devices       []*FingerprintDeviceData
	DriverVersion string
}

FingerprintData represets attributes of driver/devices

type FingerprintDeviceData

type FingerprintDeviceData struct {
	*DeviceData
	PCIBandwidthMBPerS *uint
	CoresClockMHz      *uint
	MemoryClockMHz     *uint
	DisplayState       string
	PersistenceMode    string
	PCIBusID           string
}

FingerprintDeviceData is a superset of DeviceData it describes device specific fields returned from nvml queries during fingerprinting call

type NvmlClient

type NvmlClient interface {
	GetFingerprintData() (*FingerprintData, error)
	GetStatsData() ([]*StatsData, error)
}

NvmlClient describes how users would use nvml library

type NvmlDriver

type NvmlDriver interface {
	Initialize() error
	Shutdown() error
	SystemDriverVersion() (string, error)
	DeviceCount() (uint, error)
	DeviceInfoByIndex(uint) (*DeviceInfo, error)
	DeviceInfoAndStatusByIndex(uint) (*DeviceInfo, *DeviceStatus, error)
}

NvmlDriver represents set of methods to query nvml library

type StatsData

type StatsData struct {
	*DeviceData
	PowerUsageW        *uint
	GPUUtilization     *uint
	MemoryUtilization  *uint
	EncoderUtilization *uint
	DecoderUtilization *uint
	TemperatureC       *uint
	UsedMemoryMiB      *uint64
	BAR1UsedMiB        *uint64
	ECCErrorsL1Cache   *uint64
	ECCErrorsL2Cache   *uint64
	ECCErrorsDevice    *uint64
}

StatsData is a superset of DeviceData it represents statistics data returned for every Nvidia device

Jump to

Keyboard shortcuts

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