NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvrm_gpu.h File Reference

Detailed Description

NVIDIA Resource Manager: Discrete GPU

Description: This file contains a resource manager API for GPU clock controls.

Definition in file nvrm_gpu.h.

Go to the source code of this file.

Data Structures

struct  NvRmGpuLibOpenAttrRec
 
struct  NvRmGpuLibDeviceListEntryRec
 
struct  NvRmGpuDeviceOpenAttrRec
 
struct  NvRmGpuClockGetEntryRec
 
struct  NvRmGpuClockSetEntryRec
 
struct  NvRmGpuClockRangeRec
 
struct  NvRmGpuClockPointRec
 
struct  NvRmGpuClockDomainInfoRec
 
struct  NvRmGpuDeviceEventSessionOpenAttrRec
 Holds the events for which to listen. More...
 
struct  NvRmGpuDeviceEventInfoRec
 

Macros

#define NVRM_GPU_DEFINE_LIB_OPEN_ATTR(x)   NvRmGpuLibOpenAttr x = { 0 }
 
#define NVRM_GPU_DEVICE_INDEX_DEFAULT   (-1)
 
#define NVRM_GPU_DEFINE_DEVICE_OPEN_ATTR(x)   NvRmGpuDeviceOpenAttr x = { NvRmGpuSyncType_Default, false }
 
#define NVRM_GPU_CLOCK_ASYNC_REQ_HANDLE_PRIFMT   "p"
 NvRmGpuDevice subinterface for application-driven GPU clock frequency management. More...
 
#define NVRM_GPU_DEFINE_DEVICE_EVENT_SESSION_ATTR(x)   NvRmGpuDeviceEventSessionOpenAttr x = { NULL, 0 }
 

Typedefs

typedef struct NvRmGpuLibRec NvRmGpuLib
 Handle type. More...
 
typedef struct NvRmGpuDeviceRec NvRmGpuDevice
 Handle type. More...
 
typedef struct
NvRmGpuLibOpenAttrRec 
NvRmGpuLibOpenAttr
 
typedef struct
NvRmGpuLibDeviceListEntryRec 
NvRmGpuLibDeviceListEntry
 
typedef struct
NvRmGpuDeviceOpenAttrRec 
NvRmGpuDeviceOpenAttr
 
typedef struct
NvRmGpuClockAsyncNotImplemented * 
NvRmGpuClockAsyncReqHandle
 
typedef enum NvRmGpuClockDomain NvRmGpuClockDomain
 Clock domains. More...
 
typedef enum NvRmGpuClockType NvRmGpuClockType
 
typedef struct
NvRmGpuClockGetEntryRec 
NvRmGpuClockGetEntry
 
typedef struct
NvRmGpuClockSetEntryRec 
NvRmGpuClockSetEntry
 
typedef struct NvRmGpuClockRangeRec NvRmGpuClockRange
 
typedef struct NvRmGpuClockPointRec NvRmGpuClockPoint
 
typedef struct
NvRmGpuClockDomainInfoRec 
NvRmGpuClockDomainInfo
 
typedef struct
NvRmGpuDeviceEventSessionRec 
NvRmGpuDeviceEventSession
 
typedef struct
NvRmGpuDeviceEventSessionOpenAttrRec 
NvRmGpuDeviceEventSessionOpenAttr
 Holds the events for which to listen. More...
 
typedef struct
NvRmGpuDeviceEventInfoRec 
NvRmGpuDeviceEventInfo
 

Enumerations

enum  NvRmGpuDeviceState {
  NvRmGpuLibDeviceState_Detached,
  NvRmGpuLibDeviceState_Attached
}
 
enum  NvRmGpuSyncType {
  NvRmGpuSyncType_Default,
  NvRmGpuSyncType_SyncFd,
  NvRmGpuSyncType_Syncpoint
}
 
enum  NvRmGpuClockDomain {
  NvRmGpuClockDomain_MCLK = 0,
  NvRmGpuClockDomain_GPCCLK,
  NvRmGpuClockDomain_Count
}
 Clock domains. More...
 
enum  NvRmGpuClockType {
  NvRmGpuClockType_Target = 1,
  NvRmGpuClockType_Actual,
  NvRmGpuClockType_Effective
}
 
enum  NvRmGpuDeviceVoltage {
  NvRmGpuDeviceVoltage_Core = 1,
  NvRmGpuDeviceVoltage_SRAM,
  NvRmGpuDeviceVoltage_Bus
}
 
enum  NvRmGpuDeviceCurrent { NvRmGpuDeviceCurrent_Bus = 1 }
 
enum  NvRmGpuDevicePower { NvRmGpuDevicePower_Bus = 1 }
 
enum  NvRmGpuDeviceTemperature { NvRmGpuDeviceTemperature_InternalSensor = 1 }
 
enum  NvRmGpuDeviceEventId {
  NvRmGpuDeviceEventId_VfUpdate = 0,
  NvRmGpuDeviceEventId_AlarmTargetVfNotPossible,
  NvRmGpuDeviceEventId_AlarmLocalTargetVfNotPossible,
  NvRmGpuDeviceEventId_AlarmClockArbiterFailed,
  NvRmGpuDeviceEventId_AlarmVfTableUpdateFailed,
  NvRmGpuDeviceEventId_AlarmThermalAboveThreshold,
  NvRmGpuDeviceEventId_AlarmPowerAboveThreshold,
  NvRmGpuDeviceEventId_AlarmGpuLost,
  NvRmGpuDeviceEventId_Count
}
 Holds information about the GPU device event. More...
 

Functions

