nvml

package
Version: v0.0.0-...-0474d08 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PerfStateMax     = 0
	PerfStateMin     = 15
	PerfStateUnknown = 32
)
View Source
const (
	XidCriticalError = C.nvmlEventTypeXidCriticalError
)

Variables

View Source
var (
	ErrCPUAffinity        = errors.New("failed to retrieve CPU affinity")
	ErrUnsupportedP2PLink = errors.New("unsupported P2P link type")
	ErrUnsupportedGPU     = errors.New("unsupported GPU device")
)

Functions

func DeleteEventSet

func DeleteEventSet(es EventSet)

func GetCudaDriverVersion

func GetCudaDriverVersion() (*uint, *uint, error)

func GetDeviceCount

func GetDeviceCount() (uint, error)

func GetDriverVersion

func GetDriverVersion() (string, error)

func Init

func Init() error

func RegisterEvent

func RegisterEvent(es EventSet, event int) error

func RegisterEventForDevice

func RegisterEventForDevice(es EventSet, event int, uuid string) error

func Shutdown

func Shutdown() error

Types

type Accounting

type Accounting struct {
	Mode       ModeState
	BufferSize *uint
}

type ClockInfo

type ClockInfo struct {
	Cores  *uint
	Memory *uint
}

type CudaComputeCapabilityInfo

type CudaComputeCapabilityInfo struct {
	Major *int
	Minor *int
}

type Device

type Device struct {
	UUID                  string
	Path                  string
	Model                 *string
	Power                 *uint
	Memory                *uint64
	CPUAffinity           *uint
	PCI                   PCIInfo
	Clocks                ClockInfo
	Topology              []P2PLink
	CudaComputeCapability CudaComputeCapabilityInfo
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(idx uint) (device *Device, err error)

func NewDeviceLite

func NewDeviceLite(idx uint) (device *Device, err error)

func (*Device) GetAllRunningProcesses

func (d *Device) GetAllRunningProcesses() ([]ProcessInfo, error)

func (*Device) GetComputeRunningProcesses

func (d *Device) GetComputeRunningProcesses() ([]uint, []uint64, error)

func (*Device) GetDeviceMode

func (d *Device) GetDeviceMode() (mode *DeviceMode, err error)

func (*Device) GetGraphicsRunningProcesses

func (d *Device) GetGraphicsRunningProcesses() ([]uint, []uint64, error)

func (*Device) Status

func (d *Device) Status() (status *DeviceStatus, err error)

type DeviceMemory

type DeviceMemory struct {
	Used *uint64
	Free *uint64
}

type DeviceMode

type DeviceMode struct {
	DisplayInfo    Display
	Persistence    ModeState
	AccountingInfo Accounting
}

type DeviceStatus

type DeviceStatus struct {
	Power       *uint
	Temperature *uint
	Utilization UtilizationInfo
	Memory      MemoryInfo
	Clocks      ClockInfo
	PCI         PCIStatusInfo
	Processes   []ProcessInfo
	Throttle    ThrottleReason
	Performance PerfState
}

type Display

type Display struct {
	Mode   ModeState
	Active ModeState
}

type ECCErrorsInfo

type ECCErrorsInfo struct {
	L1Cache *uint64
	L2Cache *uint64
	Device  *uint64
}

type Event

type Event struct {
	UUID  *string
	Etype uint64
	Edata uint64
}

func WaitForEvent

func WaitForEvent(es EventSet, timeout uint) (Event, error)

type EventSet

type EventSet struct {
	// contains filtered or unexported fields
}

func NewEventSet

func NewEventSet() EventSet

type MemoryInfo

type MemoryInfo struct {
	Global    DeviceMemory
	ECCErrors ECCErrorsInfo
}

type ModeState

type ModeState uint
const (
	Disabled ModeState = iota
	Enabled
)

func (ModeState) String

func (m ModeState) String() string
type P2PLink struct {
	BusID string
	Link  P2PLinkType
}

type P2PLinkType

type P2PLinkType uint
const (
	P2PLinkUnknown P2PLinkType = iota
	P2PLinkCrossCPU
	P2PLinkSameCPU
	P2PLinkHostBridge
	P2PLinkMultiSwitch
	P2PLinkSingleSwitch
	P2PLinkSameBoard
	SingleNVLINKLink
	TwoNVLINKLinks
	ThreeNVLINKLinks
	FourNVLINKLinks
	FiveNVLINKLinks
	SixNVLINKLinks
)
func GetNVLink(dev1, dev2 *Device) (link P2PLinkType, err error)
func GetP2PLink(dev1, dev2 *Device) (link P2PLinkType, err error)

func (P2PLinkType) String

func (t P2PLinkType) String() string

type PCIInfo

type PCIInfo struct {
	BusID     string
	BAR1      *uint64
	Bandwidth *uint
}

type PCIStatusInfo

type PCIStatusInfo struct {
	BAR1Used   *uint64
	Throughput PCIThroughputInfo
}

type PCIThroughputInfo

type PCIThroughputInfo struct {
	RX *uint
	TX *uint
}

type PerfState

type PerfState uint

func (PerfState) String

func (p PerfState) String() string

type ProcessInfo

type ProcessInfo struct {
	PID        uint
	Name       string
	MemoryUsed uint64
	Type       ProcessType
}

type ProcessType

type ProcessType uint
const (
	Compute ProcessType = iota
	Graphics
	ComputeAndGraphics
)

func (ProcessType) String

func (t ProcessType) String() string

type ThrottleReason

type ThrottleReason uint
const (
	ThrottleReasonGpuIdle ThrottleReason = iota
	ThrottleReasonApplicationsClocksSetting
	ThrottleReasonSwPowerCap
	ThrottleReasonHwSlowdown
	ThrottleReasonSyncBoost
	ThrottleReasonSwThermalSlowdown
	ThrottleReasonHwThermalSlowdown
	ThrottleReasonHwPowerBrakeSlowdown
	ThrottleReasonDisplayClockSetting
	ThrottleReasonNone
	ThrottleReasonUnknown
)

func (ThrottleReason) String

func (r ThrottleReason) String() string

type UtilizationInfo

type UtilizationInfo struct {
	GPU     *uint
	Memory  *uint
	Encoder *uint
	Decoder *uint
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL