Skip to main content
country_code
Ctrl+K
NVML API Reference Guide - Home NVML API Reference Guide - Home

NVML API Reference Guide

  • PDF
NVML API Reference Guide - Home NVML API Reference Guide - Home

NVML API Reference Guide

  • PDF

Table of Contents

  • NVML API Reference
  • Known Issues
  • Change Log
  • Deprecation and/or Removal Notices for the NVML Library
  • NVML API Reference
    • Groups
      • Accounting Statistics
      • CPER (Common Platform Error Record)
      • Confidential Computing definitions
      • Constants
      • Device Commands
      • Device Enums
      • Device Queries
        • CPU and Memory Affinity
      • Device Structs
      • Drain State definitions
      • Drain states
      • Encoder Structs
      • Error reporting
      • Event Handling Methods
        • Event Types
      • Excluded GPU Queries
      • Fabric definitions
      • Field Value Enums
      • Field Value Queries
      • Frame Buffer Capture Structures
      • Initialization and Cleanup
      • Multi Instance GPU Management
      • NVML GPM
        • GPM Enums
        • GPM Functions
        • GPM Structs
      • NvLink Methods
      • NvmlClocksEventReasons
      • PRM Access
      • Power Profile Information
      • Power Smoothing Information
      • System Queries
      • Unit Commands
      • Unit Queries
      • Unit Structs
      • vGPU APIs
      • vGPU Enums, Constants, Structs
        • vGPU Constants
        • vGPU Enums
        • vGPU Structs
      • vGPU Management
      • vGPU Migration
      • vGPU Utilization and Accounting
    • Pages
      • Deprecated List
    • Structs
      • nvmlAccountingStats_t
      • nvmlAccountingStats_v2_t
      • nvmlActiveVgpuInstanceInfo_v1_t
      • nvmlAdaptiveTgpModeInfo_v1_t
      • nvmlBAR1Memory_t
      • nvmlBBXTimeData_v1_t
      • nvmlBridgeChipHierarchy_t
      • nvmlBridgeChipInfo_t
      • nvmlC2cModeInfo_v1_t
      • nvmlCPERCursor_v1_t
      • nvmlClkMonFaultInfo_t
      • nvmlClkMonStatus_t
      • nvmlClockOffset_v1_t
      • nvmlComputeInstanceInfo_t
      • nvmlComputeInstancePlacement_t
      • nvmlComputeInstanceProfileInfo_t
      • nvmlComputeInstanceProfileInfo_v2_t
      • nvmlComputeInstanceProfileInfo_v3_t
      • nvmlConfComputeGetKeyRotationThresholdInfo_v1_t
      • nvmlConfComputeGpuAttestationReport_t
      • nvmlConfComputeGpuCertificate_t
      • nvmlConfComputeMemSizeInfo_t
      • nvmlConfComputeSetKeyRotationThresholdInfo_v1_t
      • nvmlConfComputeSystemCaps_t
      • nvmlConfComputeSystemState_t
      • nvmlCoolerInfo_v1_t
      • nvmlCoreRailMetrics_t
      • nvmlDeviceAddressingMode_v1_t
      • nvmlDeviceAttributes_t
      • nvmlDeviceCapabilities_v1_t
      • nvmlDeviceCurrentClockFreqs_v1_t
      • nvmlDevicePerfModes_v1_t
      • nvmlDevicePowerMizerModes_v1_t
      • nvmlDramEncryptionInfo_v1_t
      • nvmlEccBankRemapperHistogram_v1_t
      • nvmlEccBankRemapperStatus_v1_t
      • nvmlEccErrorCounts_t
      • nvmlEccSramErrorStatus_v1_t
      • nvmlEccSramUniqueUncorrectedErrorCounts_v1_t
      • nvmlEccSramUniqueUncorrectedErrorEntry_v1_t
      • nvmlEncoderSessionInfo_t
      • nvmlEventData_t
      • nvmlEventSetGetContextCount_v1_t
      • nvmlEventSetGetContextData_v1_t
      • nvmlEventSetGetContextInfo_v1_t
      • nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t
      • nvmlEventSetWait_v3_t
      • nvmlExcludedDeviceInfo_t
      • nvmlFBCSessionInfo_t
      • nvmlFBCStats_t
      • nvmlFanSpeedInfo_v1_t
      • nvmlFieldValue_t
      • nvmlGetCPER_v1_t
      • nvmlGetMemoryLimits_v1_t
      • nvmlGpmMetric_t
      • nvmlGpmMetricsGet_t
      • nvmlGpmSupport_t
      • nvmlGpuDynamicPstatesInfo_t
      • nvmlGpuFabricClique_v1_t
      • nvmlGpuFabricInfo_t
      • nvmlGpuFabricInfo_v2_t
      • nvmlGpuFabricInfo_v3_t
      • nvmlGpuFabricInfo_v4_t
      • nvmlGpuInstanceInfo_t
      • nvmlGpuInstancePlacement_t
      • nvmlGpuInstanceProfileInfo_t
      • nvmlGpuInstanceProfileInfo_v2_t
      • nvmlGpuInstanceProfileInfo_v3_t
      • nvmlGpuOperationalEventConfig_v1_t
      • nvmlGpuThermalSettings_t
      • nvmlGridLicensableFeature_t
      • nvmlGridLicensableFeatures_t
      • nvmlGridLicenseExpiry_t
      • nvmlHostname_v1_t
      • nvmlHwbcEntry_t
      • nvmlLedState_t
      • nvmlMarginTemperature_v1_t
      • nvmlMask255_t
      • nvmlMemory_t
      • nvmlMemory_v2_t
      • nvmlNvLinkInfo_v1_t
      • nvmlNvLinkInfo_v2_t
      • nvmlNvLinkPowerThres_t
      • nvmlNvLinkUtilizationControl_t
      • nvmlNvlinkFirmwareInfo_t
      • nvmlNvlinkFirmwareVersion_t
      • nvmlNvlinkGetBwMode_v1_t
      • nvmlNvlinkSetBwModeAsync_v1_t
      • nvmlNvlinkSetBwMode_v1_t
      • nvmlNvlinkSupportedBwModes_v1_t
      • nvmlNvlinkTelemetrySample_v1_t
      • nvmlNvlinkTelemetrySamples_v1_t
      • nvmlObservedMetrics_t
      • nvmlPRMCounterInput_v1_t
      • nvmlPRMCounterList_v1_t
      • nvmlPRMCounterValue_v1_t
      • nvmlPRMCounter_v1_t
      • nvmlPRMTLV_v1_t
      • nvmlPSUInfo_t
      • nvmlPciInfoExt_v1_t
      • nvmlPciInfo_t
      • nvmlPdi_v1_t
      • nvmlPerfMetricControllerSample_t
      • nvmlPerfMetricsDlppc2xSample_t
      • nvmlPerfMetricsPfpp1xSample_t
      • nvmlPerfMetricsSample_t
      • nvmlPerfMetricsSamples_v1_t
      • nvmlPlatformInfo_v1_t
      • nvmlPlatformInfo_v2_t
      • nvmlPmgrPwrTuple_t
      • nvmlPowerSmoothingProfile_v1_t
      • nvmlPowerSmoothingState_v1_t
      • nvmlPowerValue_v2_t
      • nvmlProcessDetailList_v1_t
      • nvmlProcessDetail_v1_t
      • nvmlProcessInfo_t
      • nvmlProcessInfo_v1_t
      • nvmlProcessUtilizationInfo_v1_t
      • nvmlProcessUtilizationSample_t
      • nvmlProcessesUtilizationInfo_v1_t
      • nvmlPwrModelMetricsDlppm1xDramclkEstimates_t
      • nvmlPwrModelMetricsDlppm1xPerf_t
      • nvmlPwrModelMetricsDlppm1x_t
      • nvmlPwrModelMetricsPfpp1x_t
      • nvmlPwrModelMetricsSamplePfpp1x_t
      • nvmlPwrModelOperatingPointPfpp1x_t
      • nvmlRailMetrics_t
      • nvmlRemappedRowsInfo_v2_t
      • nvmlRepairStatus_v1_t
      • nvmlRowRemapperHistogramValues_t
      • nvmlRusdSettings_v1_t
      • nvmlSample_t
      • nvmlSetMemoryLimits_v1_t
      • nvmlSystemConfComputeSettings_v1_t
      • nvmlSystemDriverBranchInfo_v1_t
      • nvmlSystemEventData_v1_t
      • nvmlSystemEventSetCreateRequest_v1_t
      • nvmlSystemEventSetFreeRequest_v1_t
      • nvmlSystemEventSetWaitRequest_v1_t
      • nvmlSystemRegisterEventRequest_v1_t
      • nvmlTemperature_v1_t
      • nvmlUUID_v1_t
      • nvmlUnitFanInfo_t
      • nvmlUnitFanSpeeds_t
      • nvmlUnitInfo_t
      • nvmlUnrepairableMemoryStatus_v1_t
      • nvmlUtilization_t
      • nvmlVgpuCreatablePlacementInfo_v1_t
      • nvmlVgpuHeterogeneousMode_v1_t
      • nvmlVgpuInstanceUtilizationInfo_v1_t
      • nvmlVgpuInstanceUtilizationSample_t
      • nvmlVgpuInstancesUtilizationInfo_v1_t
      • nvmlVgpuLicenseExpiry_t
      • nvmlVgpuLicenseInfo_t
      • nvmlVgpuMetadata_t
      • nvmlVgpuPgpuCompatibility_t
      • nvmlVgpuPgpuMetadata_t
      • nvmlVgpuPlacementId_v1_t
      • nvmlVgpuPlacementList_v1_t
      • nvmlVgpuPlacementList_v2_t
      • nvmlVgpuProcessUtilizationInfo_v1_t
      • nvmlVgpuProcessUtilizationSample_t
      • nvmlVgpuProcessesUtilizationInfo_v1_t
      • nvmlVgpuRuntimeState_v1_t
      • nvmlVgpuSchedulerCapabilities_t
      • nvmlVgpuSchedulerGetState_t
      • nvmlVgpuSchedulerLogEntry_t
      • nvmlVgpuSchedulerLogEntry_v2_t
      • nvmlVgpuSchedulerLogInfo_v1_t
      • nvmlVgpuSchedulerLogInfo_v2_t
      • nvmlVgpuSchedulerLog_t
      • nvmlVgpuSchedulerSetState_t
      • nvmlVgpuSchedulerStateInfo_v1_t
      • nvmlVgpuSchedulerStateInfo_v2_t
      • nvmlVgpuSchedulerState_v1_t
      • nvmlVgpuSchedulerState_v2_t
      • nvmlVgpuTypeBar1Info_v1_t
      • nvmlVgpuTypeIdInfo_v1_t
      • nvmlVgpuTypeMaxInstance_v1_t
      • nvmlVgpuVersion_t
      • nvmlViolationTime_t
      • nvmlWorkloadPowerProfileCurrentProfiles_v1_t
      • nvmlWorkloadPowerProfileInfo_v1_t
      • nvmlWorkloadPowerProfileProfilesInfo_v1_t
      • nvmlWorkloadPowerProfileRequestedProfiles_v1_t
      • nvmlWorkloadPowerProfileUpdateProfiles_v1_t
    • Unions
      • nvmlUUIDValue_t
      • nvmlValue_t
      • nvmlVgpuSchedulerParams_t
      • nvmlVgpuSchedulerSetParams_t
  • Notices
  • NVML API Reference
  • Groups
  • NvLink Methods
