nvml

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MIT Imports: 7 Imported by: 0

README

GoDoc Go Report Card MIT license

nvml-go

golang wrapper for NVIDIA Management Library (NVML)

Basic example

func ExampleNew() {
	nvml, err := New("")
	if err != nil {
		panic(err)
	}

	defer nvml.Shutdown()

	err = nvml.Init()
	if err != nil {
		panic(err)
	}

	driverVersion, err := nvml.SystemGetDriverVersion()
	if err != nil {
		panic(err)
	}

	log.Printf("Driver version:\t%s", driverVersion)

	nvmlVersion, err := nvml.SystemGetNVMLVersion()
	if err != nil {
		panic(err)
	}

	log.Printf("NVML version:\t%s", nvmlVersion)

	deviceCount, err := nvml.DeviceGetCount()
	if err != nil {
		panic(err)
	}

	for i := uint32(0); i < deviceCount; i++ {
		handle, err := nvml.DeviceGetHandleByIndex(i)
		if err != nil {
			panic(err)
		}

		name, err := nvml.DeviceGetName(handle)
		log.Printf("Product name:\t%s", name)

		brand, err := nvml.DeviceGetBrand(handle)
		if err != nil {
			panic(err)
		}

		log.Printf("Product Brand:\t%s", brand)

		uuid, err := nvml.DeviceGetUUID(handle)
		if err != nil {
			panic(err)
		}

		log.Printf("GPU UUID:\t\t%s", uuid)

		fan, err := nvml.DeviceGetFanSpeed(handle)
		if err != nil {
			panic(err)
		}

		log.Printf("Fan Speed:\t\t%d", fan)
	}
}

TODO

Documentation

Index

Examples

Constants

View Source
const (
	// Temperature at which the GPU will shut down for HW protection
	TemperatureThresholdShutdown = TemperatureThreshold(0)
	// Temperature at which the GPU will begin HW slowdown
	TemperatureThresholdSlowdown = TemperatureThreshold(1)
	// Memory Temperature at which the GPU will begin SW slowdown
	TemperatureThresholdMemMax = TemperatureThreshold(2)
	// GPU Temperature at which the GPU can be throttled below base clock
	TemperatureThresholdGPUMax = TemperatureThreshold(3)
)

noinspection GoUnusedConst

View Source
const (
	ClockGraphics = ClockType(0) // Graphics clock domain
	ClockSM       = ClockType(1) // SM clock domain
	ClockMem      = ClockType(2) // Memory clock domain
	ClockVideo    = ClockType(3) // Video encoder/decoder clock domain
)

noinspection GoUnusedConst

View Source
const (
	BrandUnknown = BrandType(0)
	BrandQuadro  = BrandType(1)
	BrandTesla   = BrandType(2)
	BrandNVS     = BrandType(3)
	BrandGrid    = BrandType(4)
	BrandGeforce = BrandType(5)
)

noinspection GoUnusedConst

View Source
const (
	ClockIDCurrent          = ClockID(0) // Current actual clock value.
	ClockIDAppClockTarget   = ClockID(1) // Target application clock.
	ClockIDAppClockDefault  = ClockID(2) // Default application clock target.
	ClockIDCustomerBoostMax = ClockID(3) // OEM-defined maximum clock rate.
)

noinspection GoUnusedConst

View Source
const (
	// Bit mask representing no clocks throttling. Clocks are as high as possible.
	ClocksThrottleReasonNone = ClocksThrottleReason(0)
	// Nothing is running on the GPU and the clocks are dropping to Idle state.
	ClocksThrottleReasonGPUIdle = ClocksThrottleReason(0x0000000000000001)
	// GPU clocks are limited by current setting of applications clocks.
	ClocksThrottleReasonApplicationsClocksSetting = ClocksThrottleReason(0x0000000000000002)
	// Renamed to ClocksThrottleReasonApplicationsClocksSetting as the name describes the situation more accurately.
	ClocksThrottleReasonUserDefinedClocks = ClocksThrottleReason(0x0000000000000002)
	// SW Power Scaling algorithm is reducing the clocks below requested clocks.
	ClocksThrottleReasonSWPowerCap = ClocksThrottleReason(0x0000000000000004)
	// HW Slowdown (reducing the core clocks by a factor of 2 or more) is engaged.
	// This is an indicator of:
	// 	 - Temperature being too high
	//   - External Power Brake Assertion is triggered (e.g. by the system power supply)
	//   - Power draw is too high and Fast Trigger protection is reducing the clocks
	//   - May be also reported during PState or clock change
	//     - This behavior may be removed in a later release.
	ClocksThrottleReasonHWSlowdown = ClocksThrottleReason(0x0000000000000008)
	// This GPU has been added to a Sync boost group with nvidia-smi or DCGM in
	// order to maximize performance per watt. All GPUs in the sync boost group
	// will boost to the minimum possible clocks across the entire group. Look at
	// the throttle reasons for other GPUs in the system to see why those GPUs are
	// holding this one at lower clocks.
	ClocksThrottleReasonSyncBoost = ClocksThrottleReason(0x0000000000000010)
	// SW Thermal Slowdown
	// This is an indicator of one or more of the following:
	//   - Current GPU temperature above the GPU Max Operating Temperature
	//   - Current memory temperature above the Memory Max Operating Temperature
	ClocksThrottleReasonSWThermalSlowdown = ClocksThrottleReason(0x0000000000000020)
	// HW Thermal Slowdown (reducing the core clocks by a factor of 2 or more) is engaged.
	// This is an indicator of:
	//   - Temperature being too high
	ClocksThrottleReasonHwThermalSlowdown = ClocksThrottleReason(0x0000000000000040)
	// HW Power Brake Slowdown (reducing the core clocks by a factor of 2 or more) is engaged.
	// This is an indicator of:
	//   - External Power Brake Assertion being triggered (e.g. by the system power supply)
	ClocksThrottleReasonHwPowerBrakeSlowdown = ClocksThrottleReason(0x0000000000000080)
)

noinspection GoUnusedConst

View Source
const (
	// Everything is enabled and running at full speed.
	GPUOperationModeAllOn = GPUOperationMode(0)
	// Designed for running only compute tasks. Graphics operations are not allowed
	GPUOperationModeCompute = GPUOperationMode(1)
	// Designed for running graphics applications that don't require high bandwidth double precision
	GPUOperationModeLowDoublePrecision = GPUOperationMode(2)
)

noinspection GoUnusedConst