NvRmGpuLibNvRmGpuLibOpen (const NvRmGpuLibOpenAttr *attr)
 Opens a new instance of the library. More...
 
void NvRmGpuLibClose (NvRmGpuLib *hlib)
 Closes the library and releases all resources. More...
 
const NvRmGpuLibDeviceListEntryNvRmGpuLibListDevices (NvRmGpuLib *hlib, size_t *pnumDevices)
 Returns a pointer to the device array. More...
 
NvError NvRmGpuLibAttachDevice (NvRmGpuLib *const hlib, const int deviceIndex)
 Power up and attach a GPU. More...
 
NvError NvRmGpuLibDetachDevice (NvRmGpuLib *const hlib, const int deviceIndex)
 Detach and power down a GPU. More...
 
NvError NvRmGpuDeviceOpen (NvRmGpuLib *hLib, int deviceIndex, const NvRmGpuDeviceOpenAttr *attr, NvRmGpuDevice **phDevice)
 Opens the GPU device. More...
 
void NvRmGpuDeviceClose (NvRmGpuDevice *hDevice)
 Closes the GPU device. More...
 
NvError NvRmGpuClockGetDomains (NvRmGpuDevice *hDevice, const NvRmGpuClockDomainInfo **infos, size_t *pNumDomains)
 Gets configurable clock domains. More...
 
NvError NvRmGpuClockGetPoints (NvRmGpuDevice *hDevice, NvRmGpuClockDomain domain, NvRmGpuClockPoint *pClkPoints, size_t *pNumPoints)
 Gets VF points for a given clock domain. More...
 
NvError NvRmGpuClockSet (NvRmGpuDevice *hDevice, const NvRmGpuClockSetEntry *pClkSetEntries, size_t numEntries, NvRmGpuClockAsyncReqHandle *phReq)
 Sets a clock request. More...
 
NvError NvRmGpuClockWaitAsyncReq (NvRmGpuDevice *hDevice, const NvRmGpuClockAsyncReqHandle *phReqs, size_t numEntries, uint32_t timeoutMs)
 Waits for completion of one or more asynchronous requests. More...
 
NvError NvRmGpuClockCloseAsyncReq (NvRmGpuDevice *hDevice, NvRmGpuClockAsyncReqHandle hReq)
 Closes an asynchronous request handle. More...
 
NvError NvRmGpuClockWaitAnyEvent (NvRmGpuDevice *hDevice, uint32_t timeoutMs)
 Waits on any clock update event. More...
 
NvError NvRmGpuClockGet (NvRmGpuDevice *hDevice, NvRmGpuClockGetEntry *pClkGetEntries, size_t numEntries)
 Gets clock state(s). More...
 
NvError NvRmGpuDeviceGetLoad (NvRmGpuDevice *hDevice, uint32_t *pLoadPerMille)
 Gets gpu load. More...
 
NvError NvRmGpuDeviceListVoltageSensors (NvRmGpuDevice *hDevice, const NvRmGpuDeviceVoltage **pSensors, size_t *numSensors)
 Gets a list of the available voltage sensors. More...
 
NvError NvRmGpuDeviceGetVoltage (NvRmGpuDevice *hDevice, NvRmGpuDeviceVoltage which, uint64_t *pVoltageMicroVolt)
 Gets the current voltage. More...
 
NvError NvRmGpuDeviceListCurrentSensors (NvRmGpuDevice *hDevice, const NvRmGpuDeviceCurrent **pSensors, size_t *numSensors)
 Gets a list of the available current sensors. More...
 
NvError NvRmGpuDeviceGetCurrent (NvRmGpuDevice *hDevice, NvRmGpuDeviceCurrent which, uint64_t *pCurrentMicroAmpere)
 Gets the current drawn by the GPU. More...
 
NvError NvRmGpuDeviceListPowerSensors (NvRmGpuDevice *hDevice, const NvRmGpuDevicePower **pSensors, size_t *numSensors)
 Gets a list of the available power sensors. More...
 
NvError NvRmGpuDeviceGetPower (NvRmGpuDevice *hDevice, NvRmGpuDevicePower which, uint64_t *pPowerMicroWatt)
 Gets the power consumed by the GPU. More...
 
NvError NvRmGpuDeviceListTemperatureSensors (NvRmGpuDevice *hDevice, const NvRmGpuDeviceTemperature **pSensors, size_t *numSensors)
 Gets the list of available temperature sensors. More...
 
NvError NvRmGpuDeviceGetTemperature (NvRmGpuDevice *hDevice, NvRmGpuDeviceTemperature which, int32_t *pTemperatureMilliCelsius)
 Gets the temperature. More...
 
NvError NvRmGpuDeviceThermalAlertSetLimit (NvRmGpuDevice *hDevice, int32_t temperature_mC)
 Sets the thermal alert limit. More...
 
static void NvRmGpuDeviceEventSessionOpenAttrSetAllEvents (NvRmGpuDeviceEventSessionOpenAttr *attr)
 
NvError NvRmGpuDeviceEventSessionOpen (NvRmGpuDevice *hDevice, const NvRmGpuDeviceEventSessionOpenAttr *attr, NvRmGpuDeviceEventSession **phSession)
 Opens the session to monitor device events. More...
 
NvError NvRmGpuDeviceEventSessionRead (NvRmGpuDeviceEventSession *hSession, NvRmGpuDeviceEventInfo *pEventInfo, uint32_t timeoutMs)
 Reads detailed event information from the event session. More...
 
void NvRmGpuDeviceEventSessionClose (NvRmGpuDeviceEventSession *hSession)
 Closes the event session. More...