Documentation ¶
Index ¶
- func DeviceGetHandleByIndex(idx int) (*C.nvmlDevice_t, error)
- func GetDeviceCount() (int, error)
- func InitNVML() error
- func ShutdownNVML() error
- type Device
- func (s *Device) GetFanSpeed() (int, error)
- func (s *Device) GetMemoryInfo() (memInfo *NVMLMemory, err error)
- func (s *Device) GetPowerUsage() (int, error)
- func (s *Device) GetProcessInfo() (procInfo []NVMLProcess, err error)
- func (s *Device) GetTemperature() (int, int, error)
- func (s *Device) GetUtilization() (gpu, memory int, err error)
- func (s *Device) Name() (name string, err error)
- func (s *Device) UUID() (uuid string, err error)
- type NVMLMemory
- type NVMLProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceGetHandleByIndex ¶
func DeviceGetHandleByIndex(idx int) (*C.nvmlDevice_t, error)
DeviceGetHandleByIndex acquires the handle for a particular device, based on its index.
func GetDeviceCount ¶
GetDeviceCount returns the # of CUDA devices present on the host
func ShutdownNVML ¶
func ShutdownNVML() error
ShutdownNVML all resources that were created when we initialized
Types ¶
type Device ¶
type Device struct { DeviceName string DeviceUUID string // contains filtered or unexported fields }
Device describes the NVIDIA GPU device attached to the host
func GetDevices ¶
GetDevices returns a list of all installed CUDA devices
func (*Device) GetFanSpeed ¶
GetFanSpeed returns the fan speed in percent
func (*Device) GetMemoryInfo ¶
func (s *Device) GetMemoryInfo() (memInfo *NVMLMemory, err error)
GetMemoryInfo retrieves the amount of used, free and total memory available on the device, in bytes.
func (*Device) GetPowerUsage ¶
GetPowerUsage returns the power consumption of the GPU in watts
func (*Device) GetProcessInfo ¶
func (s *Device) GetProcessInfo() (procInfo []NVMLProcess, err error)
GetProcessInfo retrieves the active proccesses (pid, used gpu memory) running on the device
func (*Device) GetTemperature ¶
GetTemperature returns the Device's temperature in Farenheit and celsius
func (*Device) GetUtilization ¶
GetUtilization returns the GPU and memory usage returned as a percentage used of a given GPU device
type NVMLMemory ¶
type NVMLMemory struct { // Unallocated FB memory (in bytes). Free int64 // Total installed FB memory (in bytes). Total int64 // Allocated FB memory (in bytes). Note that the driver/GPU always sets // aside a small amount of memory for bookkeeping. Used int64 }
NVMLMemory contains information about the memory allocation of a device