|
|
Modules
‣ NVML_ERROR_NOT_SUPPORTED if this is not an S-class product
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the fan speed readings for the unit.
For S-class products.
See nvmlUnitFanSpeeds_t for details on available fan speed info.
nvmlReturn_t nvmlUnitGetDevices (nvmlUnit_t unit,
unsigned int *deviceCount, nvmlDevice_t *devices)
Parameters
unit
The identifier of the target unit
deviceCount
Reference in which to provide the devices array size, and to return the number of
attached GPU devices
devices
Reference in which to return the references to the attached GPU devices
Returns
‣ NVML_SUCCESS if deviceCount and devices have been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INSUFFICIENT_SIZE if deviceCount indicates that the devices
array is too small
‣ NVML_ERROR_INVALID_ARGUMENT if unit is invalid, either of deviceCount or
devices is NULL
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the set of GPU devices that are attached to the specified unit.
For S-class products.
The deviceCount argument is expected to be set to the size of the input devices array.
112
Modules
4.16. Device Queries
This chapter describes that queries that NVML can perform against each device. In each
case the device is identified with an nvmlDevice_t handle. This handle is obtained by
calling one of nvmlDeviceGetHandleByIndex_v2(), nvmlDeviceGetHandleBySerial(),
nvmlDeviceGetHandleByPciBusId_v2(). or nvmlDeviceGetHandleByUUID().
struct nvmlTemperature_v1_t
CPU and Memory Affinity
nvmlReturn_t nvmlDeviceGetCount_v2 (unsigned int
*deviceCount)
Parameters
deviceCount
Reference in which to return the number of accessible devices
Returns
‣ NVML_SUCCESS if deviceCount has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if deviceCount is NULL
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the number of compute devices in the system. A compute device is a single
GPU.
For all products.
Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count
of all devices in the system even if nvmlDeviceGetHandleByIndex_v2 returns
NVML_ERROR_NO_PERMISSION for such device. Update your code to handle this
error, or use NVML 4.304 or older nvml header file. For backward binary compatibility
reasons _v1 version of the API is still present in the shared library. Old _v1 version of
nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
113
Modules
nvmlReturn_t nvmlDeviceGetAttributes_v2
(nvmlDevice_t device, nvmlDeviceAttributes_t
*attributes)
Parameters
device
NVML device handle
attributes
Device attributes
Returns
‣ NVML_SUCCESS if device attributes were successfully retrieved
‣ NVML_ERROR_INVALID_ARGUMENT if device handle is invalid
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Get attributes (engine counts etc.) for the given NVML device handle.
This API currently only supports MIG device handles.
For Ampere or newer fully supported devices. Supported on Linux only.
nvmlReturn_t nvmlDeviceGetHandleByIndex_v2
(unsigned int index, nvmlDevice_t *device)
Parameters
index
The index of the target GPU, >= 0 and < accessibleDevices
device
Reference in which to return the device handle
Returns
‣ NVML_SUCCESS if device has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if index is invalid or device is NULL
114
Modules
‣ NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly
attached external power cables
‣ NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this
device
‣ NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the
attached GPUs
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Acquire the handle for a particular device, based on its index.
For all products.
Valid indices are derived from the accessibleDevices count returned by
nvmlDeviceGetCount_v2(). For example, if accessibleDevices is 2 the valid indices are 0
and 1, corresponding to GPU 0 and GPU 1.
The order in which NVML enumerates devices has no guarantees of consistency
between reboots. For that reason it is recommended that devices be looked
up by their PCI ids or UUID. See nvmlDeviceGetHandleByUUID() and
nvmlDeviceGetHandleByPciBusId_v2().
Note: The NVML index may not correlate with other APIs, such as the CUDA device
index.
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: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count
of all devices in the system even if nvmlDeviceGetHandleByIndex_v2 returns
NVML_ERROR_NO_PERMISSION for such device. Update your code to handle this
error, or use NVML 4.304 or older nvml header file. For backward binary compatibility
reasons _v1 version of the API is still present in the shared library. Old _v1 version of
nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to.
This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices
for the same index. If you don't touch macros that map old (_v1) versions to _v2 versions
at the top of the file you don't need to worry about that.
See also:
nvmlDeviceGetIndex
nvmlDeviceGetCount
115
Modules
nvmlReturn_t nvmlDeviceGetHandleBySerial (const char
*serial, nvmlDevice_t *device)
Parameters
serial
The board serial number of the target GPU
device
Reference in which to return the device handle
Returns
‣ NVML_SUCCESS if device has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if serial is invalid, device is NULL or more
than one device has the same serial (dual GPU boards)
‣ NVML_ERROR_NOT_FOUND if serial does not match a valid device on the system
‣ NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly
attached external power cables
‣ NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the
attached GPUs
‣ NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise
inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Acquire the handle for a particular device, based on its board serial number.
For Fermi or newer fully supported devices.
This number corresponds to the value printed directly on the board, and to the value
returned by nvmlDeviceGetSerial().
Deprecated Since more than one GPU can exist on a single board this function is
deprecated in favor of nvmlDeviceGetHandleByUUID. For dual GPU boards this
function will return NVML_ERROR_INVALID_ARGUMENT.
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
See also:
nvmlDeviceGetSerial
nvmlDeviceGetHandleByUUID
116
Modules
nvmlReturn_t nvmlDeviceGetHandleByUUID (const char
*uuid, nvmlDevice_t *device)
Parameters
uuid
The UUID of the target GPU or MIG instance
device
Reference in which to return the device handle or MIG device handle
Returns
‣ NVML_SUCCESS if device has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if uuid is invalid or device is null
‣ NVML_ERROR_NOT_FOUND if uuid does not match a valid device on the system
‣ NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly
attached external power cables
‣ NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the
attached GPUs
‣ NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise
inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Acquire the handle for a particular device, based on its globally unique immutable
UUID (in ASCII format) associated with each device.
For all products.
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
See also:
nvmlDeviceGetUUID
117
Modules
nvmlReturn_t nvmlDeviceGetHandleByUUIDV (const
nvmlUUID_t *uuid, nvmlDevice_t *device)
Parameters
uuid
The UUID of the target GPU or MIG instance
device
Reference in which to return the device handle or MIG device handle
Returns
‣ NVML_SUCCESS if device has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if uuid is invalid, device is null or uuid-
>type is invalid
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the provided version is
invalid/unsupported
‣ NVML_ERROR_NOT_FOUND if uuid does not match a valid device on the system
‣ NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise
inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Acquire the handle for a particular device, based on its globally unique immutable
UUID (in either ASCII or binary format) associated with each device. See
nvmlUUID_v1_t for more information on the UUID struct. The caller must set the
appropriate version prior to calling this API.
For all products.
This API causes NVML to initialize the target GPU NVML may initialize additional
GPUs as it searches for the target GPU
nvmlReturn_t nvmlDeviceGetHandleByPciBusId_v2
(const char *pciBusId, nvmlDevice_t *device)
Parameters
pciBusId
The PCI bus id of the target GPU Accept the following formats (all numbers in
hexadecimal): domain:bus:device.function in format x:x:x.x domain:bus:device in
format x:x:x bus:device.function in format x:x.x
118
Modules
device
Reference in which to return the device handle
Returns
‣ NVML_SUCCESS if device has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if pciBusId is invalid or device is NULL
‣ NVML_ERROR_NOT_FOUND if pciBusId does not match a valid device on the
system
‣ NVML_ERROR_INSUFFICIENT_POWER if the attached device has improperly
attached external power cables
‣ NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this
device
‣ NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the
attached GPUs
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Acquire the handle for a particular device, based on its PCI bus id.
For all products.
This value corresponds to the nvmlPciInfo_t::busId returned by
nvmlDeviceGetPciInfo_v3().
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
NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns
NVML_ERROR_NOT_FOUND instead of NVML_ERROR_NO_PERMISSION.
nvmlReturn_t nvmlDeviceGetName (nvmlDevice_t
device, char *name, unsigned int length)
Parameters
device
The identifier of the target device
119
Modules
name
Reference in which to return the product name
length
The maximum allowed length of the string returned in name
Returns
‣ NVML_SUCCESS if name has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or name is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the name of this device.
For all products.
The name is an alphanumeric string that denotes a particular product, e.g. Tesla
C2070. It will not exceed 96 characters in length (including the NULL terminator). See
nvmlConstants::NVML_DEVICE_NAME_V2_BUFFER_SIZE.
When used with MIG device handles the API returns MIG device names which can be
used to identify devices based on their attributes.
nvmlReturn_t nvmlDeviceGetBrand (nvmlDevice_t
device, nvmlBrandType_t *type)
Parameters
device
The identifier of the target device
type
Reference in which to return the product brand type
Returns
‣ NVML_SUCCESS if name has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or type is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
120
Modules
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the brand of this device.
For all products.
The type is a member of nvmlBrandType_t defined above.
nvmlReturn_t nvmlDeviceGetIndex (nvmlDevice_t
device, unsigned int *index)
Parameters
device
The identifier of the target device
index
Reference in which to return the NVML index of the device
Returns
‣ NVML_SUCCESS if index has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or index is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the NVML index of this device.
For all products.
Valid indices are derived from the accessibleDevices count returned by
nvmlDeviceGetCount_v2(). For example, if accessibleDevices is 2 the valid indices are 0
and 1, corresponding to GPU 0 and GPU 1.
The order in which NVML enumerates devices has no guarantees of consistency
between reboots. For that reason it is recommended that devices be looked up
by their PCI ids or GPU UUID. See nvmlDeviceGetHandleByPciBusId_v2() and
nvmlDeviceGetHandleByUUID().
When used with MIG device handles this API returns indices that can be passed to
nvmlDeviceGetMigDeviceHandleByIndex to retrieve an identical handle. MIG device
indices are unique within a device.
121
Modules
Note: The NVML index may not correlate with other APIs, such as the CUDA device
index.
See also:
nvmlDeviceGetHandleByIndex()
nvmlDeviceGetCount()
nvmlReturn_t nvmlDeviceGetSerial (nvmlDevice_t
device, char *serial, unsigned int length)
Parameters
device
The identifier of the target device
serial
Reference in which to return the board/module serial number
length
The maximum allowed length of the string returned in serial
Returns
‣ NVML_SUCCESS if serial has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or serial is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the globally unique board serial number associated with this device's board.
For all products with an inforom.
The serial number is an alphanumeric string that will not exceed 30
characters (including the NULL terminator). This number matches
the serial number tag that is physically attached to the board. See
nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE.
122
Modules
nvmlReturn_t nvmlDeviceGetModuleId (nvmlDevice_t
device, unsigned int *moduleId)
Parameters
device
The identifier of the target device
moduleId
Unique identifier for the GPU module
Returns
‣ NVML_SUCCESS if moduleId has been successfully retrieved
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device or moduleId is invalid
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Get a unique identifier for the device module on the baseboard
This API retrieves a unique identifier for each GPU module that exists on a given
baseboard. For non-baseboard products, this ID would always be 0.
nvmlReturn_t nvmlDeviceGetC2cModeInfoV
(nvmlDevice_t device, nvmlC2cModeInfo_v1_t
*c2cModeInfo)
Parameters
device
The identifier of the target device
c2cModeInfo
Output struct containing the device's C2C Mode info
Returns
‣ NVML_SUCCESS if C2C Mode Infor query is successful
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or serial is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
123
Modules
Description
Retrieves the Device's C2C Mode information
nvmlReturn_t nvmlDeviceGetTopologyCommonAncestor
(nvmlDevice_t device1, nvmlDevice_t device2,
nvmlGpuTopologyLevel_t *pathInfo)
Parameters
device1
The identifier of the first device
device2
The identifier of the second device
pathInfo
A nvmlGpuTopologyLevel_t that gives the path type
Returns
‣ NVML_SUCCESS if pathInfo has been set
‣ NVML_ERROR_INVALID_ARGUMENT if device1, or device2 is invalid, or
pathInfo is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this
feature
‣ NVML_ERROR_UNKNOWN an error has occurred in underlying topology
discovery
Description
Retrieve the common ancestor for two devices For all products. Supported on Linux
only.
nvmlReturn_t nvmlDeviceGetTopologyNearestGpus
(nvmlDevice_t device, nvmlGpuTopologyLevel_t level,
unsigned int *count, nvmlDevice_t *deviceArray)
Parameters
device
The identifier of the first device
level
The nvmlGpuTopologyLevel_t level to search for other GPUs
124
Modules
count
When zero, is set to the number of matching GPUs such that deviceArray can be
malloc'd. When non-zero, deviceArray will be filled with count number of device
handles.
deviceArray
An array of device handles for GPUs found at level
Returns
‣ NVML_SUCCESS if deviceArray or count (if initially zero) has been set
‣ NVML_ERROR_INVALID_ARGUMENT if device, level, or count is invalid, or
deviceArray is NULL with a non-zero count
‣ NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this
feature
‣ NVML_ERROR_UNKNOWN an error has occurred in underlying topology
discovery
Description
Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity
level For all products. Supported on Linux only.
nvmlReturn_t nvmlDeviceGetP2PStatus
(nvmlDevice_t device1, nvmlDevice_t device2,
nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t
*p2pStatus)
Parameters
device1
The first device
device2
The second device
p2pIndex
p2p Capability Index being looked for between device1 and device2
p2pStatus
Reference in which to return the status of the p2pIndex between device1 and device2
Returns
‣ NVML_SUCCESS if p2pStatus has been populated
‣ NVML_ERROR_INVALID_ARGUMENT if device1 or device2 or p2pIndex is
invalid or p2pStatus is NULL
125
Modules
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve the status for a given p2p capability index between a given pair of GPU
nvmlReturn_t nvmlDeviceGetUUID (nvmlDevice_t
device, char *uuid, unsigned int length)
Parameters
device
The identifier of the target device
uuid
Reference in which to return the GPU UUID
length
The maximum allowed length of the string returned in uuid
Returns
‣ NVML_SUCCESS if uuid has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or uuid is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the globally unique immutable UUID associated with this device, as a 5 part
hexadecimal string, that augments the immutable, board serial identifier.
For all products.
The UUID is a globally unique identifier. It is the only available identifier for pre-
Fermi-architecture products. It does NOT correspond to any identifier printed on the
board. It will not exceed 96 characters in length (including the NULL terminator). See
nvmlConstants::NVML_DEVICE_UUID_V2_BUFFER_SIZE.
When used with MIG device handles the API returns globally unique UUIDs which
can be used to identify MIG devices across both GPU and MIG devices. UUIDs are
immutable for the lifetime of a MIG device.
126
Modules
nvmlReturn_t nvmlDeviceGetMinorNumber
(nvmlDevice_t device, unsigned int *minorNumber)
Parameters
device
The identifier of the target device
minorNumber
Reference in which to return the minor number for the device
Returns
‣ NVML_SUCCESS if the minor number is successfully retrieved
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or minorNumber is
NULL
‣ NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
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].
For all products. Supported only for Linux
nvmlReturn_t nvmlDeviceGetBoardPartNumber
(nvmlDevice_t device, char *partNumber, unsigned int
length)
Parameters
device
Identifier of the target device
partNumber
Reference to the buffer to return
length
Length of the buffer reference
127
Modules
Returns
‣ NVML_SUCCESS if partNumber has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_NOT_SUPPORTED if the needed VBIOS fields have not been filled
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or serial is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the the device board part number which is programmed into the board's
InfoROM
For all products.
nvmlReturn_t nvmlDeviceGetInforomVersion
(nvmlDevice_t device, nvmlInforomObject_t object,
char *version, unsigned int length)
Parameters
device
The identifier of the target device
object
The target infoROM object
version
Reference in which to return the infoROM version
length
The maximum allowed length of the string returned in version
Returns
‣ NVML_SUCCESS if version has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if version is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
128
Modules
Description
Retrieves the version information for the device's infoROM object.
For all products with an inforom.
Fermi and higher parts have non-volatile on-board memory for persisting
device info, such as aggregate ECC counts. The version of the data
structures in this memory may change from time to time. It will not
exceed 16 characters in length (including the NULL terminator). See
nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
See nvmlInforomObject_t for details on the available infoROM objects.
See also:
nvmlDeviceGetInforomImageVersion
nvmlReturn_t nvmlDeviceGetInforomImageVersion
(nvmlDevice_t device, char *version, unsigned int
length)
Parameters
device
The identifier of the target device
version
Reference in which to return the infoROM image version
length
The maximum allowed length of the string returned in version
Returns
‣ NVML_SUCCESS if version has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if version is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the global infoROM image version
129
Modules
For all products with an inforom.
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. Version string will not
exceed 16 characters in length (including the NULL terminator). See
nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE.
See also:
nvmlDeviceGetInforomVersion
nvmlReturn_t
nvmlDeviceGetInforomConfigurationChecksum
(nvmlDevice_t device, unsigned int *checksum)
Parameters
device
The identifier of the target device
checksum
Reference in which to return the infoROM configuration checksum
Returns
‣ NVML_SUCCESS if checksum has been set
‣ NVML_ERROR_CORRUPTED_INFOROM if the device's checksum couldn't be
retrieved due to infoROM corruption
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if checksum is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the checksum of the configuration stored in the device's infoROM.
For all products with an 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)
130
Modules
nvmlReturn_t nvmlDeviceValidateInforom (nvmlDevice_t
device)
Parameters
device
The identifier of the target device
Returns
‣ NVML_SUCCESS if infoROM is not corrupted
‣ NVML_ERROR_CORRUPTED_INFOROM if the device's infoROM is corrupted
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Reads the infoROM from the flash and verifies the checksums.
For all products with an inforom.
nvmlReturn_t nvmlDeviceGetLastBBXFlushTime
(nvmlDevice_t device, unsigned long long *timestamp,
unsignedlong *durationUs)
Parameters
device
The identifier of the target device
timestamp
The start timestamp of the last BBX Flush
durationUs
The duration (us) of the last BBX Flush
Returns
‣ NVML_SUCCESS if timestamp and durationUs are successfully retrieved
‣ NVML_ERROR_NOT_READY if the BBX object has not been flushed yet
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM
Modules
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the timestamp and the duration of the last flush of the BBX (blackbox)
infoROM object during the current run.
For all products with an inforom.
See also:
nvmlDeviceGetInforomVersion
nvmlReturn_t nvmlDeviceGetDisplayMode (nvmlDevice_t
device, nvmlEnableState_t *display)
Parameters
device
The identifier of the target device
display
Reference in which to return the display mode
Returns
‣ NVML_SUCCESS if display has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or display is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the display mode for the device.
For all products.
This method indicates whether a physical display (e.g. monitor) is currently connected
to any of the device's connectors.
See nvmlEnableState_t for details on allowed modes.
132
Modules
nvmlReturn_t nvmlDeviceGetDisplayActive
(nvmlDevice_t device, nvmlEnableState_t *isActive)
Parameters
device
The identifier of the target device
isActive
Reference in which to return the display active state
Returns
‣ NVML_SUCCESS if isActive has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or isActive is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the display active state for the device.
For all products.
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.
See nvmlEnableState_t for details on allowed modes.
nvmlReturn_t nvmlDeviceGetPersistenceMode
(nvmlDevice_t device, nvmlEnableState_t *mode)
Parameters
device
The identifier of the target device
mode
Reference in which to return the current driver persistence mode
133
Modules
Returns
‣ NVML_SUCCESS if mode has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or mode is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the persistence mode associated with this device.
For all products. For Linux only.
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.
See nvmlEnableState_t for details on allowed modes.
See also:
nvmlDeviceSetPersistenceMode()
nvmlReturn_t nvmlDeviceGetPciInfoExt (nvmlDevice_t
device, nvmlPciInfoExt_t *pci)
Parameters
device
The identifier of the target device
pci
Reference in which to return the PCI info
Returns
‣ NVML_SUCCESS if pci has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or pci is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
134
Modules
Description
Retrieves PCI attributes of this device.
For all products.
See nvmlPciInfoExt_v1_t for details on the available PCI info.
nvmlReturn_t nvmlDeviceGetPciInfo_v3 (nvmlDevice_t
device, nvmlPciInfo_t *pci)
Parameters
device
The identifier of the target device
pci
Reference in which to return the PCI info
Returns
‣ NVML_SUCCESS if pci has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or pci is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the PCI attributes of this device.
For all products.
See nvmlPciInfo_t for details on the available PCI info.
nvmlReturn_t nvmlDeviceGetMaxPcieLinkGeneration
(nvmlDevice_t device, unsigned int *maxLinkGen)
Parameters
device
The identifier of the target device
maxLinkGen
Reference in which to return the max PCIe link generation
135
Modules
Returns
‣ NVML_SUCCESS if maxLinkGen has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or maxLinkGen is null
‣ NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
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.
For Fermi or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetGpuMaxPcieLinkGeneration
(nvmlDevice_t device, unsigned int *maxLinkGenDevice)
Parameters
device
The identifier of the target device
maxLinkGenDevice
Reference in which to return the max PCIe link generation
Returns
‣ NVML_SUCCESS if maxLinkGenDevice has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or maxLinkGenDevice
is null
‣ NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the maximum PCIe link generation supported by this device
For Fermi or newer fully supported devices.
136
Modules
nvmlReturn_t nvmlDeviceGetMaxPcieLinkWidth
(nvmlDevice_t device, unsigned int *maxLinkWidth)
Parameters
device
The identifier of the target device
maxLinkWidth
Reference in which to return the max PCIe link generation
Returns
‣ NVML_SUCCESS if maxLinkWidth has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or maxLinkWidth is
null
‣ NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
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.
For Fermi or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetCurrPcieLinkGeneration
(nvmlDevice_t device, unsigned int *currLinkGen)
Parameters
device
The identifier of the target device
currLinkGen
Reference in which to return the current PCIe link generation
Returns
‣ NVML_SUCCESS if currLinkGen has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
137
Modules
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or currLinkGen is null
‣ NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current PCIe link generation
For Fermi or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetCurrPcieLinkWidth
(nvmlDevice_t device, unsigned int *currLinkWidth)
Parameters
device
The identifier of the target device
currLinkWidth
Reference in which to return the current PCIe link generation
Returns
‣ NVML_SUCCESS if currLinkWidth has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or currLinkWidth is
null
‣ NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current PCIe link width
For Fermi or newer fully supported devices.
138
Modules
nvmlReturn_t nvmlDeviceGetPcieThroughput
(nvmlDevice_t device, nvmlPcieUtilCounter_t counter,
unsigned int *value)
Parameters
device
The identifier of the target device
counter
The specific counter that should be queried nvmlPcieUtilCounter_t
value
Reference in which to return throughput in KB/s
Returns
‣ NVML_SUCCESS if value has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device or counter is invalid, or value is
NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve PCIe utilization information. This function is querying a byte counter over a
20ms interval and thus is the PCIe throughput over that interval.
For Maxwell or newer fully supported devices.
This method is not supported in virtual machines running virtual GPU (vGPU).
nvmlReturn_t nvmlDeviceGetPcieReplayCounter
(nvmlDevice_t device, unsigned int *value)
Parameters
device
The identifier of the target device
value
Reference in which to return the counter's value
139
Modules
Returns
‣ NVML_SUCCESS if value has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or value is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve the PCIe replay counter.
For Kepler or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetClockInfo (nvmlDevice_t
device, nvmlClockType_t type, unsigned int *clock)
Parameters
device
The identifier of the target device
type
Identify which clock domain to query
clock
Reference in which to return the clock speed in MHz
Returns
‣ NVML_SUCCESS if clock has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clock is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current clock speeds for the device.
For Fermi or newer fully supported devices.
See nvmlClockType_t for details on available clock information.
140
Modules
nvmlReturn_t nvmlDeviceGetMaxClockInfo
(nvmlDevice_t device, nvmlClockType_t type, unsigned
int *clock)
Parameters
device
The identifier of the target device
type
Identify which clock domain to query
clock
Reference in which to return the clock speed in MHz
Returns
‣ NVML_SUCCESS if clock has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clock is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the maximum clock speeds for the device.
For Fermi or newer fully supported devices.
See nvmlClockType_t for details on available clock information.
On GPUs from Fermi family current P0 clocks (reported by nvmlDeviceGetClockInfo)
can differ from max clocks by few MHz.
nvmlReturn_t nvmlDeviceGetGpcClkVfOffset
(nvmlDevice_t device, int *offset)
Parameters
device
The identifier of the target device
141
Modules
offset
The retrieved GPCCLK VF offset value
Returns
‣ NVML_SUCCESS if offset has been successfully queried
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or offset is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve the GPCCLK VF offset value
nvmlReturn_t nvmlDeviceGetApplicationsClock
(nvmlDevice_t device, nvmlClockType_t clockType,
unsigned int *clockMHz)
Parameters
device
The identifier of the target device
clockType
Identify which clock domain to query
clockMHz
Reference in which to return the clock in MHz
Returns
‣ NVML_SUCCESS if clockMHz has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clockMHz is NULL
or clockType is invalid
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current setting of a clock that applications will use unless an overspec
situation occurs. Can be changed using nvmlDeviceSetApplicationsClocks.
For Kepler or newer fully supported devices.
142
Modules
nvmlReturn_t nvmlDeviceGetDefaultApplicationsClock
(nvmlDevice_t device, nvmlClockType_t clockType,
unsigned int *clockMHz)
Parameters
device
The identifier of the target device
clockType
Identify which clock domain to query
clockMHz
Reference in which to return the default clock in MHz
Returns
‣ NVML_SUCCESS if clockMHz has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clockMHz is NULL
or clockType is invalid
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the default applications clock that GPU boots with or defaults to after
nvmlDeviceResetApplicationsClocks call.
For Kepler or newer fully supported devices.
See also:
nvmlDeviceGetApplicationsClock
143
Modules
nvmlReturn_t nvmlDeviceGetClock (nvmlDevice_t
device, nvmlClockType_t clockType, nvmlClockId_t
clockId, unsigned int *clockMHz)
Parameters
device
The identifier of the target device
clockType
Identify which clock domain to query
clockId
Identify which clock in the domain to query
clockMHz
Reference in which to return the clock in MHz
Returns
‣ NVML_SUCCESS if clockMHz has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clockMHz is NULL
or clockType is invalid
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the clock speed for the clock specified by the clock type and clock ID.
For Kepler or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetMaxCustomerBoostClock
(nvmlDevice_t device, nvmlClockType_t clockType,
unsigned int *clockMHz)
Parameters
device
The identifier of the target device
clockType
Identify which clock domain to query
144
Modules
clockMHz
Reference in which to return the clock in MHz
Returns
‣ NVML_SUCCESS if clockMHz has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clockMHz is NULL
or clockType is invalid
‣ NVML_ERROR_NOT_SUPPORTED if the device or the clockType on this device
does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the customer defined maximum boost clock speed specified by the given clock
type.
For Pascal or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetSupportedMemoryClocks
(nvmlDevice_t device, unsigned int *count, unsigned int
*clocksMHz)
Parameters
device
The identifier of the target device
count
Reference in which to provide the clocksMHz array size, and to return the number of
elements
clocksMHz
Reference in which to return the clock in MHz
Returns
‣ NVML_SUCCESS if count and clocksMHz have been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or count is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_INSUFFICIENT_SIZE if count is too small (count is set to the
number of required elements)
145
Modules
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the list of possible memory clocks that can be used as an argument for
nvmlDeviceSetApplicationsClocks.
For Kepler or newer fully supported devices.
See also:
nvmlDeviceSetApplicationsClocks
nvmlDeviceGetSupportedGraphicsClocks
nvmlReturn_t nvmlDeviceGetSupportedGraphicsClocks
(nvmlDevice_t device, unsigned int memoryClockMHz,
unsigned int *count, unsigned int *clocksMHz)
Parameters
device
The identifier of the target device
memoryClockMHz
Memory clock for which to return possible graphics clocks
count
Reference in which to provide the clocksMHz array size, and to return the number of
elements
clocksMHz
Reference in which to return the clocks in MHz
Returns
‣ NVML_SUCCESS if count and clocksMHz have been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_NOT_FOUND if the specified memoryClockMHz is not a
supported frequency
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clock is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_INSUFFICIENT_SIZE if count is too small
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
146
Modules
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the list of possible graphics clocks that can be used as an argument for
nvmlDeviceSetApplicationsClocks.
For Kepler or newer fully supported devices.
See also:
nvmlDeviceSetApplicationsClocks
nvmlDeviceGetSupportedMemoryClocks
nvmlReturn_t nvmlDeviceGetAutoBoostedClocksEnabled
(nvmlDevice_t device, nvmlEnableState_t *isEnabled,
nvmlEnableState_t *defaultIsEnabled)
Parameters
device
The identifier of the target device
isEnabled
Where to store the current state of Auto Boosted clocks of the target device
defaultIsEnabled
Where to store the default Auto Boosted clocks behavior of the target device that the
device will revert to when no applications are using the GPU
Returns
‣ NVML_SUCCESS If isEnabled has been been set with the Auto Boosted clocks state
of device
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or isEnabled is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted
clocks
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve the current state of Auto Boosted clocks on a device and store it in isEnabled
For Kepler or newer fully supported devices.
147
Modules
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. Use nvmlDeviceSetApplicationsClocks and nvmlDeviceResetApplicationsClocks
to control Auto Boost behavior.
nvmlReturn_t nvmlDeviceGetFanSpeed (nvmlDevice_t
device, unsigned int *speed)
Parameters
device
The identifier of the target device
speed
Reference in which to return the fan speed percentage
Returns
‣ NVML_SUCCESS if speed has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or speed is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have a fan
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
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.
For all discrete products with dedicated fans.
The fan speed is expressed as a percentage of the product's maximum noise tolerance
fan speed. This value may exceed 100% in certain cases.
148
Modules
nvmlReturn_t nvmlDeviceGetFanSpeed_v2
(nvmlDevice_t device, unsigned int fan, unsigned int
*speed)
Parameters
device
The identifier of the target device
fan
The index of the target fan, zero indexed.
speed
Reference in which to return the fan speed percentage
Returns
‣ NVML_SUCCESS if speed has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, fan is not an acceptable
index, or speed is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer
than Maxwell
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the intended operating speed of the device's specified 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.
For all discrete products with dedicated fans.
The fan speed is expressed as a percentage of the product's maximum noise tolerance
fan speed. This value may exceed 100% in certain cases.
149
Modules
nvmlReturn_t nvmlDeviceGetFanSpeedRPM
(nvmlDevice_t device, nvmlFanSpeedInfo_t *fanSpeed)
Parameters
device
The identifier of the target device
fanSpeed
Structure specifying the index of the target fan (input) and retrieved fan speed value
(output)
Returns
‣ NVML_SUCCESS If everything worked
‣ NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT If device is invalid, fan is not an acceptable
index, or speed is NULL
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is
invalid/unsupported
‣ NVML_ERROR_NOT_SUPPORTED If the device does not support this feature
Description
Retrieves the intended operating speed in rotations per minute (RPM) of the device's
specified fan.
For Maxwell or newer fully supported devices.
For all discrete products with dedicated fans.
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.
nvmlReturn_t nvmlDeviceGetTargetFanSpeed
(nvmlDevice_t device, unsigned int fan, unsigned int
*targetSpeed)
Parameters
device
The identifier of the target device
fan
The index of the target fan, zero indexed.
150
Modules
targetSpeed
Reference in which to return the fan speed percentage
Returns
‣ NVML_SUCCESS if speed has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, fan is not an acceptable
index, or speed is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer
than Maxwell
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the intended target speed of the device's specified fan.
Normally, the driver dynamically adjusts the fan based on the needs of the GPU. But
when user set fan speed using nvmlDeviceSetFanSpeed_v2, the driver will attempt to
make the fan achieve the setting in nvmlDeviceSetFanSpeed_v2. The actual current
speed of the fan is reported in nvmlDeviceGetFanSpeed_v2.
For all discrete products with dedicated fans.
The fan speed is expressed as a percentage of the product's maximum noise tolerance
fan speed. This value may exceed 100% in certain cases.
nvmlReturn_t nvmlDeviceGetMinMaxFanSpeed
(nvmlDevice_t device, unsigned int *minSpeed, unsigned
int *maxSpeed)
Parameters
device
The identifier of the target device
minSpeed
The minimum speed allowed to set
maxSpeed
The maximum speed allowed to set
Description
Retrieves the min and max fan speed that user can set for the GPU fan.
151
Modules
For all cuda-capable discrete products with fans
return NVML_SUCCESS if speed has been adjusted
NVML_ERROR_UNINITIALIZED if the library has not been successfully
initialized NVML_ERROR_INVALID_ARGUMENT if device is invalid
NVML_ERROR_NOT_SUPPORTED if the device does not support this (doesn't have
fans) NVML_ERROR_UNKNOWN on any unexpected error
nvmlReturn_t nvmlDeviceGetFanControlPolicy_v2
(nvmlDevice_t device, unsigned int fan,
nvmlFanControlPolicy_t *policy)
Description
Gets current fan control policy.
For Maxwell or newer fully supported devices.
For all cuda-capable discrete products with fans
device The identifier of the target device policy Reference in which to return the fan
control policy
return NVML_SUCCESS if policy has been populated
NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
NVML_ERROR_INVALID_ARGUMENT if device is invalid or policy is null or the
fan given doesn't reference a fan that exists. NVML_ERROR_NOT_SUPPORTED if the
device is older than Maxwell NVML_ERROR_UNKNOWN on any unexpected error
nvmlReturn_t nvmlDeviceGetNumFans (nvmlDevice_t
device, unsigned int *numFans)
Parameters
device
The identifier of the target device
numFans
The number of fans
Returns
‣ NVML_SUCCESS if fan number query was successful
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or numFans is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have a fan
152
Modules
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the number of fans on the device.
For all discrete products with dedicated fans.
nvmlReturn_t nvmlDeviceGetTemperature
(nvmlDevice_t device, nvmlTemperatureSensors_t
sensorType, unsigned int *temp)
Description
Deprecated Use nvmlDeviceGetTemperatureV instead
nvmlReturn_t nvmlDeviceGetCoolerInfo (nvmlDevice_t
device, nvmlCoolerInfo_t *coolerInfo)
Parameters
device
The identifier of the target device
coolerInfo
Structure specifying the cooler's control signal characteristics (out) and the target that
cooler cools (out)
Returns
‣ NVML_SUCCESS If everything worked
‣ NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT If device is invalid, signalType or target is
NULL
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is
invalid/unsupported
‣ NVML_ERROR_NOT_SUPPORTED If the device does not support this feature
Description
Retrieves the cooler's information. Returns a cooler's control signal characteristics.
The possible types are restricted, Variable and Toggle. See nvmlCoolerControl_t for
153
Modules
details on available signal types. Returns objects that cooler cools. Targets may be GPU,
Memory, Power Supply or All of these. See nvmlCoolerTarget_t for details on available
targets.
For Maxwell or newer fully supported devices.
For all discrete products with dedicated fans.
nvmlReturn_t nvmlDeviceGetTemperatureV
(nvmlDevice_t device, nvmlTemperature_t
*temperature)
Parameters
device
Target device identifier.
temperature
Structure specifying the sensor type (input) and retrieved temperature value (output).
Returns
‣ NVML_SUCCESS if temp has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, sensorType is invalid
or temp is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have the specified sensor
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current temperature readings (in degrees C) for the given device.
For all products.
154
Modules
nvmlReturn_t nvmlDeviceGetTemperatureThreshold
(nvmlDevice_t device, nvmlTemperatureThresholds_t
thresholdType, unsigned int *temp)
Parameters
device
The identifier of the target device
thresholdType
The type of threshold value queried
temp
Reference in which to return the temperature reading
Returns
‣ NVML_SUCCESS if temp has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, thresholdType is
invalid or temp is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not have a temperature
sensor or is unsupported
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the temperature threshold for the GPU with the specified threshold type in
degrees C.
For Kepler or newer fully supported devices.
See nvmlTemperatureThresholds_t for details on available temperature thresholds.
Note: This API is no longer the preferred interface for retrieving the
following temperature thresholds on Ada and later architectures:
NVML_TEMPERATURE_THRESHOLD_SHUTDOWN,
NVML_TEMPERATURE_THRESHOLD_SLOWDOWN,
NVML_TEMPERATURE_THRESHOLD_MEM_MAX and
NVML_TEMPERATURE_THRESHOLD_GPU_MAX.
Support for reading these temperature thresholds for Ada and later architectures would
be removed from this API in future releases. Please use nvmlDeviceGetFieldValues with
NVML_FI_DEV_TEMPERATURE_* fields to retrieve temperature thresholds on these
architectures.
155
Modules
nvmlReturn_t nvmlDeviceGetMarginTemperature
(nvmlDevice_t device, nvmlMarginTemperature_t
*marginTempInfo)
Parameters
device
The identifier of the target device
marginTempInfo
Versioned structure in which to return the temperature reading
Returns
‣ NVML_SUCCESS if the margin temperature was retrieved successfully
‣ NVML_ERROR_NOT_SUPPORTED if request is not supported on the current
platform
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or temperature is
NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the right versioned
structure is not used
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the thermal margin temperature (distance to nearest slowdown threshold).
nvmlReturn_t nvmlDeviceGetThermalSettings
(nvmlDevice_t device, unsigned int sensorIndex,
nvmlGpuThermalSettings_t *pThermalSettings)
Parameters
device
The identifier of the target device
sensorIndex
The index of the thermal sensor
pThermalSettings
Reference in which to return the thermal sensor information
156
Modules
Returns
‣ NVML_SUCCESS if pThermalSettings has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or pThermalSettings is
NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Used to execute a list of thermal system instructions.
nvmlReturn_t nvmlDeviceGetPerformanceState
(nvmlDevice_t device, nvmlPstates_t *pState)
Parameters
device
The identifier of the target device
pState
Reference in which to return the performance state reading
Returns
‣ NVML_SUCCESS if pState has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or pState is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current performance state for the device.
For Fermi or newer fully supported devices.
See nvmlPstates_t for details on allowed performance states.
157
Modules
nvmlReturn_t nvmlDeviceGetCurrentClocksEventReasons
(nvmlDevice_t device, unsigned long long
*clocksEventReasons)
Parameters
device
The identifier of the target device
clocksEventReasons
Reference in which to return bitmask of active clocks event reasons
Returns
‣ NVML_SUCCESS if clocksEventReasons has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or clocksEventReasons
is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves current clocks event reasons.
For all fully supported products.
More than one bit can be enabled at the same time. Multiple reasons can be affecting
clocks at once.
See also:
NvmlClocksEventReasons
nvmlDeviceGetSupportedClocksEventReasons
nvmlReturn_t
nvmlDeviceGetCurrentClocksThrottleReasons
158
Modules
(nvmlDevice_t device, unsigned long long
*clocksThrottleReasons)
Description
Deprecated Use nvmlDeviceGetCurrentClocksEventReasons instead
nvmlReturn_t
nvmlDeviceGetSupportedClocksEventReasons
(nvmlDevice_t device, unsigned long long
*supportedClocksEventReasons)
Parameters
device
The identifier of the target device
supportedClocksEventReasons
Reference in which to return bitmask of supported clocks event reasons
Returns
‣ NVML_SUCCESS if supportedClocksEventReasons has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or
supportedClocksEventReasons is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves bitmask of supported clocks event reasons that can be returned by
nvmlDeviceGetCurrentClocksEventReasons
For all fully supported products.
This method is not supported in virtual machines running virtual GPU (vGPU).
See also:
NvmlClocksEventReasons
nvmlDeviceGetCurrentClocksEventReasons
159
Modules
nvmlReturn_t
nvmlDeviceGetSupportedClocksThrottleReasons
(nvmlDevice_t device, unsigned long long
*supportedClocksThrottleReasons)
Description
Deprecated Use nvmlDeviceGetSupportedClocksEventReasons instead
nvmlReturn_t nvmlDeviceGetPowerState (nvmlDevice_t
device, nvmlPstates_t *pState)
Parameters
device
The identifier of the target device
pState
Reference in which to return the performance state reading
Returns
‣ NVML_SUCCESS if pState has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or pState is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Deprecated: Use nvmlDeviceGetPerformanceState. This function exposes an incorrect
generalization.
Retrieve the current performance state for the device.
For Fermi or newer fully supported devices.
See nvmlPstates_t for details on allowed performance states.
160
Modules
nvmlReturn_t nvmlDeviceGetDynamicPstatesInfo
(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t
*pDynamicPstatesInfo)
Parameters
device
pDynamicPstatesInfo
Returns
‣ NVML_SUCCESS if pDynamicPstatesInfo has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or
pDynamicPstatesInfo is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve performance monitor samples from the associated subdevice.
nvmlReturn_t nvmlDeviceGetMemClkVfOffset
(nvmlDevice_t device, int *offset)
Parameters
device
The identifier of the target device
offset
The retrieved MemClk VF offset value
Returns
‣ NVML_SUCCESS if offset has been successfully queried
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or offset is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_UNKNOWN on any unexpected error
161
Modules
Description
Retrieve the MemClk (Memory Clock) VF offset value.
nvmlReturn_t nvmlDeviceGetMinMaxClockOfPState
(nvmlDevice_t device, nvmlClockType_t type,
nvmlPstates_t pstate, unsigned int *minClockMHz,
unsigned int *maxClockMHz)
Parameters
device
The identifier of the target device
type
Clock domain
pstate
PState to query
minClockMHz
Reference in which to return min clock frequency
maxClockMHz
Reference in which to return max clock frequency
Returns
‣ NVML_SUCCESS if everything worked
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device, type or pstate are invalid or both
minClockMHz and maxClockMHz are NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
Description
Retrieve min and max clocks of some clock domain for a given PState
nvmlReturn_t
nvmlDeviceGetSupportedPerformanceStates
162
Modules
(nvmlDevice_t device, nvmlPstates_t *pstates, unsigned
int size)
Parameters
device
The identifier of the target device
pstates
Container to return the list of performance states supported by device
size
Size of the supplied pstates array in bytes
Returns
‣ NVML_SUCCESS if pstates array has been retrieved
‣ NVML_ERROR_INSUFFICIENT_SIZE if the the container supplied was not large
enough to hold the resulting list
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device or pstates is invalid
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support performance
state readings
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Get all supported Performance States (P-States) for the device.
The returned array would contain a contiguous list of valid P-States supported by the
device. If the number of supported P-States is fewer than the size of the array supplied
missing elements would contain NVML_PSTATE_UNKNOWN.
The number of elements in the returned list will never exceed
NVML_MAX_GPU_PERF_PSTATES.
nvmlReturn_t nvmlDeviceGetGpcClkMinMaxVfOffset
(nvmlDevice_t device, int *minOffset, int *maxOffset)
Parameters
device
The identifier of the target device
minOffset
The retrieved GPCCLK VF min offset value
163
Modules
maxOffset
The retrieved GPCCLK VF max offset value
Returns
‣ NVML_SUCCESS if offset has been successfully queried
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or offset is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve the GPCCLK min max VF offset value.
nvmlReturn_t nvmlDeviceGetMemClkMinMaxVfOffset
(nvmlDevice_t device, int *minOffset, int *maxOffset)
Parameters
device
The identifier of the target device
minOffset
The retrieved MemClk VF min offset value
maxOffset
The retrieved MemClk VF max offset value
Returns
‣ NVML_SUCCESS if offset has been successfully queried
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or offset is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieve the MemClk (Memory Clock) min max VF offset value.
164
Modules
nvmlReturn_t nvmlDeviceGetClockOffsets (nvmlDevice_t
device, nvmlClockOffset_t *info)
Parameters
device
The identifier of the target device
info
Structure specifying the clock type (input) and the pstate (input) retrieved clock offset
value (output), min clock offset (output) and max clock offset (output)
Returns
‣ NVML_SUCCESS If everything worked
‣ NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT If device, type or pstate are invalid or both
minClockOffsetMHz and maxClockOffsetMHz are NULL
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is
invalid/unsupported
‣ NVML_ERROR_NOT_SUPPORTED If the device does not support this feature
Description
Retrieve min, max and current clock offset of some clock domain for a given PState
For Maxwell or newer fully supported devices.
Note: nvmlDeviceGetGpcClkVfOffset, nvmlDeviceGetMemClkVfOffset,
nvmlDeviceGetGpcClkMinMaxVfOffset and nvmlDeviceGetMemClkMinMaxVfOffset
will be deprecated in a future release. Use nvmlDeviceGetClockOffsets instead.
nvmlReturn_t nvmlDeviceSetClockOffsets (nvmlDevice_t
device, nvmlClockOffset_t *info)
Parameters
device
The identifier of the target device
info
Structure specifying the clock type (input), the pstate (input) and clock offset value
(input)
165
Modules
Returns
‣ NVML_SUCCESS If everything worked
‣ NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized
‣ NVML_ERROR_NO_PERMISSION If the user doesn't have permission to perform
this operation
‣ NVML_ERROR_INVALID_ARGUMENT If device, type or pstate are invalid or both
clockOffsetMHz is out of allowed range.
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is
invalid/unsupported
‣ NVML_ERROR_NOT_SUPPORTED If the device does not support this feature
Description
Control current clock offset of some clock domain for a given PState
For Maxwell or newer fully supported devices.
Requires privileged user.
nvmlReturn_t nvmlDeviceGetPerformanceModes
(nvmlDevice_t device, nvmlDevicePerfModes_t
*perfModes)
Parameters
device
The identifier of the target device
perfModes
Reference in which to return the performance level string
Returns
‣ NVML_SUCCESS if perfModes has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or name is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves a performance mode string with all the performance modes defined for this
device along with their associated GPU Clock and Memory Clock values. Not all tokens
166
Modules
will be reported on all GPUs, and additional tokens may be added in the future. For
backwards compatibility we still provide nvclock and memclock; those are the same as
nvclockmin and memclockmin.
Note: These clock values take into account the offset set by clients through /ref
nvmlDeviceSetClockOffsets.
Maximum available Pstate (P15) shows the minimum performance level (0) and vice
versa.
Each performance modes are returned as a comma-separated list of "token=value" pairs.
Each set of performance mode tokens are separated by a ";". Valid tokens:
Token Value "perf" unsigned int - the Performance level "nvclock" unsigned int - the
GPU clocks (in MHz) for the perf level "nvclockmin" unsigned int - the GPU clocks
min (in MHz) for the perf level "nvclockmax" unsigned int - the GPU clocks max (in
MHz) for the perf level "nvclockeditable" unsigned int - if the GPU clock domain is
editable for the perf level "memclock" unsigned int - the memory clocks (in MHz) for
the perf level "memclockmin" unsigned int - the memory clocks min (in MHz) for the
perf level "memclockmax" unsigned int - the memory clocks max (in MHz) for the perf
level "memclockeditable" unsigned int - if the memory clock domain is editable for the
perf level "memtransferrate" unsigned int - the memory transfer rate (in MHz) for the
perf level "memtransferratemin" unsigned int - the memory transfer rate min (in MHz)
for the perf level "memtransferratemax" unsigned int - the memory transfer rate max (in
MHz) for the perf level "memtransferrateeditable" unsigned int - if the memory transfer
rate is editable for the perf level
Example:
perf=0, nvclock=324, nvclockmin=324, nvclockmax=324, nvclockeditable=0,
memclock=324, memclockmin=324, memclockmax=324, memclockeditable=0,
memtransferrate=648, memtransferratemin=648, memtransferratemax=648,
memtransferrateeditable=0 ; perf=1, nvclock=324, nvclockmin=324, nvclockmax=640,
nvclockeditable=0, memclock=810, memclockmin=810, memclockmax=810,
memclockeditable=0, memtransferrate=1620, memtransferrate=1620,
memtransferrate=1620, memtransferrateeditable=0 ;
nvmlReturn_t nvmlDeviceGetCurrentClockFreqs
(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t
*currentClockFreqs)
Parameters
device
The identifier of the target device
167
Modules
currentClockFreqs
Reference in which to return the performance level string
Returns
‣ NVML_SUCCESS if currentClockFreqs has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid, or name is NULL
‣ NVML_ERROR_INSUFFICIENT_SIZE if length is too small
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves a string with the associated current GPU Clock and Memory Clock values.
Not all tokens will be reported on all GPUs, and additional tokens may be added in the
future.
Note: These clock values take into account the offset set by clients through /ref
nvmlDeviceSetClockOffsets.
Clock values are returned as a comma-separated list of "token=value" pairs. Valid tokens:
Token Value "perf" unsigned int - the Performance level "nvclock" unsigned int - the
GPU clocks (in MHz) for the perf level "nvclockmin" unsigned int - the GPU clocks
min (in MHz) for the perf level "nvclockmax" unsigned int - the GPU clocks max (in
MHz) for the perf level "nvclockeditable" unsigned int - if the GPU clock domain is
editable for the perf level "memclock" unsigned int - the memory clocks (in MHz) for
the perf level "memclockmin" unsigned int - the memory clocks min (in MHz) for the
perf level "memclockmax" unsigned int - the memory clocks max (in MHz) for the perf
level "memclockeditable" unsigned int - if the memory clock domain is editable for the
perf level "memtransferrate" unsigned int - the memory transfer rate (in MHz) for the
perf level "memtransferratemin" unsigned int - the memory transfer rate min (in MHz)
for the perf level "memtransferratemax" unsigned int - the memory transfer rate max (in
MHz) for the perf level "memtransferrateeditable" unsigned int - if the memory transfer
rate is editable for the perf level
Example:
nvclock=324, nvclockmin=324, nvclockmax=324, nvclockeditable=0, memclock=324,
memclockmin=324, memclockmax=324, memclockeditable=0, memtransferrate=648,
memtransferratemin=648, memtransferratemax=648, memtransferrateeditable=0 ;
168
Modules
nvmlReturn_t nvmlDeviceGetPowerManagementMode
(nvmlDevice_t device, nvmlEnableState_t *mode)
Parameters
device
The identifier of the target device
mode
Reference in which to return the current power management mode
Returns
‣ NVML_SUCCESS if mode has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or mode is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
This API has been deprecated.
Retrieves the power management mode associated with this device.
For products from the Fermi family.
‣ Requires NVML_INFOROM_POWER version 3.0 or higher.
For from the Kepler or newer families.
‣ Does not require NVML_INFOROM_POWER object.
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.
See nvmlEnableState_t for details on allowed modes.
169
Modules
nvmlReturn_t nvmlDeviceGetPowerManagementLimit
(nvmlDevice_t device, unsigned int *limit)
Parameters
device
The identifier of the target device
limit
Reference in which to return the power management limit in milliwatts
Returns
‣ NVML_SUCCESS if limit has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or limit is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the power management limit associated with this device.
For Fermi or newer fully supported devices.
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
nvmlDeviceGetPowerManagementMode.
nvmlReturn_t
nvmlDeviceGetPowerManagementLimitConstraints
(nvmlDevice_t device, unsigned int *minLimit, unsigned
int *maxLimit)
Parameters
device
The identifier of the target device
minLimit
Reference in which to return the minimum power management limit in milliwatts
170
Modules
maxLimit
Reference in which to return the maximum power management limit in milliwatts
Returns
‣ NVML_SUCCESS if minLimit and maxLimit have been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or minLimit or
maxLimit is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves information about possible values of power management limits on this device.
For Kepler or newer fully supported devices.
See also:
nvmlDeviceSetPowerManagementLimit
nvmlReturn_t
nvmlDeviceGetPowerManagementDefaultLimit
(nvmlDevice_t device, unsigned int *defaultLimit)
Parameters
device
The identifier of the target device
defaultLimit
Reference in which to return the default power management limit in milliwatts
Returns
‣ NVML_SUCCESS if defaultLimit has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or defaultLimit is
NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
171
Modules
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves default power management limit on this device, in milliwatts. Default power
management limit is a power management limit that the device boots with.
For Kepler or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetPowerUsage (nvmlDevice_t
device, unsigned int *power)
Parameters
device
The identifier of the target device
power
Reference in which to return the power usage information
Returns
‣ NVML_SUCCESS if power has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or power is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support power readings
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g.
memory)
For Fermi or newer fully supported devices.
On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power
draw. On Ampere (except GA100) or newer GPUs, the API returns power averaged over
1 sec interval. On GA100 and older architectures, instantaneous power is returned.
See NVML_FI_DEV_POWER_AVERAGE and NVML_FI_DEV_POWER_INSTANT to
query specific power values.
It is only available if power management mode is supported. See
nvmlDeviceGetPowerManagementMode.
172
Modules
nvmlReturn_t nvmlDeviceGetTotalEnergyConsumption
(nvmlDevice_t device, unsigned long long *energy)
Parameters
device
The identifier of the target device
energy
Reference in which to return the energy consumption information
Returns
‣ NVML_SUCCESS if energy has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or energy is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support energy readings
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves total energy consumption for this GPU in millijoules (mJ) since the driver was
last reloaded
For Volta or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetEnforcedPowerLimit
(nvmlDevice_t device, unsigned int *limit)
Parameters
device
The device to communicate with
limit
Reference in which to return the power management limit in milliwatts
Returns
‣ NVML_SUCCESS if limit has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or limit is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
173
Modules
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Get the effective power limit that the driver enforces after taking into account all limiters
Note: This can be different from the nvmlDeviceGetPowerManagementLimit if other
limits are set elsewhere This includes the out of band power limit interface
For Kepler or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetGpuOperationMode
(nvmlDevice_t device, nvmlGpuOperationMode_t
*current, nvmlGpuOperationMode_t *pending)
Parameters
device
The identifier of the target device
current
Reference in which to return the current GOM
pending
Reference in which to return the pending GOM
Returns
‣ NVML_SUCCESS if mode has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or current or pending is
NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
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.
174
Modules
See also:
nvmlGpuOperationMode_t
nvmlDeviceSetGpuOperationMode
nvmlReturn_t nvmlDeviceGetMemoryInfo (nvmlDevice_t
device, nvmlMemory_t *memory)
Parameters
device
The identifier of the target device
memory
Reference in which to return the memory information
Returns
‣ NVML_SUCCESS if memory has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform
this operation
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or memory is NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the amount of used, free, reserved and total memory available on the device, in
bytes. The reserved amount is supported on version 2 only.
For all products.
Enabling ECC reduces the amount of total available memory, due to the extra required
parity bits. Under WDDM most device memory is allocated and managed on startup by
Windows.
Under Linux and Windows TCC, the reported amount of used memory is equal to the
sum of memory allocated by all active channels on the device.
See nvmlMemory_v2_t for details on available memory info.
‣ In MIG mode, if device handle is provided, the API returns aggregate information,
only if the caller has appropriate privileges. Per-instance information can be
queried by using specific MIG device handles.
175
Modules
‣ nvmlDeviceGetMemoryInfo_v2 adds additional memory information.
‣ On systems where GPUs are NUMA nodes, the accuracy of FB memory utilization
provided by this API depends on the memory accounting of the operating system.
This is because FB memory is managed by the operating system instead of the
NVIDIA GPU driver. Typically, pages allocated from FB memory are not released
even after the process terminates to enhance performance. In scenarios where
the operating system is under memory pressure, it may resort to utilizing FB
memory. Such actions can result in discrepancies in the accuracy of memory
reporting.
nvmlReturn_t nvmlDeviceGetMemoryInfo_v2
(nvmlDevice_t device, nvmlMemory_v2_t *memory)
Description
nvmlDeviceGetMemoryInfo_v2 accounts separately for reserved memory and includes
it in the used memory amount.
nvmlReturn_t nvmlDeviceGetComputeMode
(nvmlDevice_t device, nvmlComputeMode_t *mode)
Parameters
device
The identifier of the target device
mode
Reference in which to return the current compute mode
Returns
‣ NVML_SUCCESS if mode has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or mode is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current compute mode for the device.
For all products.
176
Modules
See nvmlComputeMode_t for details on allowed compute modes.
See also:
nvmlDeviceSetComputeMode()
nvmlReturn_t nvmlDeviceGetCudaComputeCapability
(nvmlDevice_t device, int *major, int *minor)
Parameters
device
The identifier of the target device
major
Reference in which to return the major CUDA compute capability
minor
Reference in which to return the minor CUDA compute capability
Returns
‣ NVML_SUCCESS if major and minor have been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or major or minor are
NULL
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the CUDA compute capability of the device.
For all products.
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().
177
Modules
nvmlReturn_t nvmlDeviceGetDramEncryptionMode
(nvmlDevice_t device, nvmlDramEncryptionInfo_t
*current, nvmlDramEncryptionInfo_t *pending)
Parameters
device
The identifier of the target device
current
Reference in which to return the current DRAM Encryption mode
pending
Reference in which to return the pending DRAM Encryption mode
Returns
‣ NVML_SUCCESS if current and pending have been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or either current or
pending is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the argument version is
not supported
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current and pending DRAM Encryption modes for the device.
BLACKWELL_OR_NEWER% Only applicable to devices that support DRAM
Encryption Requires NVML_INFOROM_DEN version 1.0 or higher.
Changing DRAM Encryption modes requires a reboot. The "pending" DRAM
Encryption mode refers to the target mode following the next reboot.
See nvmlEnableState_t for details on allowed modes.
See also:
nvmlDeviceSetDramEncryptionMode()
178
Modules
nvmlReturn_t nvmlDeviceSetDramEncryptionMode
(nvmlDevice_t device, const nvmlDramEncryptionInfo_t
*dramEncryption)
Parameters
device
The identifier of the target device
dramEncryption
The target DRAM Encryption mode
Returns
‣ NVML_SUCCESS if the DRAM Encryption mode was set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or DRAM Encryption is
invalid
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform
this operation
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the argument version is
not supported
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Set the DRAM Encryption mode for the device.
For Kepler or newer fully supported devices. Only applicable to devices that support
DRAM Encryption. Requires NVML_INFOROM_DEN version 1.0 or higher. Requires
root/admin permissions.
The DRAM Encryption mode determines whether the GPU enables its DRAM
Encryption support.
This operation takes effect after the next reboot.
See nvmlEnableState_t for details on available modes.
See also:
nvmlDeviceGetDramEncryptionMode()
179
Modules
nvmlReturn_t nvmlDeviceGetEccMode (nvmlDevice_t
device, nvmlEnableState_t *current, nvmlEnableState_t
*pending)
Parameters
device
The identifier of the target device
current
Reference in which to return the current ECC mode
pending
Reference in which to return the pending ECC mode
Returns
‣ NVML_SUCCESS if current and pending have been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or either current or
pending is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the current and pending ECC modes for the device.
For Fermi or newer fully supported devices. 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.
See nvmlEnableState_t for details on allowed modes.
See also:
nvmlDeviceSetEccMode()
180
Modules
nvmlReturn_t nvmlDeviceGetDefaultEccMode
(nvmlDevice_t device, nvmlEnableState_t *defaultMode)
Parameters
device
The identifier of the target device
defaultMode
Reference in which to return the default ECC mode
Returns
‣ NVML_SUCCESS if current and pending have been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or default is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the default ECC modes for the device.
For Fermi or newer fully supported devices. Only applicable to devices with ECC.
Requires NVML_INFOROM_ECC version 1.0 or higher.
See nvmlEnableState_t for details on allowed modes.
See also:
nvmlDeviceSetEccMode()
nvmlReturn_t nvmlDeviceGetBoardId (nvmlDevice_t
device, unsigned int *boardId)
Parameters
device
The identifier of the target device
boardId
Reference in which to return the device's board ID
181
Modules
Returns
‣ NVML_SUCCESS if boardId has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or boardId is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the device boardId from 0-N. Devices with the same boardId indicate GPUs
connected to the same PLX. Use in conjunction with nvmlDeviceGetMultiGpuBoard()
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).
For Fermi or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetMultiGpuBoard
(nvmlDevice_t device, unsigned int *multiGpuBool)
Parameters
device
The identifier of the target device
multiGpuBool
Reference in which to return a zero or non-zero value to indicate whether the device
is on a multi GPU board
Returns
‣ NVML_SUCCESS if multiGpuBool has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or multiGpuBool is
NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
182
Modules
Description
Retrieves whether the device is on a Multi-GPU Board Devices that are on multi-GPU
boards will set multiGpuBool to a non-zero value.
For Fermi or newer fully supported devices.
nvmlReturn_t nvmlDeviceGetTotalEccErrors
(nvmlDevice_t device, nvmlMemoryErrorType_t
errorType, nvmlEccCounterType_t counterType,
unsigned long long *eccCounts)
Parameters
device
The identifier of the target device
errorType
Flag that specifies the type of the errors.
counterType
Flag that specifies the counter-type of the errors.
eccCounts
Reference in which to return the specified ECC errors
Returns
‣ NVML_SUCCESS if eccCounts has been set
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device, errorType or counterType is
invalid, or eccCounts is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the total ECC error counts for the device.
For Fermi or newer fully supported devices. 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.
183
Modules
See nvmlMemoryErrorType_t for a description of available error types. See
nvmlEccCounterType_t for a description of available counter types.
See also:
nvmlDeviceClearEccErrorCounts()
nvmlReturn_t nvmlDeviceGetDetailedEccErrors
(nvmlDevice_t device, nvmlMemoryErrorType_t
errorType, nvmlEccCounterType_t counterType,
nvmlEccErrorCounts_t *eccCounts)
Parameters
device
The identifier of the target device
errorType
Flag that specifies the type of the errors.
counterType
Flag that specifies the counter-type of the errors.
eccCounts
Reference in which to return the specified ECC errors
Returns
‣ NVML_SUCCESS if eccCounts has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device, errorType or counterType is
invalid, or eccCounts is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the detailed ECC error counts for the device.
Deprecated This API supports only a fixed set of ECC error locations On different GPU
architectures different locations are supported See nvmlDeviceGetMemoryErrorCounter
For Fermi or newer fully supported devices. Only applicable to devices with ECC.
Requires NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-
184
Modules
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.
See nvmlMemoryErrorType_t for a description of available bit types. See
nvmlEccCounterType_t for a description of available counter types. See
nvmlEccErrorCounts_t for a description of provided detailed ECC counts.
See also:
nvmlDeviceClearEccErrorCounts()
nvmlReturn_t nvmlDeviceGetMemoryErrorCounter
(nvmlDevice_t device, nvmlMemoryErrorType_t
errorType, nvmlEccCounterType_t counterType,
nvmlMemoryLocation_t locationType, unsigned long long
*count)
Parameters
device
The identifier of the target device
errorType
Flag that specifies the type of error.
counterType
Flag that specifies the counter-type of the errors.
locationType
Specifies the location of the counter.
count
Reference in which to return the ECC counter
Returns
‣ NVML_SUCCESS if count has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device, bitTyp,e counterType or
locationType is invalid, or count is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support ECC error
reporting in the specified memory
185
Modules
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
Description
Retrieves the requested memory error counter for the device.
For Fermi or newer fully supported devices. 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.
On MIG-enabled GPUs, per instance information can be queried using specific
MIG device handles. Per instance information is currently only supported for non-
DRAM uncorrectable volatile errors. Querying volatile errors using device handles is
currently not supported.
See nvmlMemoryErrorType_t for a description of available memory error types.
See nvmlEccCounterType_t for a description of available counter types. See
nvmlMemoryLocation_t for a description of available counter locations.
nvmlReturn_t nvmlDeviceGetUtilizationRates
(nvmlDevice_t device, nvmlUtilization_t *utilization)
Parameters
device
The identifier of the target device
utilization
Reference in which to return the utilization information
Returns
‣ NVML_SUCCESS if utilization has been populated
‣ NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized
‣ NVML_ERROR_INVALID_ARGUMENT if device is invalid or utilization is NULL
‣ NVML_ERROR_NOT_SUPPORTED if the device does not support this feature
‣ NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is
otherwise inaccessible
‣ NVML_ERROR_UNKNOWN on any unexpected error
186
|
||
|
|
|