View Source
const (
	// WDDM driver model -- GPU treated as a display device.
	DriverModelWDDM = DriverModel(0)
	// WDM (TCC) model (recommended) -- GPU treated as a generic device.
	DriverModelWDM = DriverModel(1)
)

noinspection GoUnusedConst

View Source
const (
	// Default compute mode - multiple contexts per device.
	ComputeModeDefault = ComputeMode(0)
	// Support Removed.
	ComputeModeExclusiveThread = ComputeMode(1)
	// No contexts per device.
	ComputeModeProhibited = ComputeMode(2)
	// Only one context per device, usable from multiple threads at a time.
	ComputeModeExclusiveProcess = ComputeMode(3)
)

noinspection GoUnusedConst

View Source
const (
	// APIs that change application clocks
	RestrictedAPISetApplicationClocks = RestrictedAPI(0)
	// APIs that enable/disable Auto Boosted clocks
	RestrictedAPISetAutoBoostedClocks = RestrictedAPI(1)
)

noinspection GoUnusedConst

View Source
const (
	// An object defined by OEM.
	InfoROMObjectOEM = InfoROMObject(0)
	// The ECC object determining the level of ECC support.
	InfoROMObjectECC = InfoROMObject(1)
	// The power management object.
	InfoROMObjectPower = InfoROMObject(2)
)

noinspection GoUnusedConst

View Source
const (
	EncoderTypeQueryH264 = EncoderType(0)
	EncoderTypeQueryHEVC = EncoderType(1)
)

noinspection GoUnusedConst

View Source
const (
	// A memory error that was corrected for ECC errors, these are single bit errors For Texture memory, these are errors fixed by resend.
	MemoryErrorTypeCorrected = MemoryErrorType(0)
	// A memory error that was not corrected for ECC errors, these are double bit errors For Texture memory, these are errors where the resend fails.
	MemoryErrorTypeUncorrected = MemoryErrorType(1)
)

noinspection GoUnusedConst

View Source
const (
	// Volatile counts are reset each time the driver loads.
	VolatileECC = ECCCounterType(0)
	// Aggregate counts persist across reboots (i.e. for the lifetime of the device).
	AggregateECC = ECCCounterType(1)
)

noinspection GoUnusedConst

View Source
const (
	// GPU L1 Cache.
	MemoryLocationL1Cache = MemoryLocation(0)
	// GPU L2 Cache.
	MemoryLocationL2Cache = MemoryLocation(1)
	// GPU Device Memory.
	MemoryLocationDeviceMemory = MemoryLocation(2)
	// GPU Register File.
	MemoryLocationRegisterFile = MemoryLocation(3)
	// GPU Texture Memory.
	MemoryLocationTextureMemory = MemoryLocation(4)
	// Shared memory.
	MemoryLocationTextureSHM = MemoryLocation(5)
	// CBU.
	MemoryLocationCBU = MemoryLocation(6)
)

noinspection GoUnusedConst

View Source
const (
	PCIeUtilTXBytes = PCIeUtilCounter(0)
	PCIeUtilRXBytes = PCIeUtilCounter(1)
)

noinspection GoUnusedConst

View Source
const (
	PState0       = PState(0) // Performance state 0 -- Maximum Performance.
	PState1       = PState(1)
	PState2       = PState(2)
	PState3       = PState(3)
	PState4       = PState(4)
	PState5       = PState(5)
	PState6       = PState(6)
	PState7       = PState(7)
	PState8       = PState(8)
	PState9       = PState(9)
	PState10      = PState(10)
	PState11      = PState(11)
	PState12      = PState(12)
	PState13      = PState(13)
	PState14      = PState(14)
	PState15      = PState(15) // Performance state 15 -- Minimum Performance.
	PStateUnknown = PState(32)
)

noinspection GoUnusedConst

View Source
const (
	// Page was retired due to multiple single bit ECC error.
	PageRetirementCauseMultipleSingleBitECCErrors = PageRetirementCause(0)
	// Page was retired due to double bit ECC error.
	PageRetirementCauseDoubleBitECCError = PageRetirementCause(1)
)

noinspection GoUnusedConst

View Source
const (
	TopologyInternal   = GPUTopologyLevel(0)
	TopologySingle     = GPUTopologyLevel(10)
	TopologyMultiple   = GPUTopologyLevel(20)
	TopologyHostbridge = GPUTopologyLevel(30)
	TopologyNode       = GPUTopologyLevel(40)
	TopologySystem     = GPUTopologyLevel(50)
)

noinspection GoUnusedConst

View Source
const (
	// How long did power violations cause the GPU to be below application clocks.
	PerfPolicyPower = PerfPolicyType(0)
	// How long did thermal violations cause the GPU to be below application clocks.
	PerfPolicyThermal = PerfPolicyType(1)
	// How long did sync boost cause the GPU to be below application clocks.
	PerfPolicySyncBoost = PerfPolicyType(2)
	// How long did the board limit cause the GPU to be below application clocks.
	PerfPolicyBoardLimit = PerfPolicyType(3)
	// How long did low utilization cause the GPU to be below application clocks.
	PerfPolicyLowUtilization = PerfPolicyType(4)
	// How long did the board reliability limit cause the GPU to be below application clocks.
	PerfPolicyReliability = PerfPolicyType(5)
	// Total time the GPU was held below application clocks by any limiter (0 - 5 above).
	PerfPolicyTotalAppClocks = PerfPolicyType(10)
	// Total time the GPU was held below base clocks.
	PerfPolicyTotalBaseClocks = PerfPolicyType(11)
)

noinspection GoUnusedConst

View Source
const (
	TemperatureGPU = TemperatureSensor(0) // Temperature sensor for the GPU die.
)

noinspection GoUnusedConst

Variables