Is this page helpful?

NvLink Methods#

This chapter describes methods that NVML can perform on NVLINK enabled devices.

Macros#

NVML_NVLINK_BER_EXP_SHIFT

Shift for NVLink BER exponent.

NVML_NVLINK_BER_EXP_WIDTH

Width for NVLink BER exponent.

NVML_NVLINK_BER_MANTISSA_SHIFT

Shift for NVLink BER mantissa.

NVML_NVLINK_BER_MANTISSA_WIDTH

Width for NVLink BER mantissa.

NVML_NVLINK_ERROR_COUNTER_BER_GET

Nvlink Error counter BER can be obtained using the below macros Ex - NVML_NVLINK_ERROR_COUNTER_BER_GET(var, BER_MANTISSA)

NVML_NVLINK_FIRMWARE_UCODE_TYPE_MSE

MSE ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR

NETIR ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_CLN

NETIR CLN ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_DLN

NETIR DLN ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_UPHY

NETIR UPHY ucode type.

NVML_NVLINK_FIRMWARE_VERSION_LENGTH

Length of firmware version string.

NVML_NVLINK_STATE_ACTIVE

NVLink is active.

NVML_NVLINK_STATE_ACTIVE_TRAFFIC_DISABLED

NVLink is active, but not usable for traffic.

