Loading [MathJax]/extensions/tex2jax.js
|
NVIDIA DRIVE OS Linux SDK API Reference
|
6.0.9 Release
|
Go to the documentation of this file.
11 #ifndef INCLUDED_nvrm_gpu_H
12 #define INCLUDED_nvrm_gpu_H
21 #if defined(__cplusplus)
26 #if defined(NVRM_GPU_BUILD_VARIANT)
452 #define NVRM_GPU_DEFINE_LIB_OPEN_ATTR(x) NvRmGpuLibOpenAttr x = { 0U }
658 #define NVRM_GPU_DEVICE_INDEX_DEFAULT (-1)
762 #define NVRM_GPU_DEFINE_DEVICE_OPEN_ATTR(x) \
763 NvRmGpuDeviceOpenAttr x = { NvRmGpuSyncType_Default, false }
848 #if NVOS_IS_LINUX || NVOS_IS_QNX
854 #define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT "d"
860 #define NVRM_GPU_CLOCK_ASYNC_REQ_INVALID_HANDLE (-1)
880 #define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT "p"
886 #define NVRM_GPU_CLOCK_ASYNC_REQ_INVALID_HANDLE (NULL)
1075 size_t *pNumDomains);
1124 size_t *pNumPoints);
1295 uint32_t timeoutMs);
1356 uint32_t timeoutMs);
1462 size_t *pNumSensors);
1503 uint64_t *pVoltageMicroVolt);
1550 size_t *pNumSensors);
1589 uint64_t *pCurrentMicroAmpere);
1634 size_t *pNumSensors);
1673 uint64_t *pPowerMicroWatt);
1720 size_t *pNumSensors);
1761 int32_t *pTemperatureMilliCelsius);
1796 int32_t temperature_mC);
1903 #define NVRM_GPU_DEFINE_DEVICE_EVENT_SESSION_ATTR(x) \
1904 NvRmGpuDeviceEventSessionOpenAttr x = { NULL, 0 }
2053 uint32_t timeoutMs);
2087 #if defined(NVRM_GPU_BUILD_VARIANT)
2091 #if defined(__cplusplus)
2095 #if !defined(NV_SDK_BUILD)
2096 #include "nvrm_gpu_priv.h"
uint64_t freqHz
Frequency for clock request.
NvRmGpuLib * NvRmGpuLibOpen(const NvRmGpuLibOpenAttr *attr)
Opens a new instance of the nvrm_gpu library.
size_t maxVfPoints
Maximum number of voltage/frequency points returned by NvRmGpuClockGetPoints()
Extensible attribute structure for NvRmGpuLibOpen()
@ NvRmGpuClockDomain_Count
Number of clock domains.
NvRmGpuLibDeviceState deviceState
Device attachment state.
NvError NvRmGpuDeviceGetVoltage(NvRmGpuDevice *hDevice, NvRmGpuDeviceVoltage which, uint64_t *pVoltageMicroVolt)
Retrieves the voltage sensor reading.
The version information structure returned by NvRmGpuLibGetVersionInfo().
NvError NvRmGpuDeviceListVoltageSensors(NvRmGpuDevice *hDevice, const NvRmGpuDeviceVoltage **pSensors, size_t *pNumSensors)
Returns the list of available voltage sensors for the device.
@ NvRmGpuDeviceEventId_AlarmVfTableUpdateFailed
VF table update failed.
@ NvRmGpuLibDeviceState_Attached
Device is attached and may be opened with NvRmGpuDeviceOpen()
NvError NvRmGpuClockWaitAsyncReq(NvRmGpuDevice *hDevice, const NvRmGpuClockAsyncReqHandle *phReqs, size_t numEntries, uint32_t timeoutMs)
Waits for the completion of one or more asynchronous clock requests.
const NvRmGpuDeviceEventId * filterList
List of events to listen.
struct NvRmGpuDeviceEventSessionRec NvRmGpuDeviceEventSession
Device event session handle.
@ NvRmGpuDeviceEventId_Count
Number of events.
@ NvRmGpuDeviceEventId_AlarmLocalTargetVfNotPossible
A clock domain frequency is below local target frequency requested by a session.
@ NvRmGpuDeviceVoltage_SRAM
SRAM voltage.
@ NvRmGpuDeviceEventId_AlarmTargetVfNotPossible
A clock domain frequency is below target.
uint32_t patch
The library patch level.
struct NvRmGpuLibRec NvRmGpuLib
Library handle.
NvRmGpuClockRange range
Frequency range of the clock domain.
OS-specific type of asynchronous clock request handle (unimplemented).
struct NvRmGpuClockDomainInfoRec NvRmGpuClockDomainInfo
Clock domain info.
@ NvRmGpuDeviceEventId_VfUpdate
Voltage/frequency update occurred for a clock domain.
NvRmGpuDeviceVoltage
Voltage sensors.
NvError NvRmGpuClockCloseAsyncReq(NvRmGpuDevice *hDevice, NvRmGpuClockAsyncReqHandle hReq)
Closes an asynchronous clock request handle.
static void NvRmGpuDeviceEventSessionOpenAttrSetAllEvents(NvRmGpuDeviceEventSessionOpenAttr *attr)
Assigns device events attribute structure with a list of all events to listen to.
@ NvRmGpuClockDomain_GPCCLK
Main graphics core clock.
int deviceIndex
Internal device index. Used in NvRmGpuDeviceOpen()
NvError NvRmGpuDeviceListPowerSensors(NvRmGpuDevice *hDevice, const NvRmGpuDevicePower **pSensors, size_t *pNumSensors)
Returns the list of available power sensors for the device.
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,...
struct NvRmGpuDeviceEventInfoRec NvRmGpuDeviceEventInfo
GPU device event.
struct NvRmGpuClockSetEntryRec NvRmGpuClockSetEntry
Entry for clock set request.
NvRmGpuClockDomain domain
Domain for clock request.
uint32_t major
The library major version.
@ NvRmGpuSyncType_Syncpoint
Synchronization type is Tegra HOST1X syncpoint.
NvError NvRmGpuLibClose(NvRmGpuLib *hLib)
Closes the library and releases all resources.
NvError NvRmGpuClockGetDomains(NvRmGpuDevice *hDevice, const NvRmGpuClockDomainInfo **infos, size_t *pNumDomains)
Returns available GPU clock domains for the device.
Entry for clock set request.
@ NvRmGpuClockDomain_MCLK
Memory clock.
Entry for clock get request.
@ NvRmGpuDeviceVoltage_Core
Core GPU voltage.
NvError NvRmGpuClockWaitAnyEvent(NvRmGpuDevice *hDevice, uint32_t timeoutMs)
This function is not implemented and it should be deleted.
NvError NvRmGpuDeviceGetCurrent(NvRmGpuDevice *hDevice, NvRmGpuDeviceCurrent which, uint64_t *pCurrentMicroAmpere)
Retrieves the electric current reading.
const NvRmGpuLibDeviceListEntry * NvRmGpuLibListDevices(NvRmGpuLib *hLib, size_t *pNumDevices)
Returns the list of probed GPUs.
@ NvRmGpuDeviceEventId_AlarmThermalAboveThreshold
Temperature above threshold.
NvRmGpuDevicePower
Electric power sensors.
@ NvRmGpuDeviceEventId_AlarmGpuLost
Device lost.
@ NvRmGpuDeviceVoltage_Bus
Bus voltage.
size_t filterListSize
Number of entries in the event list.
NvRmGpuClockType type
(IN) Request type
struct NvRmGpuClockAsyncNotImplemented * NvRmGpuClockAsyncReqHandle
OS-specific type of asynchronous clock request handle.
struct NvRmGpuDeviceEventSessionOpenAttrRec NvRmGpuDeviceEventSessionOpenAttr
Extensible attribute structure for NvRmGpuDeviceEventSessionOpen().
@ NvRmGpuSyncType_SyncFd
Synchronization type is Android/Linux sync fd.
NvRmGpuDeviceTemperature
Temperature sensors.
NvRmGpuClockDomain domain
(IN) Domain for the clock request
NvError NvRmGpuDeviceListCurrentSensors(NvRmGpuDevice *hDevice, const NvRmGpuDeviceCurrent **pSensors, size_t *pNumSensors)
Returns the list of available electric current sensors for the device.
NvError NvRmGpuDeviceOpen(NvRmGpuLib *hLib, int deviceIndex, const NvRmGpuDeviceOpenAttr *attr, NvRmGpuDevice **phDevice)
Opens a GPU device.
NvError NvRmGpuDeviceClose(NvRmGpuDevice *hDevice)
Closes the GPU device.
NvRmGpuSyncType
Inter-engine synchronization type for GPU jobs.
NvError NvRmGpuDeviceEventSessionClose(NvRmGpuDeviceEventSession *hSession)
Closes the device event session.
NvError NvRmGpuDeviceEventSessionRead(NvRmGpuDeviceEventSession *hSession, NvRmGpuDeviceEventInfo *pEventInfo, uint32_t timeoutMs)
Read next device event.
uint64_t timeNs
GPU time (in nanoseconds)
@ NvRmGpuDeviceEventId_AlarmPowerAboveThreshold
Power above threshold.
const char * suffix
Version string suffix (always non-NULL)
NvRmGpuClockDomain domain
Clock domain.
bool sandboxFriendlyChannels
Ignored field.
uint64_t freqHz
(OUT) Frequency in Hz
uint32_t minor
The library minor version.
@ NvRmGpuClockType_Effective
Effective clock as measured from hardware.
struct NvRmGpuClockGetEntryRec NvRmGpuClockGetEntry
Entry for clock get request.
@ NvRmGpuLibDeviceState_Unknown
Device state is not known.
NvError NvRmGpuDeviceThermalAlertSetLimit(NvRmGpuDevice *hDevice, int32_t temperature_mC)
Sets the thermal alert limit.
NvRmGpuClockDomain
Clock domains.
uint32_t reserved
Dummy field for C/C++ ABI compatibility.
Clock voltage/frequency point.
@ NvRmGpuLibDeviceState_InsufficientPrivileges
Device exists, but not enough privileges to access.
NvRmGpuDeviceCurrent
Electric current sensors.
NvRmGpuLibDeviceState
Device attachment state.
Extensible attribute structure for NvRmGpuDeviceOpen()
NvError NvRmGpuClockGet(NvRmGpuDevice *hDevice, NvRmGpuClockGetEntry *pClkGetEntries, size_t numEntries)
Request one or more clock domain frequency state.
@ NvRmGpuClockType_Actual
Clock frequency programmed to the HW (including PLL constraints).
struct NvRmGpuClockPointRec NvRmGpuClockPoint
Clock voltage/frequency point.
NvRmGpuClockType
Request type for clock get.
NvError NvRmGpuDeviceGetTemperature(NvRmGpuDevice *hDevice, NvRmGpuDeviceTemperature which, int32_t *pTemperatureMilliCelsius)
Retrieves the temperature sensor reading.
@ NvRmGpuDeviceEventId_AlarmClockArbiterFailed
The clock arbiter has failed.
@ NvRmGpuDeviceCurrent_Bus
Bus current.
NvError NvRmGpuClockSet(NvRmGpuDevice *hDevice, const NvRmGpuClockSetEntry *pClkSetEntries, size_t numEntries, NvRmGpuClockAsyncReqHandle *phReq)
Requests minimum clocks for one or more clock domains.
struct NvRmGpuDeviceRec NvRmGpuDevice
Device handle.
struct NvRmGpuClockRangeRec NvRmGpuClockRange
Frequency range for clock domain.
@ NvRmGpuDeviceTemperature_InternalSensor
The internal GPU temperature sensor.
NvRmGpuSyncType syncType
The default sync type for this device.
NvError
The NvError enumeration contains ALL return / error codes.
struct NvRmGpuLibVersionInfoRec NvRmGpuLibVersionInfo
The version information structure returned by NvRmGpuLibGetVersionInfo().
NvError NvRmGpuDeviceEventSessionOpen(NvRmGpuDevice *hDevice, const NvRmGpuDeviceEventSessionOpenAttr *attr, NvRmGpuDeviceEventSession **phSession)
Opens a session to monitor device events.
@ NvRmGpuSyncType_Default
Default sync type.
#define NV_ARRAY_SIZE(x)
Macro for determining the size of an array.
NvError NvRmGpuDeviceGetPower(NvRmGpuDevice *hDevice, NvRmGpuDevicePower which, uint64_t *pPowerMicroWatt)
Retrieves the power sensor reading.
struct NvRmGpuLibDeviceListEntryRec NvRmGpuLibDeviceListEntry
Device list entry.
NvRmGpuDeviceEventId eventId
Event type.
Extensible attribute structure for NvRmGpuDeviceEventSessionOpen().
Frequency range for clock domain.
@ NvRmGpuDevicePower_Bus
Power consumed at the regulator.
@ NvRmGpuClockType_Target
Target clock frequency requested by the user.
const NvRmGpuLibVersionInfo * NvRmGpuLibGetVersionInfo(void)
Returns the library version information.
struct NvRmGpuDeviceOpenAttrRec NvRmGpuDeviceOpenAttr
Extensible attribute structure for NvRmGpuDeviceOpen()
const char * name
Informative device name.
NvError NvRmGpuDeviceListTemperatureSensors(NvRmGpuDevice *hDevice, const NvRmGpuDeviceTemperature **pSensors, size_t *pNumSensors)
Returns the list of available temperature sensors for the device.
struct NvRmGpuLibOpenAttrRec NvRmGpuLibOpenAttr
Extensible attribute structure for NvRmGpuLibOpen()
人人超碰97caoporen国产