View Source
var (
	ErrUninitialized        = errors.New("NVML was not first initialized with Init")
	ErrInvalidArgument      = errors.New("A supplied argument is invalid")
	ErrNotSupported         = errors.New("The requested operation is not available on target device")
	ErrNoPermission         = errors.New("The current user does not have permission for operation")
	ErrAlreadyInititlized   = errors.New("Multiple initializations are now allowed through ref counting")
	ErrNotFound             = errors.New("A query to find an object was unsuccessful")
	ErrInsufficientSize     = errors.New("An input argument is not large enough")
	ErrInsufficientPower    = errors.New("A device's external power cables are not properly attached")
	ErrDriverNotLoaded      = errors.New("NVIDIA driver is not loaded")
	ErrTimeout              = errors.New("User provided timeout passed")
	ErrIRQIssue             = errors.New("NVIDIA Kernel detected an interrupt issue with a GPU")
	ErrLibraryNotFound      = errors.New("NVML Shared Library couldn't be found or loaded")
	ErrFunctionNotFound     = errors.New("Local version of NVML doesn't implement this function")
	ErrCorruptedInfoROM     = errors.New("infoROM is corrupted")
	ErrGPULost              = errors.New("The GPU has fallen off the bus or has otherwise become inaccessible")
	ErrResetRequired        = errors.New("The GPU requires a reset before it can be used again")
	ErrOperatingSystem      = errors.New("The GPU control device has been blocked by the operating system/cgroups")
	ErrLibRMVersionMismatch = errors.New("RM detects a driver/library version mismatch")
	ErrInUse                = errors.New("An operation cannot be performed because the GPU is currently in use")
	ErrMemory               = errors.New("Insufficient memory")
	ErrNoData               = errors.New("No data")
	ErrVGPUECCNotSupported  = errors.New("The requested vgpu operation is not available on target device, because ECC is enabled")
	ErrUnknown              = errors.New("An internal driver error occurred")
)
View Source
var ErrNotImplemented = errors.New("Not implemented")

Functions

This section is empty.

Types

type API

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

func New

func New(path string) (*API, error)

New creates nvml.dll wrapper

Example
nvml, err := New("")
if err != nil {
	panic(err)
}

defer nvml.Shutdown()

err = nvml.Init()
if err != nil {
	panic(err)
}

driverVersion, err := nvml.SystemGetDriverVersion()
if err != nil {
	panic(err)
}

log.Printf("Driver version:\t%s", driverVersion)

nvmlVersion, err := nvml.SystemGetNVMLVersion()
if err != nil {
	panic(err)
}

log.Printf("NVML version:\t%s", nvmlVersion)

deviceCount, err := nvml.DeviceGetCount()
if err != nil {
	panic(err)
}

for i := uint32(0); i < deviceCount; i++ {
	handle, err := nvml.DeviceGetHandleByIndex(i)
	if err != nil {
		panic(err)
	}

	name, err := nvml.DeviceGetName(handle)
	log.Printf("Product name:\t%s", name)

	brand, err := nvml.DeviceGetBrand(handle)
	if err != nil {
		panic(err)
	}

	log.Printf("Product Brand:\t%s", brand)

	uuid, err := nvml.DeviceGetUUID(handle)
	if err != nil {
		panic(err)
	}

	log.Printf("GPU UUID:\t\t%s", uuid)

	fan, err := nvml.DeviceGetFanSpeed(handle)
	if err != nil {
		panic(err)
	}

	log.Printf("Fan Speed:\t\t%d", fan)
}
Output:

func (API) DeviceClearCpuAffinity

func (a API) DeviceClearCpuAffinity(device Device) (err error)

DeviceClearCpuAffinity clears all affinity bindings for the calling thread. Note, this is a change as of version 8.0 as older versions cleared the affinity for a calling process and all children.

func (API) DeviceClearECCErrorCounts

func (a API) DeviceClearECCErrorCounts(device Device, counterType ECCCounterType) error

DeviceClearECCErrorCounts clears the ECC error and other memory error counts for the device. Only applicable to devices with ECC. Requires NVML_INFOROM_ECC version 2.0 or higher to clear aggregate location-based ECC counts. Requires NVML_INFOROM_ECC version 1.0 or higher to clear all other ECC counts. Requires root/admin permissions. Requires ECC Mode to be enabled. Sets all of the specified ECC counters to 0, including both detailed and total counts. This operation takes effect immediately.

func (API) DeviceGetAPIRestriction

func (a API) DeviceGetAPIRestriction(device Device, apiType RestrictedAPI) (bool, error)

DeviceGetAPIRestriction retrieves the root/admin permissions on the target API. See nvmlRestrictedAPI_t for the list of supported APIs. If an API is restricted only root users can call that API. See nvmlDeviceSetAPIRestriction to change current permissions.

func (API) DeviceGetApplicationsClock

func (a API) DeviceGetApplicationsClock(device Device, clockType ClockType) (clockMHz uint32, err error)

DeviceGetApplicationsClock retrieves the current setting of a clock that applications will use unless an overspec situation occurs. Can be changed using DeviceSetApplicationsClocks.

func (API) DeviceGetAutoBoostedClocksEnabled

func (a API) DeviceGetAutoBoostedClocksEnabled(device Device) (isEnabled, defaultIsEnabled bool, err error)

DeviceGetAutoBoostedClocksEnabled retrieve the current state of Auto Boosted clocks on a device and store it in isEnabled. Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates to maximize performance as thermal limits allow. On Pascal and newer hardware, Auto Aoosted clocks are controlled through application clocks.

func (API) DeviceGetBAR1MemoryInfo

func (a API) DeviceGetBAR1MemoryInfo(device Device) (mem BAR1Memory, err error)

DeviceGetBAR1MemoryInfo gets Total, Available and Used size of BAR1 memory. BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party devices (peer-to-peer on the PCIE bus).

func (API) DeviceGetBoardID

func (a API) DeviceGetBoardID(device Device) (boardID uint32, err error)

DeviceGetBoardID retrieves the device boardId from 0-N. Devices with the same boardId indicate GPUs connected to the same PLX. Use in conjunction with DeviceGetMultiGpuBoard() to decide if they are on the same board as well. The boardId returned is a unique ID for the current configuration. Uniqueness and ordering across reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will always return those values but they will always be different from each other).

func (API) DeviceGetBoardPartNumber

func (a API) DeviceGetBoardPartNumber(device Device) (string, error)

DeviceGetBoardPartNumber retrieves the the device board part number which is programmed into the board's InfoROM

func (API) DeviceGetBrand

func (a API) DeviceGetBrand(device Device) (brand BrandType, err error)

DeviceGetBrand retrieves the brand of this device.

func (API) DeviceGetBridgeChipInfo

func (a API) DeviceGetBridgeChipInfo()

func (API) DeviceGetCPUAffinity

func (a API) DeviceGetCPUAffinity(device Device, cpuSetSize uint32) (cpuSet uint32, err error)

DeviceGetCPUAffinity retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity for the device. For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2, result[0] = 0x3, result[1] = 0x3

func (API) DeviceGetClock

func (a API) DeviceGetClock(device Device, clockType ClockType, clockID ClockID) (clockMHz uint32, err error)