NVML_NVLINK_STATE_INACTIVE

NVLink is inactive.

NVML_NVLINK_STATE_SLEEP

NVLink is in sleep state.

NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES

Total supported NVLink bandwidth modes.

nvmlNvLinkInfo_v1

Version macro for nvmlNvLinkInfo_v1_t .

nvmlNvLinkInfo_v2

Version macro for nvmlNvLinkInfo_v2_t .

nvmlNvlinkGetBwMode_v1

Version macro for nvmlNvlinkGetBwMode_v1_t .

nvmlNvlinkSetBwMode_v1

Version macro for nvmlNvlinkSetBwMode_v1_t .

nvmlNvlinkSupportedBwModes_v1

Version macro for nvmlNvlinkSupportedBwModes_v1_t .

Enumerations#

nvmlNvlinkTelemetrySampleType_t

Per-link NVLink telemetry sample types.

nvmlNvlinkVersion_t

Represents Nvlink Version.

Functions#

nvmlReturn_t nvmlDeviceFreezeNvLinkUtilizationCounter(nvmlDevice_t device, unsigned int link, unsigned int counter, nvmlEnableState_t freeze)

nvmlReturn_t nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int *capResult)

Retrieves the requested capability from the device's NvLink for the link specified Please refer to the nvmlNvLinkCapability_t structure for the specific caps that can be queried The return value should be treated as a boolean.

nvmlReturn_t nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long *counterValue)

Retrieves the specified error counter value Please refer to nvmlNvLinkErrorCounter_t for error counters that are available.

