Documentation ¶
Index ¶
- func DeviceCount() (uint, error)
- func Initialize() error
- func Shutdown() error
- func SystemDriverVersion() (string, error)
- type Device
- func (d Device) AverageGPUUtilization(since time.Duration) (uint, error)
- func (d Device) AveragePowerUsage(since time.Duration) (uint, error)
- func (d Device) DecoderUtilization() (uint, uint, error)
- func (d Device) EncoderUtilization() (uint, uint, error)
- func (d Device) FanSpeed() (uint, error)
- func (d Device) MemoryInfo() (uint64, uint64, error)
- func (d Device) MinorNumber() (uint, error)
- func (d Device) Name() (string, error)
- func (d Device) PowerUsage() (uint, error)
- func (d Device) Temperature() (uint, error)
- func (d Device) UUID() (string, error)
- func (d Device) UtilizationRates() (uint, uint, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceCount ¶
DeviceCount returns the number of nvidia devices on the system.
func Initialize ¶
func Initialize() error
Initialize initializes NVML. Call this before calling any other methods.
func Shutdown ¶
func Shutdown() error
Shutdown shuts down NVML. Call this once NVML is no longer being used.
func SystemDriverVersion ¶
SystemDriverVersion returns the the driver version on the system.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is the handle for the device. This handle is obtained by calling DeviceHandleByIndex().
func DeviceHandleByIndex ¶
DeviceHandleByIndex returns the device handle for a particular index. The indices range from 0 to DeviceCount()-1. The order in which NVML enumerates devices has no guarantees of consistency between reboots.
func (Device) AverageGPUUtilization ¶
AverageGPUUtilization returns the utilization.gpu metric (percent of time one of more kernels were executing on the GPU) averaged over the samples collected in the last `since` duration.
func (Device) AveragePowerUsage ¶
AveragePowerUsage returns the power usage for this GPU and its associated circuitry in milliwatts averaged over the samples collected in the last `since` duration.
func (Device) DecoderUtilization ¶
DecoderUtilization returns the percent of time over the last sample period during which the GPU video decoder was being used. The sampling period is variable and is returned in the second return argument in microseconds.
func (Device) EncoderUtilization ¶
EncoderUtilization returns the percent of time over the last sample period during which the GPU video encoder was being used. The sampling period is variable and is returned in the second return argument in microseconds.
func (Device) FanSpeed ¶
FanSpeed returns the temperature for this GPU in the percentage of its full speed, with 100 being the maximum.
func (Device) MemoryInfo ¶
MemoryInfo returns the total and used memory (in bytes) of the device.
func (Device) MinorNumber ¶
MinorNumber returns the minor number for the device. The minor number for the device is such that the Nvidia device node file for each GPU will have the form /dev/nvidia[minor number].
func (Device) PowerUsage ¶
PowerUsage returns the power usage for this GPU and its associated circuitry in milliwatts. The reading is accurate to within +/- 5% of current power draw.
func (Device) Temperature ¶
Temperature returns the temperature for this GPU in Celsius.
func (Device) UtilizationRates ¶
UtilizationRates returns the percent of time over the past sample period during which: utilization.gpu: one or more kernels were executing on the GPU. utilization.memory: global (device) memory was being read or written.