DeviceGetClock retrieves the clock speed for the clock specified by the clock type and clock ID.

func (API) DeviceGetClockInfo

func (a API) DeviceGetClockInfo(device Device, clockType ClockType) (clock uint32, err error)

DeviceGetClockInfo retrieves the current clock speeds for the device.

func (API) DeviceGetComputeMode

func (a API) DeviceGetComputeMode(device Device) (mode ComputeMode, err error)

DeviceGetComputeMode retrieves the current compute mode for the device.

func (API) DeviceGetComputeRunningProcesses

func (a API) DeviceGetComputeRunningProcesses(device Device) ([]ProcessInfo, error)

DeviceGetComputeRunningProcesses gets information about processes with a compute context on a device. This function returns information only about compute running processes (e.g. CUDA application which have active context). Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function. Keep in mind that information returned by this call is dynamic and the number of elements might change in time. Allocate more space for infos table in case new compute processes are spawned.

func (API) DeviceGetCount

func (a API) DeviceGetCount() (count uint32, err error)

DeviceGetCount retrieves the number of compute devices in the system. A compute device is a single GPU.

func (API) DeviceGetCudaComputeCapability

func (a API) DeviceGetCudaComputeCapability(device Device) (major, minor int32, err error)

DeviceGetCudaComputeCapability retrieves the CUDA compute capability of the device. Returns the major and minor compute capability version numbers of the device. The major and minor versions are equivalent to the CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR and CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR attributes that would be returned by CUDA's cuDeviceGetAttribute().

func (API) DeviceGetCurrPcieLinkGeneration

func (a API) DeviceGetCurrPcieLinkGeneration(device Device) (currLinkGen uint32, err error)

DeviceGetCurrPcieLinkGeneration retrieves the current PCIe link generation.

func (API) DeviceGetCurrPcieLinkWidth

func (a API) DeviceGetCurrPcieLinkWidth(device Device) (currLinkWidth uint32, err error)

DeviceGetCurrPcieLinkWidth retrieves the current PCIe link width.

func (API) DeviceGetCurrentClocksThrottleReasons

func (a API) DeviceGetCurrentClocksThrottleReasons(device Device) (clocksThrottleReasons ClocksThrottleReason, err error)

DeviceGetCurrentClocksThrottleReasons retrieves current clocks throttling reasons. More than one bit can be enabled at the same time. Multiple reasons can be affecting clocks at once.

func (API) DeviceGetDecoderUtilization

func (a API) DeviceGetDecoderUtilization(device Device) (utilization, samplingPeriodUs uint32, err error)

DeviceGetDecoderUtilization retrieves the current utilization and sampling size in microseconds for the Decoder.

func (API) DeviceGetDefaultApplicationsClock

func (a API) DeviceGetDefaultApplicationsClock(device Device, clockType ClockType) (clockMHz uint32, err error)

DeviceGetDefaultApplicationsClock retrieves the default applications clock that GPU boots with or defaults to after DeviceResetApplicationsClocks call.

func (API) DeviceGetDetailedECCErrors

func (a API) DeviceGetDetailedECCErrors(device Device, errorType MemoryErrorType, counterType ECCCounterType) (*ECCErrorCounts, error)

DeviceGetDetailedECCErrors retrieves the detailed ECC error counts for the device. Only applicable to devices with ECC. Requires NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based ECC counts. Requires NVML_INFOROM_ECC version 1.0 or higher to report all other ECC counts. Requires ECC Mode to be enabled. Detailed errors provide separate ECC counts for specific parts of the memory system. Reports zero for unsupported ECC error counters when a subset of ECC error counters are supported. Deprecated: This API supports only a fixed set of ECC error locations. On different GPU architectures different locations are supported, see DeviceGetMemoryErrorCounter

func (API) DeviceGetDisplayActive

func (a API) DeviceGetDisplayActive(device Device) (bool, error)

DeviceGetDisplayActive retrieves the display active state for the device. This method indicates whether a display is initialized on the device. For example whether X Server is attached to this device and has allocated memory for the screen. Display can be active even when no monitor is physically attached.

func (API) DeviceGetDisplayMode

func (a API) DeviceGetDisplayMode(device Device) (bool, error)

DeviceGetDisplayMode retrieves the display mode for the device. This method indicates whether a physical display (e.g. monitor) is currently connected to any of the device's connectors.

func (API) DeviceGetDriverModel

func (a API) DeviceGetDriverModel(device Device) (current, pending DriverModel, err error)

DeviceGetDriverModel retrieves the current and pending driver model for the device. On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached to the device it must run in WDDM mode. TCC mode is preferred if a display is not attached.

func (API) DeviceGetECCMode

func (a API) DeviceGetECCMode(device Device) (current, pending bool, err error)

DeviceGetECCMode retrieves the current and pending ECC modes for the device. Only applicable to devices with ECC. Requires NVML_INFOROM_ECC version 1.0 or higher. Changing ECC modes requires a reboot. The "pending" ECC mode refers to the target mode following the next reboot.

func (API) DeviceGetEncoderCapacity

func (a API) DeviceGetEncoderCapacity(device Device, encoderQueryType EncoderType) (encoderCapacity uint32, err error)

DeviceGetEncoderCapacity retrieves the current capacity of the device's encoder, in macroblocks per second.

func (API) DeviceGetEncoderSessions

func (a API) DeviceGetEncoderSessions() error

func (API) DeviceGetEncoderStats

func (a API) DeviceGetEncoderStats(device Device) (sessionCount, averageFPS, averageLatency uint32, err error)

DeviceGetEncoderStats retrieves the current encoder statistics for a given device.

func (API) DeviceGetEncoderUtilization

func (a API) DeviceGetEncoderUtilization(device Device) (utilization, samplingPeriodUs uint32, err error)

DeviceGetEncoderUtilization retrieves the current utilization and sampling size in microseconds for the Encoder

func (API) DeviceGetEnforcedPowerLimit

func (a API) DeviceGetEnforcedPowerLimit(device Device) (limit uint32, err error)

DeviceGetEnforcedPowerLimit gets the effective power limit that the driver enforces after taking into account all limiters. Note: This can be different from the DeviceGetPowerManagementLimit if other limits are set elsewhere. This includes the out of band power limit interface

func (API) DeviceGetFanSpeed

func (a API) DeviceGetFanSpeed(device Device) (speed uint32, err error)