nvmlReturn_t nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t *info)

Query NVLINK information associated with this device.

nvmlReturn_t nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t *pNvLinkDeviceType)

Get the NVLink device type of the remote device connected over the given link.

nvmlReturn_t nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t *pci)

Retrieves the PCI information for the remote node on a NvLink link Note: pciSubSystemId is not filled in this function and is indeterminate.

nvmlReturn_t nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t *isActive)

Retrieves the state of the device's NvLink for the link specified.

nvmlReturn_t nvmlDeviceGetNvLinkTelemetrySamples_v1(nvmlDevice_t device, nvmlNvlinkTelemetrySamples_v1_t *samples)

Retrieve a batch of historical NVLink per-link telemetry samples.

nvmlReturn_t nvmlDeviceGetNvLinkUtilizationControl(nvmlDevice_t device, unsigned int link, unsigned int counter, nvmlNvLinkUtilizationControl_t *control)

nvmlReturn_t nvmlDeviceGetNvLinkUtilizationCounter(nvmlDevice_t device, unsigned int link, unsigned int counter, unsigned long long *rxcounter, unsigned long long *txcounter)

nvmlReturn_t nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int *version)

Retrieves the version of the device's NvLink for the link specified.

nvmlReturn_t nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t *getBwMode)

Get the NvLink Reduced Bandwidth Mode for the device.

nvmlReturn_t nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t *supportedBwMode)

Get the supported NvLink Reduced Bandwidth Modes of the device.

nvmlReturn_t nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link)

Resets all error counters to zero Please refer to nvmlNvLinkErrorCounter_t for the list of error counters that are reset.

nvmlReturn_t nvmlDeviceResetNvLinkUtilizationCounter(nvmlDevice_t device, unsigned int link, unsigned int counter)

nvmlReturn_t nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t *info)

Set NvLink Low Power Threshold for device.

nvmlReturn_t nvmlDeviceSetNvLinkUtilizationControl(nvmlDevice_t device, unsigned int link, unsigned int counter, nvmlNvLinkUtilizationControl_t *control, unsigned int reset)

nvmlReturn_t nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t *setBwMode)

Set the NvLink Reduced Bandwidth Mode for the device.

nvmlReturn_t nvmlDeviceSetNvlinkBwModeAsync_v1(nvmlDevice_t device, nvmlNvlinkSetBwModeAsync_v1_t *setBwModeAsync)

Set the NvLink Reduced Bandwidth Mode asynchronously for the device.

nvmlReturn_t nvmlSystemGetNvlinkBwMode(unsigned int *nvlinkBwMode)

Get the global nvlink bandwith mode.

nvmlReturn_t nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode)

Set the global nvlink bandwith mode.

Structs#

nvmlNvLinkInfo_v1_t

Struct to represent per device NVLINK information v1.

nvmlNvLinkInfo_v2_t

Struct to represent per device NVLINK information v2.

nvmlNvlinkFirmwareInfo_t

Struct to represent NVLINK firmware information.

nvmlNvlinkFirmwareVersion_t

Struct to represent NVLINK firmware Semantic versioning and ucode type.

nvmlNvlinkGetBwMode_v1_t

nvmlNvlinkSetBwModeAsync_v1_t

Describes the parameters involved to setting Nvlink RBM mode asynchronously.

nvmlNvlinkSetBwMode_v1_t

nvmlNvlinkSupportedBwModes_v1_t

nvmlNvlinkTelemetrySample_v1_t

Struct representing one (link, metric) telemetry request / response slot.

nvmlNvlinkTelemetrySamples_v1_t

Batched NVLink telemetry request.

Typedefs#

nvmlNvLinkInfo_t

nvmlNvlinkGetBwMode_t

nvmlNvlinkSetBwMode_t

nvmlNvlinkSupportedBwModes_t

Macros#

NVML_NVLINK_BER_EXP_SHIFT#

Shift for NVLink BER exponent.

NVML_NVLINK_BER_EXP_WIDTH#

Width for NVLink BER exponent.

NVML_NVLINK_BER_MANTISSA_SHIFT#

Shift for NVLink BER mantissa.

NVML_NVLINK_BER_MANTISSA_WIDTH#

Width for NVLink BER mantissa.

NVML_NVLINK_ERROR_COUNTER_BER_GET(var, type)#

Nvlink Error counter BER can be obtained using the below macros Ex - NVML_NVLINK_ERROR_COUNTER_BER_GET(var, BER_MANTISSA)

NVML_NVLINK_FIRMWARE_UCODE_TYPE_MSE#

MSE ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR#

NETIR ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_CLN#

NETIR CLN ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_DLN#

NETIR DLN ucode type.

NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_UPHY#

NETIR UPHY ucode type.

NVML_NVLINK_FIRMWARE_VERSION_LENGTH#

