Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • NVIDIA DRIVE OS Linux SDK API Reference

    6.0.9 Release
    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    GPU access API: Device management

    Detailed Description

    Device control, device capabilities, and device memory management.

    Data Structures

    struct  NvRmGpuClockGetEntryRec
     Entry for clock get request. More...
     
    struct  NvRmGpuClockSetEntryRec
     Entry for clock set request. More...
     
    struct  NvRmGpuClockRangeRec
     Frequency range for clock domain. More...
     
    struct  NvRmGpuClockPointRec
     Clock voltage/frequency point. More...
     
    struct  NvRmGpuClockDomainInfoRec
     Clock domain info. More...
     
    struct  NvRmGpuDeviceEventSessionOpenAttrRec
     Extensible attribute structure for NvRmGpuDeviceEventSessionOpen(). More...
     
    struct  NvRmGpuDeviceEventInfoRec
     GPU device event. More...
     
    struct  NvRmGpuClockAsyncNotImplemented
     OS-specific type of asynchronous clock request handle (unimplemented). More...
     

    Modules

     GPU access API: Device management (safety subset)
     

    Macros

    #define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT   "p"
     Format macro for printf for printing NvRmGpuClockAsyncReqHandle. More...
     
    #define NVRM_GPU_CLOCK_ASYNC_REQ_INVALID_HANDLE   (NULL)
     Invalid handle value. More...
     
    #define NVRM_GPU_DEFINE_DEVICE_EVENT_SESSION_ATTR(x)   NvRmGpuDeviceEventSessionOpenAttr x = { NULL, 0 }
     Definer macro for NvRmGpuDeviceEventSessionOpenAttr. More...
     

    Typedefs

    typedef struct NvRmGpuDeviceEventSessionRec NvRmGpuDeviceEventSession
     Device event session handle. More...
     
    typedef enum NvRmGpuClockType NvRmGpuClockType
     Request type for clock get. More...
     
    typedef struct NvRmGpuClockGetEntryRec NvRmGpuClockGetEntry
     Entry for clock get request. More...
     
    typedef struct NvRmGpuClockSetEntryRec NvRmGpuClockSetEntry
     Entry for clock set request. More...
     
    typedef struct NvRmGpuClockRangeRec NvRmGpuClockRange
     Frequency range for clock domain. More...
     
    typedef struct NvRmGpuClockPointRec NvRmGpuClockPoint
     Clock voltage/frequency point. More...
     
    typedef struct NvRmGpuClockDomainInfoRec NvRmGpuClockDomainInfo
     Clock domain info. More...
     
    typedef struct NvRmGpuDeviceEventSessionOpenAttrRec NvRmGpuDeviceEventSessionOpenAttr
     Extensible attribute structure for NvRmGpuDeviceEventSessionOpen(). More...
     
    typedef struct NvRmGpuDeviceEventInfoRec NvRmGpuDeviceEventInfo
     GPU device event. More...
     
    typedef struct NvRmGpuClockAsyncNotImplementedNvRmGpuClockAsyncReqHandle
     OS-specific type of asynchronous clock request handle. More...
     

    Enumerations

    enum  NvRmGpuClockDomain {
      NvRmGpuClockDomain_MCLK = 0,
      NvRmGpuClockDomain_GPCCLK,
      NvRmGpuClockDomain_Count
    }
     Clock domains. More...
     
    enum  NvRmGpuClockType {
      NvRmGpuClockType_Target = 1,
      NvRmGpuClockType_Actual = 2,
      NvRmGpuClockType_Effective = 3
    }
     Request type for clock get. More...
     
    enum  NvRmGpuDeviceVoltage {
      NvRmGpuDeviceVoltage_Core = 1,
      NvRmGpuDeviceVoltage_SRAM,
      NvRmGpuDeviceVoltage_Bus
    }
     Voltage sensors. More...
     
    enum  NvRmGpuDeviceCurrent { NvRmGpuDeviceCurrent_Bus = 1 }
     Electric current sensors. More...
     
    enum  NvRmGpuDevicePower { NvRmGpuDevicePower_Bus = 1 }
     Electric power sensors. More...
     
    enum  NvRmGpuDeviceTemperature { NvRmGpuDeviceTemperature_InternalSensor = 1 }
     Temperature sensors. More...
     
    enum  NvRmGpuDeviceEventId {
      NvRmGpuDeviceEventId_VfUpdate = 0,
      NvRmGpuDeviceEventId_AlarmTargetVfNotPossible,
      NvRmGpuDeviceEventId_AlarmLocalTargetVfNotPossible,
      NvRmGpuDeviceEventId_AlarmClockArbiterFailed,
      NvRmGpuDeviceEventId_AlarmVfTableUpdateFailed,
      NvRmGpuDeviceEventId_AlarmThermalAboveThreshold,
      NvRmGpuDeviceEventId_AlarmPowerAboveThreshold,
      NvRmGpuDeviceEventId_AlarmGpuLost,
      NvRmGpuDeviceEventId_Count
    }
     

    Functions

    NvError NvRmGpuClockGetDomains (NvRmGpuDevice *hDevice, const NvRmGpuClockDomainInfo **infos, size_t *pNumDomains)
     Returns available GPU clock domains for the device. More...
     
    NvError NvRmGpuClockGetPoints (NvRmGpuDevice *hDevice, NvRmGpuClockDomain domain, NvRmGpuClockPoint *pClkPoints, size_t *pNumPoints)
     Retrieves voltage/frequency (VF) points for a given clock domain. For information about VF points, see NvRmGpuClockAsyncReqHandle. More...
     
    NvError NvRmGpuClockSet (NvRmGpuDevice *hDevice, const NvRmGpuClockSetEntry *pClkSetEntries, size_t numEntries, NvRmGpuClockAsyncReqHandle *phReq)
     Requests minimum clocks for one or more clock domains. More...
     
    NvError NvRmGpuClockWaitAsyncReq (NvRmGpuDevice *hDevice, const NvRmGpuClockAsyncReqHandle *phReqs, size_t numEntries, uint32_t timeoutMs)
     Waits for the completion of one or more asynchronous clock requests. More...
     
    NvError NvRmGpuClockCloseAsyncReq (NvRmGpuDevice *hDevice, NvRmGpuClockAsyncReqHandle hReq)
     Closes an asynchronous clock request handle. More...
     
    NvError NvRmGpuClockWaitAnyEvent (NvRmGpuDevice *hDevice, uint32_t timeoutMs)
     This function is not implemented and it should be deleted. More...
     
    NvError NvRmGpuClockGet (NvRmGpuDevice *hDevice, NvRmGpuClockGetEntry *pClkGetEntries, size_t numEntries)
     Request one or more clock domain frequency state. More...
     
    NvError NvRmGpuDeviceListVoltageSensors (NvRmGpuDevice *hDevice, const NvRmGpuDeviceVoltage **pSensors, size_t *pNumSensors)
     Returns the list of available voltage sensors for the device. More...
     
    NvError NvRmGpuDeviceGetVoltage (NvRmGpuDevice *hDevice, NvRmGpuDeviceVoltage which, uint64_t *pVoltageMicroVolt)
     Retrieves the voltage sensor reading. More...
     
    NvError NvRmGpuDeviceListCurrentSensors (NvRmGpuDevice *hDevice, const NvRmGpuDeviceCurrent **pSensors, size_t *pNumSensors)
     Returns the list of available electric current sensors for the device. More...
     
    NvError NvRmGpuDeviceGetCurrent (NvRmGpuDevice *hDevice, NvRmGpuDeviceCurrent which, uint64_t *pCurrentMicroAmpere)
     Retrieves the electric current reading. More...
     
    NvError NvRmGpuDeviceListPowerSensors (NvRmGpuDevice *hDevice, const NvRmGpuDevicePower **pSensors, size_t *pNumSensors)
     Returns the list of available power sensors for the device. More...
     
    NvError NvRmGpuDeviceGetPower (NvRmGpuDevice *hDevice, NvRmGpuDevicePower which, uint64_t *pPowerMicroWatt)
     Retrieves the power sensor reading. More...
     
    NvError NvRmGpuDeviceListTemperatureSensors (NvRmGpuDevice *hDevice, const NvRmGpuDeviceTemperature **pSensors, size_t *pNumSensors)
     Returns the list of available temperature sensors for the device. More...
     
    NvError NvRmGpuDeviceGetTemperature (NvRmGpuDevice *hDevice, NvRmGpuDeviceTemperature which, int32_t *pTemperatureMilliCelsius)
     Retrieves the temperature sensor reading. More...
     
    NvError NvRmGpuDeviceThermalAlertSetLimit (NvRmGpuDevice *hDevice, int32_t temperature_mC)
     Sets the thermal alert limit. More...
     
    static void NvRmGpuDeviceEventSessionOpenAttrSetAllEvents (NvRmGpuDeviceEventSessionOpenAttr *attr)
     Assigns device events attribute structure with a list of all events to listen to. More...
     
    NvError NvRmGpuDeviceEventSessionOpen (NvRmGpuDevice *hDevice, const NvRmGpuDeviceEventSessionOpenAttr *attr, NvRmGpuDeviceEventSession **phSession)
     Opens a session to monitor device events. More...
     
    NvError NvRmGpuDeviceEventSessionRead (NvRmGpuDeviceEventSession *hSession, NvRmGpuDeviceEventInfo *pEventInfo, uint32_t timeoutMs)
     Read next device event. More...
     
    NvError NvRmGpuDeviceEventSessionClose (NvRmGpuDeviceEventSession *hSession)
     Closes the device event session. More...
     

    Macro Definition Documentation

    ◆ NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT

    #define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT   "p"

    Format macro for printf for printing NvRmGpuClockAsyncReqHandle.

    The use is similar to PRIu64 for printing uint64_t.

    Definition at line 880 of file nvrm_gpu.h.

    ◆ NVRM_GPU_CLOCK_ASYNC_REQ_INVALID_HANDLE

    #define NVRM_GPU_CLOCK_ASYNC_REQ_INVALID_HANDLE   (NULL)

    Invalid handle value.

    See also
    NvRmGpuClockAsyncReqHandle

    Definition at line 886 of file nvrm_gpu.h.

    ◆ NVRM_GPU_DEFINE_DEVICE_EVENT_SESSION_ATTR

    #define NVRM_GPU_DEFINE_DEVICE_EVENT_SESSION_ATTR (   x)    NvRmGpuDeviceEventSessionOpenAttr x = { NULL, 0 }

    Definer macro for NvRmGpuDeviceEventSessionOpenAttr.

    This macro defines a variable of type NvRmGpuDeviceEventSessionOpenAttr with the default values.

    See also
    NvRmGpuDeviceEventSessionOpen()

    Definition at line 1903 of file nvrm_gpu.h.

    Typedef Documentation

    ◆ NvRmGpuClockAsyncReqHandle

    OS-specific type of asynchronous clock request handle.

    Asynchronous clock request handle is a waitable handle for clock change requests. This allows one to issue multiple clock change requests concurrently (e.g., GPU clock and memory clock for multiple devices) and then wait for all of them to complete.

    Use NVRM_GPU_CLOCK_ASYNC_REQ_INVALID_HANDLE to safely initialize a handle.

    Remarks
    This is void pointer on operating systems that do not support asynchronous clock request handles. HOS does not have the support.

    Definition at line 908 of file nvrm_gpu.h.

    ◆ NvRmGpuClockDomainInfo

    ◆ NvRmGpuClockGetEntry

    Entry for clock get request.

    See also
    NvRmGpuClockGet()

    ◆ NvRmGpuClockPoint

    Clock voltage/frequency point.

    See also
    NvRmGpuClockGetPoints()

    ◆ NvRmGpuClockRange

    Frequency range for clock domain.

    See also
    NvRmGpuClockGetDomains()

    ◆ NvRmGpuClockSetEntry

    Entry for clock set request.

    See also
    NvRmGpuClockSet()

    ◆ NvRmGpuClockType

    Request type for clock get.

    See also
    NvRmGpuClockGet()

    ◆ NvRmGpuDeviceEventInfo

    GPU device event.

    Data type for a single GPU device event. This contains the timestamp and the event type.

    See also
    NvRmGpuDeviceEventSessionRead()
    NvRmGpuDeviceReadTimeNs()

    ◆ NvRmGpuDeviceEventSession

    typedef struct NvRmGpuDeviceEventSessionRec NvRmGpuDeviceEventSession

    Device event session handle.

    See also
    NvRmGpuDeviceEventSessionOpen()
    NvRmGpuDeviceEventSessionClose()

    Definition at line 352 of file nvrm_gpu.h.

    ◆ NvRmGpuDeviceEventSessionOpenAttr

    Enumeration Type Documentation

    ◆ NvRmGpuClockDomain

    Clock domains.

    The GPU has different clock domains that can be queried or requested separately. These include the memory clock and the graphics clock.

    See also
    NvRmGpuClockGetDomains(), NvRmGpuDeviceInfo::clockDomains
    Enumerator
    NvRmGpuClockDomain_MCLK 

    Memory clock.

    NvRmGpuClockDomain_GPCCLK 

    Main graphics core clock.

    NvRmGpuClockDomain_Count 

    Number of clock domains.

    Definition at line 918 of file nvrm_gpu.h.

    ◆ NvRmGpuClockType

    Request type for clock get.

    See also
    NvRmGpuClockGet()
    Enumerator
    NvRmGpuClockType_Target 

    Target clock frequency requested by the user.

    This is the minimum frequency requested by the user. The programmed
    frequency may differ. 
    
    NvRmGpuClockType_Actual 

    Clock frequency programmed to the HW (including PLL constraints).

    @remark This is called the "Actual" clock frequency as this frequency is
    the one that is actually programmed. 
    
    NvRmGpuClockType_Effective 

    Effective clock as measured from hardware.

    Definition at line 934 of file nvrm_gpu.h.

    ◆ NvRmGpuDeviceCurrent

    Electric current sensors.

    Enumerator
    NvRmGpuDeviceCurrent_Bus 

    Bus current.

    Definition at line 1507 of file nvrm_gpu.h.

    ◆ NvRmGpuDeviceEventId

    GPU device event type

    See also
    NvRmGpuDeviceEventSessionOpen()
    Enumerator
    NvRmGpuDeviceEventId_VfUpdate 

    Voltage/frequency update occurred for a clock domain.

    This can be because of:

    • an nvrm_gpu user issued a target frequency request; or
    • because of a change in thermal or power conditions.

    This is an informational event.

    NvRmGpuDeviceEventId_AlarmTargetVfNotPossible 

    A clock domain frequency is below target.

    This indicates that the GPU may be operating at lower than expected
    performance. 
    
    NvRmGpuDeviceEventId_AlarmLocalTargetVfNotPossible 

    A clock domain frequency is below local target frequency requested by a session.

    This indicates that the GPU may be operating at lower than expected performance.

    NvRmGpuDeviceEventId_AlarmClockArbiterFailed 

    The clock arbiter has failed.

    This is a system failure. Frequency change requests may not be honored
    anymore. 
    
    NvRmGpuDeviceEventId_AlarmVfTableUpdateFailed 

    VF table update failed.

    VF table update is typically related to operating condition
    change. Something went wrong and VF tables could not be updated.
    
    This is a system failure. 
    
    NvRmGpuDeviceEventId_AlarmThermalAboveThreshold 

    Temperature above threshold.

    The GPU temperature is above threshold. Measures may have to be taken to
    prevent thermal throttling. For instance, target frequencies may need to
    be lowered.
    
    @sa NvRmGpuDeviceThermalAlertSetLimit() 
    
    NvRmGpuDeviceEventId_AlarmPowerAboveThreshold 

    Power above threshold.

    The GPU power drain is above threshold. Measures may have to be taken to
    remedy the condition. For instance, target frequencies may need to be
    lowered. 
    
    NvRmGpuDeviceEventId_AlarmGpuLost 

    Device lost.

    The GPU device is lost. This may be due to number of reasons, such as
    bus failure, power failure, hardware failure, GPU hang/reboot, firmware
    failure, or a programming failure due to KMD.
    
    This is a system failure. The nvrm_gpu user should close all resources.
    
    @remark NvRmGpuDeviceClose() 
    
    NvRmGpuDeviceEventId_Count 

    Number of events.

    Definition at line 1803 of file nvrm_gpu.h.

    ◆ NvRmGpuDevicePower

    Electric power sensors.

    Enumerator
    NvRmGpuDevicePower_Bus 

    Power consumed at the regulator.

    Definition at line 1593 of file nvrm_gpu.h.

    ◆ NvRmGpuDeviceTemperature

    Temperature sensors.

    Enumerator
    NvRmGpuDeviceTemperature_InternalSensor 

    The internal GPU temperature sensor.

    Definition at line 1678 of file nvrm_gpu.h.

    ◆ NvRmGpuDeviceVoltage

    Voltage sensors.

    Enumerator
    NvRmGpuDeviceVoltage_Core 

    Core GPU voltage.

    NvRmGpuDeviceVoltage_SRAM 

    SRAM voltage.

    NvRmGpuDeviceVoltage_Bus 

    Bus voltage.

    Definition at line 1415 of file nvrm_gpu.h.

    Function Documentation

    ◆ NvRmGpuClockCloseAsyncReq()

    NvError NvRmGpuClockCloseAsyncReq ( NvRmGpuDevice hDevice,
    NvRmGpuClockAsyncReqHandle  hReq 
    )

    Closes an asynchronous clock request handle.

    Frees all resources related to an asynchronous request created with NvRmGpuClockSet(). It is not mandatory to wait for request completion before closing the handle.

    Parameters
    [in]hDeviceDevice handle
    [in]hReqAsynchronous request handle to close. May be NULL.
    Returns
    The usual NvError code
    Return values
    NvSuccessHandle closed successfully, or NULL handle was provided.
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasClockControls
    See also
    NvRmGpuClockSet()
    NvRmGpuClockWaitAsyncReq()
    Precondition
    Asynchronous requests were created successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuClockGet()

    NvError NvRmGpuClockGet ( NvRmGpuDevice hDevice,
    NvRmGpuClockGetEntry pClkGetEntries,
    size_t  numEntries 
    )

    Request one or more clock domain frequency state.

    This function can be used to request control frequencies on clock domains. This function accepts one or more requests. The request is targeted for:

    • clock domain (e.g., GPC core clock, memory clock). See NvRmGpuClockDomain.
    • control information type: application target frequency, programmed frequency, measured frequency. See NvRmGpuClockType.
    Parameters
    [in]hDeviceDevice handle
    [in,out]pClkGetEntriesArray of clock request entries. For each entry, the clock domain and clock types must be set. Upon a successful call the associated frequency will be returned on a successful call. It is allowed to mix several clocks domains and clock request types in the same request.
    [in]numEntriesNumber of request entries.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_NotSupportedClock controls API not supported.
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasClockControls
    See also
    NvRmGpuClockSet()
    NvRmGpuClockGetDomains()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuClockGetDomains()

    NvError NvRmGpuClockGetDomains ( NvRmGpuDevice hDevice,
    const NvRmGpuClockDomainInfo **  infos,
    size_t *  pNumDomains 
    )

    Returns available GPU clock domains for the device.

    Parameters
    [in]hDeviceDevice handle.
    [out]infosArray of available clock domains. This list is valid during the life-time of the hDevice handle. The returned pointer must not be freed by the caller.
    [out]pNumDomainsNumber of domains in array.
    Returns
    The usual NvError return code.
    Return values
    NvSuccessSuccessful request.
    NvError_NotSupportedClock controls API not supported by this device. Capability NvRmGpuDeviceInfo::hasClockControls for this device is false.
    NvError_*Unspecified error. Error code returned for diagnostics.
    Remarks
    Requires NvRmGpuDeviceInfo::hasClockControls. This function can be used to probe the capability. If NvError_NotSupported is returned, then NvRmGpuDeviceInfo::hasClockControls is false.
    There may be more actual clock domains in the GPU HW than returned by this function. This function returns the domains that can be queried or requested.
    See also
    NvRmGpuClockGetPoints()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuClockGetPoints()

    NvError NvRmGpuClockGetPoints ( NvRmGpuDevice hDevice,
    NvRmGpuClockDomain  domain,
    NvRmGpuClockPoint pClkPoints,
    size_t *  pNumPoints 
    )

    Retrieves voltage/frequency (VF) points for a given clock domain. For information about VF points, see NvRmGpuClockAsyncReqHandle.

    Each clock domain has VF points, defined as frequencies for which voltage is optimal. In general, the clock arbiter will try to program frequencies which correspond to VF points.

    Parameters
    [in]hDeviceDevice handle.
    [in]domainClock domain to query.
    [out]pClkPointsPointer to receive the array of optimal VF points. The allocated array must contain space for at least NvRmGpuClockDomainInfo::maxVfPoints (as retrieved by NvRmGpuClockGetDomains()).
    [out]pNumPointsNumber of VF points. May vary depending on thermal conditions, and will be at most NvRmGpuClockDomainInfo::maxVfPoints.
    Returns
    The usual NvError return code.
    Return values
    NvSuccessSuccessful request.
    NvError_NotSupportedClock controls API not supported by this device.
    NvError_*Unspecified error. Error code returned for diagnostics.
    Remarks
    Requires NvRmGpuDeviceInfo::hasClockControls
    See also
    NvRmGpuClockGet(), NvRmGpuClockSet()
    NvRmGpuClockGetDomains()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuClockSet()

    NvError NvRmGpuClockSet ( NvRmGpuDevice hDevice,
    const NvRmGpuClockSetEntry pClkSetEntries,
    size_t  numEntries,
    NvRmGpuClockAsyncReqHandle phReq 
    )

    Requests minimum clocks for one or more clock domains.

    This function allows the caller to request minimum GPU clocks for one or more GPU clock domains. Both synchronous and asynchronous requests are supported.

    In the asynchronous case, a waitable clock handle is returned. When setting clocks on multiple devices, the asynchronous mode allows one to perform all requests concurrently, and then wait until the clocks have been set. Clock stabilization can take a while.

    When another request is made for a clock domain in the same NvRmGpuDevice instance, the previous requests are overridden.

    The actually programmed clock frequency may not be exactly the requested frequency. Generally, the clock arbiter chooses the optimal voltage-frequency point that is at least as high as the highest frequency requested by any GPU user. However, depending on the thermal and other conditions, the actual GPU frequency may be also lower. Use NvRmGpuClockGet() to query the programmed and the effective frequencies. NvRmGpuDeviceEventSession can be also used to monitor changes in the GPU frequencies.

    Parameters
    [in]hDeviceDevice handle.
    [in]pClkSetEntriesArray of request entries. Each entry requests target frequency for one clock domain. If a clock domain appears multiple times in one call (not recommended), then only the last entry will be taken into account.
    [in]numEntriesNumber of entries in the pClkSetEntries array.
    [out]phReqPointer to asynchronous request handle or NULL for a synchronous request
    • If NULL, the request is synchronous and function returns only after all clocks are programmed.
    • If non-NULL, the request is asynchronous and a waitable request completion handle is returned on success. Use NvRmGpuClockWaitAsyncReq() to wait using the handle. The request handle must be closed by the caller using NvRmGpuClockCloseAsyncReq().
    Returns
    The usual NvError code. In case of error, the asynchronous request handle is not returned.
    Return values
    NvSuccessThe request was successfully made. In the synchronous case, the wait was also successful. In the asynchronous case, the request handle is returned.
    NvError_NotSupportedClock controls API not supported by this device.
    NvError_BusyA temporary blocking condition when submitting the asynchronous request. The user should try again.
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasClockControls
    The synchronous wait case is equivalent with performing the asynchronous wait request followed immediately by calls to NvRmGpuClockWaitAsyncReq() and NvRmGpuClockCloseAsyncReq().
    A subsequent clock request to a domain supersedes the previous request (per NvRmGpuDevice instance)
    The lifespan of GPU clock requests is tied to the NvRmGpuDevice instance. All requests by the user are canceled when the NvRmGpuDevice handle is closed.
    The clock requests of all NvRmGpuDevice instances are coalesced. Generally, given that thermal and power limits are not exceeded, the actual clock frequency will be at least the greatest requested. The exact selection algorithm depends on the global clock management driver policy. The selection algorithm is run by the "clock arbiter" within the KMD component.
    Actual frequency might differ depending on global policies, requests from other NvRmGpuDevice instances, or thermal conditions.
    If specified target frequency is not a VF point, clock arbiter will generally try to program the clocks with first VF point that is greater than or equal to specified target frequency (assuming a single application)
    See also
    NvRmGpuClockGet()
    NvRmGpuClockGetDomains()
    NvRmGpuClockWaitAsyncReq()
    NvRmGpuClockCloseAsyncReq()
    NvRmGpuDeviceEventSessionOpen()
    NvRmGpuClockWaitAnyEvent()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Async/Sync
        • Async if phReq was provided; and
        • Sync if phReq was NULL.
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuClockWaitAnyEvent()

    NvError NvRmGpuClockWaitAnyEvent ( NvRmGpuDevice hDevice,
    uint32_t  timeoutMs 
    )

    This function is not implemented and it should be deleted.

    Precondition
    N/A.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuClockWaitAsyncReq()

    NvError NvRmGpuClockWaitAsyncReq ( NvRmGpuDevice hDevice,
    const NvRmGpuClockAsyncReqHandle phReqs,
    size_t  numEntries,
    uint32_t  timeoutMs 
    )

    Waits for the completion of one or more asynchronous clock requests.

    Parameters
    [in]hDeviceDevice handle
    [in]phReqsArray of request handles.
    [in]numEntriesNumber of entries in the request array.
    [in]timeoutMsWait timeout in milliseconds. Use as follows:
    • NV_WAIT_INFINITE: No timeout, indefinite wait
    • >=0: Timeout specified. The function returns when the request completes or when the timeout expires, whichever comes first.
    • 0: Peek. The function returns immediately.
    Returns
    The usual NvError return value
    Return values
    NvSuccessAll requests have completed.
    NvError_TimeoutTimeout was reached before all requests were completed.
    NvError_BadValueOne or more of the handles is invalid.
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasClockControls
    When this functions returns an error, the state of the request handles in phReq is left undefined. The handles should be closed without any further operation on them.
    See also
    NvRmGpuClockSet()
    Precondition
    Asynchronous requests were created successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceEventSessionClose()

    NvError NvRmGpuDeviceEventSessionClose ( NvRmGpuDeviceEventSession hSession)

    Closes the device event session.

    Parameters
    [in]hSessionDevice event session handle to close. May be NULL.
    Returns
    The usual NvError return code
    Return values
    NvSuccessEvent session closed successfully or hSession was NULL.
    NvError_*Unspecified error while closing the session. The session is closed, regardless. The error code is returned for diagnostic purposes.
    Remarks
    Regardless of possible errors in deinitialization, the object will be closed.
    Precondition
    Device event session is opened successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceEventSessionOpen()

    NvError NvRmGpuDeviceEventSessionOpen ( NvRmGpuDevice hDevice,
    const NvRmGpuDeviceEventSessionOpenAttr attr,
    NvRmGpuDeviceEventSession **  phSession 
    )

    Opens a session to monitor device events.

    Parameters
    [in]hDeviceDevice handle.
    [in]attrEvent session attributes. The attribute structure contains the device event filter list.
    [out]phSessionPointer to receive the event session handle on success.
    Returns
    The usual NvError return code
    Return values
    NvSuccessDevice event session created successfully.
    NvError_NotSupportedThis device does not support device events.
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDevice::hasDeviceEvents
    See also
    NvRmGpuDeviceEventSessionClose()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceEventSessionOpenAttrSetAllEvents()

    static void NvRmGpuDeviceEventSessionOpenAttrSetAllEvents ( NvRmGpuDeviceEventSessionOpenAttr attr)
    inlinestatic

    Assigns device events attribute structure with a list of all events to listen to.

    Parameters
    [out]attrNon-NULL pointer to the device events attribute struct.
    See also
    NvRmGpuDeviceEventSessionOpenAttr
    Precondition
    None.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    Definition at line 1929 of file nvrm_gpu.h.

    References NvRmGpuDeviceEventSessionOpenAttrRec::filterList, NvRmGpuDeviceEventSessionOpenAttrRec::filterListSize, NV_ARRAY_SIZE, NvRmGpuDeviceEventId_AlarmClockArbiterFailed, NvRmGpuDeviceEventId_AlarmGpuLost, NvRmGpuDeviceEventId_AlarmLocalTargetVfNotPossible, NvRmGpuDeviceEventId_AlarmPowerAboveThreshold, NvRmGpuDeviceEventId_AlarmTargetVfNotPossible, NvRmGpuDeviceEventId_AlarmThermalAboveThreshold, NvRmGpuDeviceEventId_AlarmVfTableUpdateFailed, and NvRmGpuDeviceEventId_VfUpdate.

    ◆ NvRmGpuDeviceEventSessionRead()

    NvError NvRmGpuDeviceEventSessionRead ( NvRmGpuDeviceEventSession hSession,
    NvRmGpuDeviceEventInfo pEventInfo,
    uint32_t  timeoutMs 
    )

    Read next device event.

    Parameters
    [in]hSessionEvent session handle
    [out]pEventInfoPointer to receive the event on success
    [in]timeoutMsTimeout value in milliseconds. Special values:
    Returns
    NvSuccess indicates that one event occurred, and detailed information has been updated in pEventInfo. NvError_Timeout indicates that timeout was reached.
    Remarks
    When an event occurs while there is a previous pending event of the same type, the events are merged. In this case, only one event is reported.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_TimeoutTimeout occurred before an event was available
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    See also
    NvRmGpuDeviceEventSessionOpen()
    NvRmGpuDeviceEventInfo
    Precondition
    Device event session is opened successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceGetCurrent()

    NvError NvRmGpuDeviceGetCurrent ( NvRmGpuDevice hDevice,
    NvRmGpuDeviceCurrent  which,
    uint64_t *  pCurrentMicroAmpere 
    )

    Retrieves the electric current reading.

    Parameters
    [in]hDeviceDevice handle.
    [in]whichThe current sensor to query.
    [out]pCurrentMicroAmperePointer to receive the current in microamperes.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasDeviceSensorInfo
    See NvRmGpuDeviceListCurrentSensors() for the available electric current sensors for the device.
    See also
    NvRmGpuDeviceListCurrentSensors()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceGetPower()

    NvError NvRmGpuDeviceGetPower ( NvRmGpuDevice hDevice,
    NvRmGpuDevicePower  which,
    uint64_t *  pPowerMicroWatt 
    )

    Retrieves the power sensor reading.

    Parameters
    [in]hDeviceDevice handle.
    [in]whichThe power sensor to query.
    [out]pPowerMicroWattPower in microwatts.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_NotSupportedNot supported on this device
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    See NvRmGpuDeviceListPowerSensors() for the available electric power sensors for the device.
    Requires NvRmGpuDeviceInfo::hasDeviceSensorInfo
    See also
    NvRmGpuDeviceListPowerSensors()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceGetTemperature()

    NvError NvRmGpuDeviceGetTemperature ( NvRmGpuDevice hDevice,
    NvRmGpuDeviceTemperature  which,
    int32_t *  pTemperatureMilliCelsius 
    )

    Retrieves the temperature sensor reading.

    Parameters
    [in]hDeviceDevice handle.
    [in]whichTemperature sensor to query.
    [out]pTemperatureMilliCelsiusPointer to receive the temperature reading in millidegrees Celsius.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_NotSupportedNot supported on this device
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasDeviceSensorInfo
    See NvRmGpuDeviceListPowerSensors() for the available temperature sensors for the device.
    See also
    NvRmGpuDeviceListTemperatureSensors()
    NvRmGpuDeviceThermalAlertSetLimit()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceGetVoltage()

    NvError NvRmGpuDeviceGetVoltage ( NvRmGpuDevice hDevice,
    NvRmGpuDeviceVoltage  which,
    uint64_t *  pVoltageMicroVolt 
    )

    Retrieves the voltage sensor reading.

    Parameters
    [in]hDeviceDevice handle
    [in]whichThe voltage sensor to query
    [out]pVoltageMicroVoltnon-NULL pointer to receive the voltage in microvolts.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_NotSupportedNot supported on this device
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasDeviceSensorInfo
    See NvRmGpuDeviceListVoltageSensors() for the available voltage sensors for the device.
    See also
    NvRmGpuDeviceListVoltageSensors()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceListCurrentSensors()

    NvError NvRmGpuDeviceListCurrentSensors ( NvRmGpuDevice hDevice,
    const NvRmGpuDeviceCurrent **  pSensors,
    size_t *  pNumSensors 
    )

    Returns the list of available electric current sensors for the device.

    Parameters
    [in]hDeviceDevice handle.
    [out]pSensorsNon-NULL pointer to receive a pointer to the array of available sensors. The returned pointer may be NULL if no sensors are available. The returned pointer is valid for the life-time of hDevice and it must not be freed by the caller.
    [out]pNumSensorsNon-NULL pointer to receive the number of available sensors.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    See also
    NvRmGpuDeviceGetCurrent()
    Precondition
    Device was opened successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceListPowerSensors()

    NvError NvRmGpuDeviceListPowerSensors ( NvRmGpuDevice hDevice,
    const NvRmGpuDevicePower **  pSensors,
    size_t *  pNumSensors 
    )

    Returns the list of available power sensors for the device.

    Parameters
    [in]hDeviceDevice handle.
    [out]pSensorsNon-NULL pointer to receive a pointer to the array of available sensors. The returned pointer may be NULL if no sensors are available. The returned pointer is valid for the life-time of hDevice and it must not be freed by the caller.
    [out]pNumSensorsNon-NULL pointer to receive the number of available sensors.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    See also
    NvRmGpuDeviceGetPower()
    Precondition
    Device is opened successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceListTemperatureSensors()

    NvError NvRmGpuDeviceListTemperatureSensors ( NvRmGpuDevice hDevice,
    const NvRmGpuDeviceTemperature **  pSensors,
    size_t *  pNumSensors 
    )

    Returns the list of available temperature sensors for the device.

    Parameters
    [in]hDeviceDevice handle.
    [out]pSensorsNon-NULL pointer to receive a pointer to the array of available sensors. The returned pointer may be NULL if no sensors are available. The returned pointer is valid for the life-time of hDevice and it must not be freed by the caller.
    [out]pNumSensorsNon-NULL pointer to receive the number of available sensors.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_NotSupportedNot supported on this device
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    See also
    NvRmGpuDeviceGetTemperature()
    Precondition
    Device is opened successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceListVoltageSensors()

    NvError NvRmGpuDeviceListVoltageSensors ( NvRmGpuDevice hDevice,
    const NvRmGpuDeviceVoltage **  pSensors,
    size_t *  pNumSensors 
    )

    Returns the list of available voltage sensors for the device.

    Parameters
    [in]hDeviceDevice handle.
    [out]pSensorsNon-NULL pointer to receive a pointer to the array of available sensors. The returned pointer may be NULL if no sensors are available. The returned pointer is valid for the life-time of hDevice and it must not be freed by the caller.
    [out]pNumSensorsNon-NULL pointer to receive the number of available sensors.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful request
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    See also
    NvRmGpuDeviceGetVoltage()
    Precondition
    Device was opened successfully.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No

    ◆ NvRmGpuDeviceThermalAlertSetLimit()

    NvError NvRmGpuDeviceThermalAlertSetLimit ( NvRmGpuDevice hDevice,
    int32_t  temperature_mC 
    )

    Sets the thermal alert limit.

    Parameters
    hDeviceDevice handle.
    temperature_mCThermal temperature alert threshold in millidegrees Celsius.
    Returns
    The usual NvError return code
    Return values
    NvSuccessSuccessful operation
    NvError_NotSupportedOperation not supported for the device.
    NvError_*Unspecified error. The error code is returned for diagnostic purposes.
    Remarks
    Requires NvRmGpuDeviceInfo::hasDeviceThermalAlert
    See also
    NvRmGpuDeviceGetTemperature()
    Precondition
    Device is opened successfully and supports the feature. See remarks for the condition.


    Usage considerations

    • Allowed context for the API call
      • Thread-safe: Yes
      • Interrupt handler: No
      • Signal handler: No
      • Re-entrant: Yes
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: No
    人人超碰97caoporen国产