DeviceGetFanSpeed retrieves the intended operating speed of the device's fan. Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the output will not match the actual fan speed. The fan speed is expressed as a percent of the maximum, i.e. full speed is 100%.

func (API) DeviceGetGPUOperationMode

func (a API) DeviceGetGPUOperationMode(device Device) (current, pending GPUOperationMode, err error)

DeviceGetGPUOperationMode retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot). For GK110 M-class and X-class Tesla products from the Kepler family. Modes NVML_GOM_LOW_DP and NVML_GOM_ALL_ON are supported on fully supported GeForce products. Not supported on Quadro and Tesla C-class products.

func (API) DeviceGetGraphicsRunningProcesses

func (a API) DeviceGetGraphicsRunningProcesses(device Device) ([]ProcessInfo, error)

DeviceGetGraphicsRunningProcesses get information about processes with a graphics context on a device. This function returns information only about graphics based processes (eg. applications using OpenGL, DirectX). Keep in mind that information returned by this call is dynamic and the number of elements might change in time. Allocate more space for infos table in case new graphics processes are spawned.

func (API) DeviceGetHandleByIndex

func (a API) DeviceGetHandleByIndex(index uint32) (device Device, err error)

DeviceGetHandleByIndex acquires the handle for a particular device, based on its index.

func (API) DeviceGetHandleByPCIBusID

func (a API) DeviceGetHandleByPCIBusID(pciBusID string) (device Device, err error)

DeviceGetHandleByPciBusId acquires the handle for a particular device, based on its PCI bus id. This value corresponds to the nvmlPciInfo_t::busId returned by DeviceGetPciInfo(). Starting from NVML 5, this API causes NVML to initialize the target GPU NVML may initialize additional GPUs if:

  • The target GPU is an SLI slave

Note: NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND instead of NVML_ERROR_NO_PERMISSION.

func (API) DeviceGetHandleBySerial

func (a API) DeviceGetHandleBySerial(serial string) (device Device, err error)

DeviceGetHandleBySerial acquires the handle for a particular device, based on its board serial number. Starting from NVML 5, this API causes NVML to initialize the target GPU, NVML may initialize additional GPUs as it searches for the target GPU

func (API) DeviceGetHandleByUUID

func (a API) DeviceGetHandleByUUID(uuid string) (device Device, err error)

DeviceGetHandleByUUID acquires the handle for a particular device, based on its globally unique immutable UUID associated with each device.

func (API) DeviceGetIndex

func (a API) DeviceGetIndex(device Device) (index uint32, err error)

DeviceGetIndex retrieves the NVML index of this device.

func (API) DeviceGetInfoROMImageVersion

func (a API) DeviceGetInfoROMImageVersion(device Device) (string, error)

DeviceGetInforomImageVersion retrieves the global infoROM image version. Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board in contrast to infoROM object version which is only an indicator of supported features.

func (API) DeviceGetInfoROMVersion

func (a API) DeviceGetInfoROMVersion(device Device, object InfoROMObject) (string, error)

DeviceGetInfoROMVersion retrieves the version information for the device's infoROM object.

func (API) DeviceGetInforomConfigurationChecksum

func (a API) DeviceGetInforomConfigurationChecksum(device Device) (checksum uint32, err error)

DeviceGetInforomConfigurationChecksum retrieves the checksum of the configuration stored in the device's infoROM. Can be used to make sure that two GPUs have the exact same configuration. Current checksum takes into account configuration stored in PWR and ECC infoROM objects. Checksum can change between driver releases or when user changes configuration (e.g. disable/enable ECC)

func (API) DeviceGetMaxClockInfo

func (a API) DeviceGetMaxClockInfo(device Device, clockType ClockType) (clock uint32, err error)

DeviceGetMaxClockInfo retrieves the maximum clock speeds for the device.

func (API) DeviceGetMaxCustomerBoostClock

func (a API) DeviceGetMaxCustomerBoostClock(device Device, clockType ClockType) (clockMHz uint32, err error)

DeviceGetMaxCustomerBoostClock retrieves the customer defined maximum boost clock speed specified by the given clock type.

func (API) DeviceGetMaxPcieLinkGeneration

func (a API) DeviceGetMaxPcieLinkGeneration(device Device) (maxLinkGen uint32, err error)

DeviceGetMaxPcieLinkGeneration retrieves the maximum PCIe link generation possible with this device and system. I.E. for a generation 2 PCIe device attached to a generation 1 PCIe bus the max link generation this function will report is generation 1.

func (API) DeviceGetMaxPcieLinkWidth

func (a API) DeviceGetMaxPcieLinkWidth(device Device) (maxLinkWidth uint32, err error)

DeviceGetMaxPcieLinkWidth retrieves the maximum PCIe link width possible with this device and system I.E. for a device with a 16x PCIe bus width attached to a 8x PCIe system bus this function will report a max link width of 8.

func (API) DeviceGetMemoryErrorCounter

func (a API) DeviceGetMemoryErrorCounter(device Device, errorType MemoryErrorType, counterType ECCCounterType, locationType MemoryLocation) (count uint64, err error)

DeviceGetMemoryErrorCounter retrieves the requested memory error counter for the device. Requires NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based memory error counts. Requires NVML_INFOROM_ECC version 1.0 or higher to report all other memory error counts. Only applicable to devices with ECC. Requires ECC Mode to be enabled.

func (API) DeviceGetMemoryInfo

func (a API) DeviceGetMemoryInfo(device Device) (mem Memory, err error)

DeviceGetMemoryInfo retrieves the amount of used, free and total memory available on the device, in bytes.

func (API) DeviceGetMinorNumber

func (a API) DeviceGetMinorNumber(device Device) (minorNumber uint32, err error)

DeviceGetMinorNumber retrieves 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 (API) DeviceGetMultiGpuBoard

func (a API) DeviceGetMultiGpuBoard(device Device) (multiGpu bool, err error)

DeviceGetMultiGpuBoard retrieves whether the device is on a Multi-GPU Board.

func (API) DeviceGetName

func (a API) DeviceGetName(device Device) (string, error)

DeviceGetName retrieves the name of this device.

func (API) DeviceGetP2PStatus

func (a API) DeviceGetP2PStatus() error

func (API) DeviceGetPCIInfo

func (a API) DeviceGetPCIInfo(device Device) (*PCIInfo, error)

func (API) DeviceGetPCIeThroughput

func (a API) DeviceGetPCIeThroughput(device Device, counter PCIeUtilCounter) (value uint32, err error)