Length of firmware version string.

NVML_NVLINK_STATE_ACTIVE#

NVLink is active.

NVML_NVLINK_STATE_ACTIVE_TRAFFIC_DISABLED#

NVLink is active, but not usable for traffic.

NVML_NVLINK_STATE_INACTIVE#

NVLink is inactive.

NVML_NVLINK_STATE_SLEEP#

NVLink is in sleep state.

NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES#

Total supported NVLink bandwidth modes.

nvmlNvLinkInfo_v1#

Version macro for nvmlNvLinkInfo_v1_t.

nvmlNvLinkInfo_v2#

Version macro for nvmlNvLinkInfo_v2_t.

nvmlNvlinkGetBwMode_v1#

Version macro for nvmlNvlinkGetBwMode_v1_t.

nvmlNvlinkSetBwMode_v1#

Version macro for nvmlNvlinkSetBwMode_v1_t.

nvmlNvlinkSupportedBwModes_v1#

Version macro for nvmlNvlinkSupportedBwModes_v1_t.

Enumerations#

enum nvmlNvlinkTelemetrySampleType_t#

Per-link NVLink telemetry sample types.

Values:

enumerator NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_TX#

Raw TX flit counter for a single link.

enumerator NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_RX#

Raw RX flit counter for a single link.

enumerator NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_COUNT#

Number of valid sample types.

enum nvmlNvlinkVersion_t#

Represents Nvlink Version.

Values:

enumerator NVML_NVLINK_VERSION_INVALID#

NVLink version is invalid.

enumerator NVML_NVLINK_VERSION_1_0#

NVLink Version 1.0.

enumerator NVML_NVLINK_VERSION_2_0#

NVLink Version 2.0.

enumerator NVML_NVLINK_VERSION_2_2#

NVLink Version 2.2.

enumerator NVML_NVLINK_VERSION_3_0#

NVLink Version 3.0.

enumerator NVML_NVLINK_VERSION_3_1#

NVLink Version 3.1.

enumerator NVML_NVLINK_VERSION_4_0#

NVLink Version 4.0.

enumerator NVML_NVLINK_VERSION_5_0#

NVLink Version 5.0.

enumerator NVML_NVLINK_VERSION_6_0#

NVLink Version 6.0.

Functions#

nvmlReturn_t nvmlDeviceFreezeNvLinkUtilizationCounter(
nvmlDevice_t device,
unsigned int link,
unsigned int counter,
nvmlEnableState_t freeze,
)#

Deprecated:

Freezing NVLINK utilization counters is no longer supported.

Freeze the NVLINK utilization counters Both the receive and transmit counters are operated on by this function

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • counter – Specifies the counter that should be frozen (0 or 1).

  • freeze – NVML_FEATURE_ENABLED = freeze the receive and transmit counters NVML_FEATURE_DISABLED = unfreeze the receive and transmit counters

Returns:

  • NVML_SUCCESS if counters were successfully frozen or unfrozen

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, link, counter, or freeze is invalid

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkCapability(
nvmlDevice_t device,
unsigned int link,
nvmlNvLinkCapability_t capability,
unsigned int *capResult,
)#

Retrieves the requested capability from the device’s NvLink for the link specified Please refer to the nvmlNvLinkCapability_t structure for the specific caps that can be queried The return value should be treated as a boolean.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • capability – Specifies the nvmlNvLinkCapability_t to be queried

  • capResult – A boolean for the queried capability indicating that feature is available

Returns:

  • NVML_SUCCESS if capResult has been set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, link, or capability is invalid or capResult is NULL

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkErrorCounter(
nvmlDevice_t device,
unsigned int link,
nvmlNvLinkErrorCounter_t counter,
unsigned long long *counterValue,
)#

Retrieves the specified error counter value Please refer to nvmlNvLinkErrorCounter_t for error counters that are available.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • counter – Specifies the NvLink counter to be queried

  • counterValue – Returned counter value

Returns:

  • NVML_SUCCESS if counter has been set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, link, or counter is invalid or counterValue is NULL

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkInfo(
nvmlDevice_t device,
nvmlNvLinkInfo_t *info,
)#

Query NVLINK information associated with this device.

Parameters:
  • device – [in] The identifier of the target device

  • info – [out] Reference to nvmlNvLinkInfo_t

Returns:

  • NVML_SUCCESS if query is success

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device is invalid, or info is NULL

  • NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version is invalid/unsupported

  • 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

nvmlReturn_t nvmlDeviceGetNvLinkRemoteDeviceType(
nvmlDevice_t device,
unsigned int link,
nvmlIntNvLinkDeviceType_t *pNvLinkDeviceType,
)#

Get the NVLink device type of the remote device connected over the given link.

Parameters:
  • device – The device handle of the target GPU

  • link – The NVLink link index on the target GPU

  • pNvLinkDeviceType – Pointer in which the output remote device type is returned

