|
NVIDIA DRIVE OS Linux SDK API Reference
|
5.2.3 Release For Test and Development only
|
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)
37 #if defined(NVRM_GPU_UNIT_TEST_BUILD) && (NVRM_GPU_UNIT_TEST_BUILD)
38 #define NVRM_GPU_ATTR_NAMESPACE(x) ::nvrm_gpu::x
40 #define NVRM_GPU_ATTR_NAMESPACE(x) x
177 #define NVRM_GPU_DEFINE_LIB_OPEN_ATTR(x) \
178 NVRM_GPU_ATTR_NAMESPACE(NvRmGpuLibOpenAttr) x = { 0U }
401 #define NVRM_GPU_DEVICE_INDEX_DEFAULT (-1)
505 #define NVRM_GPU_DEFINE_DEVICE_OPEN_ATTR(x) \
506 NVRM_GPU_ATTR_NAMESPACE(NvRmGpuDeviceOpenAttr) x = { NVRM_GPU_ATTR_NAMESPACE(NvRmGpuSyncType_Default), false }
561 #if NVOS_IS_LINUX || NVOS_IS_QNX
567 #define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT "d"
585 #define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT "p"
755 size_t *pNumDomains);
1020 size_t *pNumSensors);
1043 uint64_t *pVoltageMicroVolt);
1074 size_t *pNumSensors);
1096 uint64_t *pCurrentMicroAmpere);
1125 size_t *pNumSensors);
1147 uint64_t *pPowerMicroWatt);
1177 size_t *pNumSensors);
1200 int32_t *pTemperatureMilliCelsius);
1218 int32_t temperature_mC);
1325 #define NVRM_GPU_DEFINE_DEVICE_EVENT_SESSION_ATTR(x) \
1326 NVRM_GPU_ATTR_NAMESPACE(NvRmGpuDeviceEventSessionOpenAttr) x = { NULL, 0 }
1426 uint32_t timeoutMs);
1444 #if defined(NVRM_GPU_BUILD_VARIANT)
1448 #if defined(__cplusplus)
1452 #if !defined(NV_SDK_BUILD)
1453 #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.
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.
NvError NvRmGpuLibAttachDevice(NvRmGpuLib *hLib, int deviceIndex)
Attaches and powers up a GPU.
@ NvRmGpuDeviceEventId_AlarmTargetVfNotPossible
A clock domain frequency is below target.
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()
bool hasDeviceStateControl
Indicates whether the device can be attached/detached by the user.
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.
@ 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.
NvRmGpuClockDomain domain
Clock domain.
bool sandboxFriendlyChannels
Ignored field.
@ NvRmGpuLibDeviceState_Detached
Device is detached and powered off.
uint64_t freqHz
(OUT) Frequency in Hz
@ 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.
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.
struct NvRmGpuDeviceOpenAttrRec NvRmGpuDeviceOpenAttr
Extensible attribute structure for NvRmGpuDeviceOpen()
NvError NvRmGpuLibDetachDevice(NvRmGpuLib *hLib, int deviceIndex)
Powers down and detaches a GPU.
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()