DeviceGetPCIeThroughput eetrieve PCIe utilization information. This function is querying a byte counter over a 20ms interval and thus is the PCIe throughput over that interval. This method is not supported in virtual machines running virtual GPU (vGPU).

func (API) DeviceGetPcieReplayCounter

func (a API) DeviceGetPcieReplayCounter(device Device) (value uint32, err error)

DeviceGetPcieReplayCounter retrieve the PCIe replay counter.

func (API) DeviceGetPerformanceState

func (a API) DeviceGetPerformanceState(device Device) (state PState, err error)

DeviceGetPerformanceState retrieves the current performance state for the device.

func (API) DeviceGetPersistenceMode

func (a API) DeviceGetPersistenceMode(device Device) (enabled bool, err error)

DeviceGetPersistenceMode eetrieves the persistence mode associated with this device. When driver persistence mode is enabled the driver software state is not torn down when the last client disconnects. By default this feature is disabled.

func (API) DeviceGetPowerManagementDefaultLimit

func (a API) DeviceGetPowerManagementDefaultLimit(device Device) (defaultLimit uint32, err error)

DeviceGetPowerManagementDefaultLimit retrieves default power management limit on this device, in milliwatts. Default power management limit is a power management limit that the device boots with.

func (API) DeviceGetPowerManagementLimit

func (a API) DeviceGetPowerManagementLimit(device Device) (limit uint32, err error)

DeviceGetPowerManagementLimit retrieves the power management limit associated with this device. The power limit defines the upper boundary for the card's power draw. If the card's total power draw reaches this limit the power management algorithm kicks in. This reading is only available if power management mode is supported, see DeviceGetPowerManagementMode.

func (API) DeviceGetPowerManagementLimitConstraints

func (a API) DeviceGetPowerManagementLimitConstraints(device Device) (minLimit, maxLimit uint32, err error)

DeviceGetPowerManagementLimitConstraints retrieves information about possible values of power management limits on this device.

func (API) DeviceGetPowerManagementMode

func (a API) DeviceGetPowerManagementMode(device Device) (bool, error)

DeviceGetPowerManagementMode retrieves the power management mode associated with this device. This API has been deprecated. This flag indicates whether any power management algorithm is currently active on the device. An enabled state does not necessarily mean the device is being actively throttled -- only that that the driver will do so if the appropriate conditions are met.

func (API) DeviceGetPowerState

func (a API) DeviceGetPowerState(device Device) (state PState, err error)

DeviceGetPowerState retrieve the current performance state for the device. Deprecated: Use DeviceGetPerformanceState. This function exposes an incorrect generalization.

func (API) DeviceGetPowerUsage

func (a API) DeviceGetPowerUsage(device Device) (power uint32, err error)

DeviceGetPowerUsage retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory)

func (API) DeviceGetRetiredPages

func (a API) DeviceGetRetiredPages(device Device, cause PageRetirementCause) ([]uint64, error)

DeviceGetRetiredPages returns the list of retired pages by source, including pages that are pending retirement. The address information provided from this API is the hardware address of the page that was retired. Note that this does not match the virtual address used in CUDA, but will match the address information in XID 63

func (API) DeviceGetRetiredPagesPendingStatus

func (a API) DeviceGetRetiredPagesPendingStatus(device Device) (isPending bool, err error)

DeviceGetRetiredPagesPendingStatus checks if any pages are pending retirement and need a reboot to fully retire.

func (API) DeviceGetSamples

func (a API) DeviceGetSamples() error

func (API) DeviceGetSerial

func (a API) DeviceGetSerial(device Device) (serial string, err error)

DeviceGetSerial retrieves the globally unique board serial number associated with this device's board.

func (API) DeviceGetSupportedClocksThrottleReasons

func (a API) DeviceGetSupportedClocksThrottleReasons(device Device) (supportedClocksThrottleReasons ClocksThrottleReason, err error)

DeviceGetSupportedClocksThrottleReasons retrieves bitmask of supported clocks throttle reasons that can be returned by DeviceGetCurrentClocksThrottleReasons. This method is not supported in virtual machines running virtual GPU (vGPU).

func (API) DeviceGetSupportedGraphicsClocks

func (a API) DeviceGetSupportedGraphicsClocks(device Device, memoryClockMHz uint32) ([]uint32, error)

DeviceGetSupportedGraphicsClocks retrieves the list of possible graphics clocks that can be used as an argument for DeviceSetApplicationsClocks.

func (API) DeviceGetSupportedMemoryClocks

func (a API) DeviceGetSupportedMemoryClocks(device Device) ([]uint32, error)

DeviceGetSupportedMemoryClocks retrieves the list of possible memory clocks that can be used as an argument for DeviceSetApplicationsClocks.

func (API) DeviceGetTemperature

func (a API) DeviceGetTemperature(device Device, sensorType TemperatureSensor) (temp uint32, err error)

DeviceGetTemperature retrieves the current temperature readings for the device, in degrees C.

func (API) DeviceGetTemperatureThreshold

func (a API) DeviceGetTemperatureThreshold(device Device, thresholdType TemperatureThreshold) (temp uint32, err error)

DeviceGetTemperatureThreshold retrieves the temperature threshold for the GPU with the specified threshold type in degrees C.

func (API) DeviceGetTopologyCommonAncestor

func (a API) DeviceGetTopologyCommonAncestor(device1 Device, device2 Device) (pathInfo GPUTopologyLevel, err error)

DeviceGetTopologyCommonAncestor retrieves the common ancestor for two devices. Supported on Linux only.

func (API) DeviceGetTopologyNearestGpus

func (a API) DeviceGetTopologyNearestGpus() error

func (API) DeviceGetTotalECCErrors

func (a API) DeviceGetTotalECCErrors(device Device, errorType MemoryErrorType, counterType ECCCounterType) (eccCount uint64, err error)

DeviceGetTotalECCErrors retrieves the total ECC error counts for the device. Only applicable to devices with ECC. Requires NVML_INFOROM_ECC version 1.0 or higher. Requires ECC Mode to be enabled. The total error count is the sum of errors across each of the separate memory systems, i.e. the total set of errors across the entire device.

func (API) DeviceGetTotalEnergyConsumption

func (a API) DeviceGetTotalEnergyConsumption(device Device) (energy uint64, err error)

DeviceGetTotalEnergyConsumption retrieves total energy consumption for this GPU in millijoules (mJ) since the driver was last reloaded.