Returns:

  • NVML_SUCCESS if pNvLinkDeviceType has been set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_NOT_SUPPORTED if NVLink is not supported

  • NVML_ERROR_INVALID_ARGUMENT if device or link is invalid, or pNvLinkDeviceType 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

nvmlReturn_t nvmlDeviceGetNvLinkRemotePciInfo_v2(
nvmlDevice_t device,
unsigned int link,
nvmlPciInfo_t *pci,
)#

Retrieves the PCI information for the remote node on a NvLink link Note: pciSubSystemId is not filled in this function and is indeterminate.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • pci – nvmlPciInfo_t of the remote node for the specified link

Returns:

  • NVML_SUCCESS if pci has been set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device or link is invalid or pci is NULL

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkState(
nvmlDevice_t device,
unsigned int link,
nvmlEnableState_t *isActive,
)#

Retrieves the state of the device’s NvLink for the link specified.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • isActive – nvmlEnableState_t where NVML_FEATURE_ENABLED indicates that the link is active and NVML_FEATURE_DISABLED indicates it is inactive

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 or link is invalid or isActive is NULL

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkTelemetrySamples_v1(
nvmlDevice_t device,
nvmlNvlinkTelemetrySamples_v1_t *samples,
)#

Retrieve a batch of historical NVLink per-link telemetry samples.

Samples are taken at approximately 100 ms intervals. Intended for use with periodic polling every ~2 seconds. Longer polling intervals are possible, but can result in dropped samples if the supported sampleCount is too low for the given polling interval.

RUBIN_OR_NEWER%

Parameters:
  • device – [in] The device handle of the GPU to retrieve samples for

  • samples – [inout] Request/response batch (see nvmlNvlinkTelemetrySamples_v1_t)

Returns:

  • NVML_SUCCESS If the call succeeded.

  • NVML_ERROR_INVALID_ARGUMENT If any required pointer is NULL, a given enum value is out of range, a slot’s linkId is out of range, a slot’s sampleCount is non-zero with a NULL samples pointer, or a slot’s sampleCount is greater than the supported sampleCount for the given link.

  • NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible.

  • NVML_ERROR_NOT_SUPPORTED If the given device does not support this API.

  • NVML_ERROR_UNKNOWN On any unexpected error.

nvmlReturn_t nvmlDeviceGetNvLinkUtilizationControl(
nvmlDevice_t device,
unsigned int link,
unsigned int counter,
nvmlNvLinkUtilizationControl_t *control,
)#

Deprecated:

Getting utilization counter control is no longer supported.

Get the NVLINK utilization counter control information for the specified counter, 0 or 1. Please refer to nvmlNvLinkUtilizationControl_t for the structure definition

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • counter – Specifies the counter that should be set (0 or 1).

  • link – Specifies the NvLink link to be queried

  • control – A reference to the nvmlNvLinkUtilizationControl_t to place information

Returns:

  • NVML_SUCCESS if the control has been set successfully

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, counter, link, or control is invalid

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkUtilizationCounter(
nvmlDevice_t device,
unsigned int link,
unsigned int counter,
unsigned long long *rxcounter,
unsigned long long *txcounter,
)#

Deprecated:

Use nvmlDeviceGetFieldValues with NVML_FI_DEV_NVLINK_THROUGHPUT_* as field values instead.

Retrieve the NVLINK utilization counter based on the current control for a specified counter. In general it is good practice to use nvmlDeviceSetNvLinkUtilizationControl before reading the utilization counters as they have no default state

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • counter – Specifies the counter that should be read (0 or 1).

  • rxcounter – Receive counter return value

  • txcounter – Transmit counter return value

Returns:

  • NVML_SUCCESS if rxcounter and txcounter have been successfully set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, counter, or link is invalid or rxcounter or txcounter are NULL

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvLinkVersion(
nvmlDevice_t device,
unsigned int link,
unsigned int *version,
)#

Retrieves the version of the device’s NvLink for the link specified.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

  • version – Requested NvLink version from nvmlNvlinkVersion_t

Returns:

  • NVML_SUCCESS if version has been set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device or link is invalid or version is NULL

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceGetNvlinkBwMode(
nvmlDevice_t device,
nvmlNvlinkGetBwMode_t *getBwMode,
)#

Get the NvLink Reduced Bandwidth Mode for the device.

For Blackwell or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • getBwMode – Reference to nvmlNvlinkGetBwMode_t

Returns:

  • NVML_SUCCESS if the query was successful

  • NVML_ERROR_INVALID_ARGUMENT if device is invalid or getBwMode is NULL

  • NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device

  • NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified is not supported

nvmlReturn_t nvmlDeviceGetNvlinkSupportedBwModes(
nvmlDevice_t device,
nvmlNvlinkSupportedBwModes_t *supportedBwMode,
)#

Get the supported NvLink Reduced Bandwidth Modes of the device.

For Blackwell or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • supportedBwMode – Reference to nvmlNvlinkSupportedBwModes_t

Returns:

  • NVML_SUCCESS if the query was successful

  • NVML_ERROR_INVALID_ARGUMENT if device is invalid or supportedBwMode is NULL

  • NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device

  • NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified is not supported

nvmlReturn_t nvmlDeviceResetNvLinkErrorCounters(
nvmlDevice_t device,
unsigned int link,
)#

Resets all error counters to zero Please refer to nvmlNvLinkErrorCounter_t for the list of error counters that are reset.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be queried

Returns:

  • NVML_SUCCESS if the reset is successful

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device or link is invalid

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceResetNvLinkUtilizationCounter(
nvmlDevice_t device,
unsigned int link,
unsigned int counter,
)#

Deprecated:

Resetting NVLINK utilization counters is no longer supported.

Reset the NVLINK utilization counters Both the receive and transmit counters are operated on by this function

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • link – Specifies the NvLink link to be reset

  • counter – Specifies the counter that should be reset (0 or 1)

Returns:

  • NVML_SUCCESS if counters were successfully reset

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, link, or counter is invalid

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceSetNvLinkDeviceLowPowerThreshold(
nvmlDevice_t device,
nvmlNvLinkPowerThres_t *info,
)#

Set NvLink Low Power Threshold for device.

For Hopper or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • info – Reference to nvmlNvLinkPowerThres_t struct input parameters

Returns:

  • NVML_SUCCESS if the Threshold is successfully set

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device is invalid or Threshold is not within range

  • NVML_ERROR_NOT_READY if an internal driver setting prevents the threshold from being used

  • NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device

nvmlReturn_t nvmlDeviceSetNvLinkUtilizationControl(
nvmlDevice_t device,
unsigned int link,
unsigned int counter,
nvmlNvLinkUtilizationControl_t *control,
unsigned int reset,
)#

Deprecated:

Setting utilization counter control is no longer supported.

Set the NVLINK utilization counter control information for the specified counter, 0 or 1. Please refer to nvmlNvLinkUtilizationControl_t for the structure definition. Performs a reset of the counters if the reset parameter is non-zero.

For Pascal or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • counter – Specifies the counter that should be set (0 or 1).

  • link – Specifies the NvLink link to be queried

  • control – A reference to the nvmlNvLinkUtilizationControl_t to set

  • reset – Resets the counters on set if non-zero

Returns:

  • NVML_SUCCESS if the control has been set successfully

  • NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized

  • NVML_ERROR_INVALID_ARGUMENT if device, counter, link, or control is invalid

  • NVML_ERROR_NOT_SUPPORTED if the device doesn’t support this feature

  • NVML_ERROR_UNKNOWN on any unexpected error

nvmlReturn_t nvmlDeviceSetNvlinkBwMode(
nvmlDevice_t device,
nvmlNvlinkSetBwMode_t *setBwMode,
)#

Set the NvLink Reduced Bandwidth Mode for the device.

For Blackwell or newer fully supported devices.

Parameters:
  • device – The identifier of the target device

  • setBwMode – Reference to nvmlNvlinkSetBwMode_t

Returns:

  • NVML_SUCCESS if the Bandwidth mode was successfully set

  • NVML_ERROR_INVALID_ARGUMENT if device is invalid or setBwMode is NULL

  • NVML_ERROR_NO_PERMISSION if user does not have permission to change Bandwidth mode

  • NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device

  • NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified is not supported

nvmlReturn_t nvmlDeviceSetNvlinkBwModeAsync_v1(
nvmlDevice_t device,
nvmlNvlinkSetBwModeAsync_v1_t *setBwModeAsync,
)#

Set the NvLink Reduced Bandwidth Mode asynchronously for the device.

Polling should be done by checking for NVML_GPU_FABRIC_STATE_COMPLETED from nvmlDeviceGetGpuFabricInfoV().

RUBIN_OR_NEWER%

See also

nvmlDeviceGetGpuFabricInfoV()

Parameters:
  • device – [in] The identifier of the target device

  • setBwModeAsync – [inout] Reference to nvmlNvlinkSetBwModeAsync_v1_t

Returns:

  • NVML_SUCCESS if the Bandwidth mode was successfully set

  • NVML_ERROR_INVALID_ARGUMENT if device or setBwModeAsync is invalid

  • NVML_ERROR_NO_PERMISSION if user does not have permission to change Bandwidth mode

  • NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device

nvmlReturn_t nvmlSystemGetNvlinkBwMode(unsigned int *nvlinkBwMode)#

Get the global nvlink bandwith mode.

Parameters:

nvlinkBwMode – reference of nvlink bandwidth mode