func (API) DeviceGetUUID

func (a API) DeviceGetUUID(device Device) (string, error)

DeviceGetUUID retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string, that augments the immutable, board serial identifier.

func (API) DeviceGetUtilizationRates

func (a API) DeviceGetUtilizationRates(device Device) (u Utilization, err error)

DeviceGetUtilizationRates retrieves the current utilization rates for the device's major subsystems.

func (API) DeviceGetVbiosVersion

func (a API) DeviceGetVbiosVersion(device Device) (string, error)

DeviceGetVbiosVersion gets VBIOS version of the device. The VBIOS version may change from time to time.

func (API) DeviceGetViolationStatus

func (a API) DeviceGetViolationStatus(device Device, policyType PerfPolicyType) (violTime ViolationTime, err error)

DeviceGetViolationStatus gets the duration of time during which the device was throttled (lower than requested clocks) due to power or thermal constraints. The method is important to users who are tying to understand if their GPUs throttle at any point during their applications. The difference in violation times at two different reference times gives the indication of GPU throttling event.

func (API) DeviceOnSameBoard

func (a API) DeviceOnSameBoard(device1 Device, device2 Device) (bool, error)

DeviceOnSameBoard checks if the GPU devices are on the same physical board.

func (API) DeviceResetApplicationsClocks

func (a API) DeviceResetApplicationsClocks(device Device) error

DeviceResetApplicationsClocks resets the application clock to the default value.

func (API) DeviceSetAPIRestriction

func (a API) DeviceSetAPIRestriction(device Device, apiType RestrictedAPI, isRestricted bool) error

DeviceSetAPIRestriction changes the root/admin restructions on certain APIs. See nvmlRestrictedAPI_t for the list of supported APIs. This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs. The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See DeviceGetAPIRestriction to query the current restriction settings.

func (API) DeviceSetApplicationsClocks

func (a API) DeviceSetApplicationsClocks(device Device, memClockMHz, graphicsClockMHz uint32) error

DeviceSetApplicationsClocks set clocks that applications will lock to. Sets the clocks that compute and graphics applications will be running at. e.g. CUDA driver requests these clocks during context creation which means this property defines clocks at which CUDA applications will be running unless some overspec event occurs (e.g. over power, over thermal or external HW brake). Can be used as a setting to request constant performance. On Pascal and newer hardware, this will automatically disable automatic boosting of clocks. On K80 and newer Kepler and Maxwell GPUs, users desiring fixed performance should also call DeviceSetAutoBoostedClocksEnabled to prevent clocks from automatically boosting above the clock value being set. After system reboot or driver reload applications clocks go back to their default value.

func (API) DeviceSetAutoBoostedClocksEnabled

func (a API) DeviceSetAutoBoostedClocksEnabled(device Device, enabled bool) error

DeviceSetAutoBoostedClocksEnabled tries to set the current state of Auto Boosted clocks on a device. Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock rates are desired. Non-root users may use this API by default but can be restricted by root from using this API by calling DeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS. Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled.

func (API) DeviceSetComputeMode

func (a API) DeviceSetComputeMode(device Device, mode ComputeMode) error

DeviceSetComputeMode sets the compute mode for the device. Requires root/admin permissions. The compute mode determines whether a GPU can be used for compute operations and whether it can be shared across contexts. This operation takes effect immediately. Under Linux it is not persistent across reboots and always resets to "Default". Under windows it is persistent. Under windows compute mode may only be set to DEFAULT when running in WDDM.

func (API) DeviceSetCpuAffinity

func (a API) DeviceSetCpuAffinity(device Device) error

DeviceSetCpuAffinity sets the ideal affinity for the calling thread and device using the guidelines given in DeviceGetCPUAffinity(). Note, this is a change as of version 8.0. Older versions set the affinity for a calling process and all children. Currently supports up to 64 processors.

func (API) DeviceSetDefaultAutoBoostedClocksEnabled

func (a API) DeviceSetDefaultAutoBoostedClocksEnabled(device Device, enabled bool) error

DeviceSetDefaultAutoBoostedClocksEnabled tries to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will return to when no compute running processes (e.g. CUDA application which have an active context) are running.

func (API) DeviceSetDriverModel

func (a API) DeviceSetDriverModel(device Device, model DriverModel, flags uint32) error

DeviceSetDriverModel sets the driver model for the device. For windows only. Requires root/admin permissions. On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached to the device it must run in WDDM mode. It is possible to force the change to WDM (TCC) while the display is still attached with a force flag (nvmlFlagForce). This should only be done if the host is subsequently powered down and the display is detached from the device before the next reboot. This operation takes effect after the next reboot. Windows driver model may only be set to WDDM when running in DEFAULT compute mode. Change driver model to WDDM is not supported when GPU doesn't support graphics acceleration or will not support it after reboot.

func (API) DeviceSetECCMode

func (a API) DeviceSetECCMode(device Device, ecc bool) error

DeviceSetECCMode sets the ECC mode for the device. Only applicable to devices with ECC. Requires NVML_INFOROM_ECC version 1.0 or higher. Requires root/admin permissions. The ECC mode determines whether the GPU enables its ECC support. This operation takes effect after the next reboot.

func (API) DeviceSetGPUOperationMode

func (a API) DeviceSetGPUOperationMode(device Device, mode GPUOperationMode) error

DeviceSetGPUOperationMode sets new GOM. See nvmlGpuOperationMode_t for details. For GK110 M-class and X-class Tesla products from the Kepler family. Modes NVML_GOM_LOW_DP and NVML_GOM_ALL_ON are supported on fully supported GeForce products. Not supported on Quadro and Tesla C-class products. Requires root/admin permissions. Changing GOMs requires a reboot. The reboot requirement might be removed in the future. Compute only GOMs don't support graphics acceleration. Under windows switching to these GOMs when pending driver model is WDDM is not supported.

func (API) DeviceSetPersistenceMode

func (a API) DeviceSetPersistenceMode(device Device, mode bool) error

DeviceSetPersistenceMode sets the persistence mode for the device. For Linux only. Requires root/admin permissions. The persistence mode determines whether the GPU driver software is torn down after the last client exits. This operation takes effect immediately. It is not persistent across reboots. After each reboot the persistence mode is reset to "Disabled".

func (API) DeviceSetPowerManagementLimit

func (a API) DeviceSetPowerManagementLimit(device Device, limit uint32) error