Returns:

  • NVML_SUCCESS on success

  • NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided

  • NVML_ERROR_NOT_SUPPORTED if GPU is not Hopper or newer architecture.

  • NVML_ERROR_NO_PERMISSION if not root user

nvmlReturn_t nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode)#

Set the global nvlink bandwith mode.

Parameters:

nvlinkBwMode – nvlink bandwidth mode

Returns:

  • NVML_SUCCESS on success

  • NVML_ERROR_INVALID_ARGUMENT if an invalid argument is provided

  • NVML_ERROR_IN_USE if P2P object exists

  • NVML_ERROR_NOT_SUPPORTED if GPU is not Hopper or newer architecture.

  • NVML_ERROR_NO_PERMISSION if not root user

Typedefs#

typedef nvmlNvLinkInfo_v2_t nvmlNvLinkInfo_t#
typedef nvmlNvlinkGetBwMode_v1_t nvmlNvlinkGetBwMode_t#
typedef nvmlNvlinkSetBwMode_v1_t nvmlNvlinkSetBwMode_t#
typedef nvmlNvlinkSupportedBwModes_v1_t nvmlNvlinkSupportedBwModes_t#

previous

GPM Structs

next

NvmlClocksEventReasons

On this page
  • Macros
  • Enumerations
  • Functions
  • Structs
  • Typedefs
  • Macros
    • NVML_NVLINK_BER_EXP_SHIFT
    • NVML_NVLINK_BER_EXP_WIDTH
    • NVML_NVLINK_BER_MANTISSA_SHIFT
    • NVML_NVLINK_BER_MANTISSA_WIDTH
    • NVML_NVLINK_ERROR_COUNTER_BER_GET
    • NVML_NVLINK_FIRMWARE_UCODE_TYPE_MSE
    • NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR
    • NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_CLN
    • NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_DLN
    • NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_UPHY
    • NVML_NVLINK_FIRMWARE_VERSION_LENGTH
    • NVML_NVLINK_STATE_ACTIVE
    • NVML_NVLINK_STATE_ACTIVE_TRAFFIC_DISABLED
    • NVML_NVLINK_STATE_INACTIVE
    • NVML_NVLINK_STATE_SLEEP
    • NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES
    • nvmlNvLinkInfo_v1
    • nvmlNvLinkInfo_v2
    • nvmlNvlinkGetBwMode_v1
    • nvmlNvlinkSetBwMode_v1
    • nvmlNvlinkSupportedBwModes_v1
  • Enumerations
    • nvmlNvlinkTelemetrySampleType_t
      • NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_TX
      • NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_RX
      • NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_COUNT
    • nvmlNvlinkVersion_t
      • NVML_NVLINK_VERSION_INVALID
      • NVML_NVLINK_VERSION_1_0
      • NVML_NVLINK_VERSION_2_0
      • NVML_NVLINK_VERSION_2_2
      • NVML_NVLINK_VERSION_3_0
      • NVML_NVLINK_VERSION_3_1
      • NVML_NVLINK_VERSION_4_0
      • NVML_NVLINK_VERSION_5_0
      • NVML_NVLINK_VERSION_6_0
  • Functions
    • nvmlDeviceFreezeNvLinkUtilizationCounter()
    • nvmlDeviceGetNvLinkCapability()
    • nvmlDeviceGetNvLinkErrorCounter()
    • nvmlDeviceGetNvLinkInfo()
    • nvmlDeviceGetNvLinkRemoteDeviceType()
    • nvmlDeviceGetNvLinkRemotePciInfo_v2()
    • nvmlDeviceGetNvLinkState()
    • nvmlDeviceGetNvLinkTelemetrySamples_v1()
    • nvmlDeviceGetNvLinkUtilizationControl()
    • nvmlDeviceGetNvLinkUtilizationCounter()
    • nvmlDeviceGetNvLinkVersion()
    • nvmlDeviceGetNvlinkBwMode()
    • nvmlDeviceGetNvlinkSupportedBwModes()
    • nvmlDeviceResetNvLinkErrorCounters()
    • nvmlDeviceResetNvLinkUtilizationCounter()
    • nvmlDeviceSetNvLinkDeviceLowPowerThreshold()
    • nvmlDeviceSetNvLinkUtilizationControl()
    • nvmlDeviceSetNvlinkBwMode()
    • nvmlDeviceSetNvlinkBwModeAsync_v1()
    • nvmlSystemGetNvlinkBwMode()
    • nvmlSystemSetNvlinkBwMode()
  • Typedefs
    • nvmlNvLinkInfo_t
    • nvmlNvlinkGetBwMode_t
    • nvmlNvlinkSetBwMode_t
    • nvmlNvlinkSupportedBwModes_t
NVIDIA NVIDIA
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2007-2026, NVIDIA Corporation & affiliates. All rights reserved.

Last updated on Sep 09, 2026.