DeviceSetPowerManagementLimit set new power limit of this device. Requires root/admin permissions. Note: Limit is not persistent across reboots or driver unloads. Enable persistent mode to prevent driver from unloading when no application is using the device.

func (API) DeviceValidateInforom

func (a API) DeviceValidateInforom(device Device) (err error)

DeviceValidateInforom reads the infoROM from the flash and verifies the checksums.

func (API) ErrorString

func (a API) ErrorString(result uintptr) string

ErrorString returns a string representation of the error.

func (API) Init

func (a API) Init() error

Init initializes NVML, but don't initialize any GPUs yet.

func (API) ReleaseDLL

func (a API) ReleaseDLL() error

func (API) Shutdown

func (a API) Shutdown() error

Shutdown shut downs NVML by releasing all GPU resources previously allocated with Init() and unloads nvml.dll via UnloadLibrary call.

func (API) SystemGetCudaDriverVersion

func (a API) SystemGetCudaDriverVersion() (cudaDriverVersion int32, err error)

SystemGetCudaDriverVersion retrieves the version of the CUDA driver. The returned CUDA driver version is the same as the CUDA API cuDriverGetVersion() would return on the system.

func (API) SystemGetDriverVersion

func (a API) SystemGetDriverVersion() (string, error)

SystemGetDriverVersion retrieves the version of the system's graphics driver.

func (API) SystemGetNVMLVersion

func (a API) SystemGetNVMLVersion() (string, error)

SystemGetNVMLVersion retrieves the version of the NVML library.

func (API) SystemGetProcessName

func (a API) SystemGetProcessName(pid uint) (string, error)

SystemGetProcessName gets name of the process with provided process id

type BAR1Memory

type BAR1Memory struct {
	Total uint64 // Total BAR1 Memory (in bytes)
	Free  uint64 // Unallocated BAR1 Memory (in bytes)
	Used  uint64 // Allocated Used Memory (in bytes)
}

BAR1Memory holds BAR1 memory allocation information for a device.

type BrandType

type BrandType int32

The Brand of the GPU.

func (BrandType) String

func (b BrandType) String() string

type ClockID

type ClockID int32

Clock Ids. These are used in combination with ClockType to specify a single clock value.

type ClockType

type ClockType int32

Clock types. All speeds are in Mhz.

type ClocksThrottleReason

type ClocksThrottleReason uint64

type ComputeMode

type ComputeMode int32

Compute mode.

type Device

type Device uintptr

Device represents native NVML device handle.

type DriverModel

type DriverModel int32

Driver models. Windows only.

type ECCCounterType

type ECCCounterType int32

ECC counter types. Note: Volatile counts are reset each time the driver loads. On Windows this is once per boot. On Linux this can be more frequent. On Linux the driver unloads when no active clients exist. If persistence mode is enabled or there is always a driver client active (e.g. X11), then Linux also sees per-boot behavior. If not, volatile counts are reset each time a compute app is run.

type ECCErrorCounts

type ECCErrorCounts struct {
	L1Cache      uint64 // L1 cache errors.
	L2Cache      uint64 // L2 cache errors.
	DeviceMemory uint64 // Device memory errors.
	RegisterFile uint64 // Register file errors.
}

Detailed ECC error counts for a device. Different GPU families can have different memory error counters.

type EncoderType

type EncoderType int32

Represents type of encoder for capacity can be queried.

type GPUOperationMode

type GPUOperationMode int32

GPUOperationMode represents GPU Operation Mode. GOM allows to reduce power usage and optimize GPU throughput by disabling GPU features. Each GOM is designed to meet specific user needs.

type GPUTopologyLevel

type GPUTopologyLevel int32

Represents level relationships within a system between two GPUs. The enums are spaced to allow for future relationships.

type InfoROMObject

type InfoROMObject int32

Available infoROM objects.

type Memory

type Memory struct {
	Total uint64 // Total installed FB memory (in bytes).
	Free  uint64 // Unallocated FB memory (in bytes).
	Used  uint64 // Allocated FB memory (in bytes).
}

Memory holds allocation information for a device.

type MemoryErrorType

type MemoryErrorType int32

Memory error types

type MemoryLocation

type MemoryLocation int32

Memory locations.

type PCIInfo

type PCIInfo struct {
	BusID string
	// The legacy tuple domain:bus:device.function PCI identifier
	BusIDLegacy string
	// The PCI domain on which the device's bus resides, 0 to 0xffffffff
	Domain uint32
	// The bus on which the device resides, 0 to 0xff
	Bus uint32
	// The device's id on the bus, 0 to 31
	Device uint32
	// The combined 16-bit device id and 16-bit vendor id
	PCIDeviceID uint32
	// The 32-bit Sub System Device ID. Added in NVML 2.285 API
	PCISubsystemID uint32
}

PCIInfo represents PCI information about a GPU device.

type PCIeUtilCounter

type PCIeUtilCounter int32

Represents the queryable PCIe utilization counters.

type PState

type PState int32

PState represents allowed PStates.

type PageRetirementCause

type PageRetirementCause int32

Causes for page retirement.

type PerfPolicyType

type PerfPolicyType int32

Represents type of perf policy for which violation times can be queried.

type ProcessInfo

type ProcessInfo struct {
	// Process ID
	PID uint32
	// Amount of used GPU memory in bytes. Under WDDM, NVML_VALUE_NOT_AVAILABLE is always reported because Windows KMD
	// manages all the memory and not the NVIDIA driver.
	UsedGPUMemory uint64
}

ProcessInfo holds information about running compute processes on the GPU.

func (ProcessInfo) MemoryInfoAvailable

func (i ProcessInfo) MemoryInfoAvailable() bool

type RestrictedAPI

type RestrictedAPI int32

API types that allow changes to default permission restrictions.

type TemperatureSensor

type TemperatureSensor int32

Temperature sensors.

type TemperatureThreshold

type TemperatureThreshold int32

Temperature thresholds.

type Utilization

type Utilization struct {
	GPU    uint32 // Percent of time over the past sample period during which one or more kernels was executing on the GPU.
	Memory uint32 // Percent of time over the past sample period during which global (device) memory was being read or written.
}

Utilization information for a device. Each sample period may be between 1 second and 1/6 second, depending on the product being queried.

type ViolationTime

type ViolationTime struct {
	ReferenceTime uint64 // ReferenceTime represents CPU timestamp in microseconds
	ViolationTime uint64 // ViolationTime in Nanoseconds
}

ViolationTime holds perf policy violation status data.

Jump to

Keyboard shortcuts

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