|
PAPI
5.7.0.0
|
This is an NVML component, it demos the component interface and implements a number of counters from the Nvidia Management Library. Please refer to NVML documentation for details about nvmlDeviceGetPowerUsage, nvmlDeviceGetTemperature. Power is reported in mW and temperature in Celcius. The counter descriptions should contain the units that the measurement returns. More...

Go to the source code of this file.
Data Structures | |
| struct | nvml_context_t |
Macros | |
| #define | CUDAAPI __attribute__((weak)) |
| #define | CUDARTAPI __attribute__((weak)) |
| #define | DECLDIR __attribute__((weak)) |
| #define | NVML_MAX_COUNTERS 100 |
Functions | |
| unsigned long long | getClockSpeed (nvmlDevice_t dev, nvmlClockType_t which_one) |
| unsigned long long | getEccLocalErrors (nvmlDevice_t dev, nvmlEccBitType_t bits, int which_one) |
| unsigned long long | getFanSpeed (nvmlDevice_t dev) |
| unsigned long long | getMaxClockSpeed (nvmlDevice_t dev, nvmlClockType_t which_one) |
| unsigned long long | getMemoryInfo (nvmlDevice_t dev, int which_one) |
| unsigned long long | getPState (nvmlDevice_t dev) |
| unsigned long long | getPowerUsage (nvmlDevice_t dev) |
| unsigned long long | getTemperature (nvmlDevice_t dev) |
| unsigned long long | getTotalEccErrors (nvmlDevice_t dev, nvmlEccBitType_t bits) |
| unsigned long long | getUtilization (nvmlDevice_t dev, int which_one) |
| unsigned long long | getPowerManagementLimit (nvmlDevice_t dev) |
| static void | nvml_hardware_reset () |
| static int | nvml_hardware_read (long long *value, int which_one) |
| static int | nvml_hardware_write (long long *value, int which_one) |
| int | _papi_nvml_init_thread (hwd_context_t *ctx) |
| static int | detectDevices () |
| static void | createNativeEvents () |
| int | _papi_nvml_shutdown_component () |
| int | _papi_nvml_init_component (int cidx) |
| static int | linkCudaLibraries () |
| int | _papi_nvml_init_control_state (hwd_control_state_t *ctl) |
| int | _papi_nvml_update_control_state (hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx) |
| int | _papi_nvml_start (hwd_context_t *ctx, hwd_control_state_t *ctl) |
| int | _papi_nvml_stop (hwd_context_t *ctx, hwd_control_state_t *ctl) |
| int | _papi_nvml_read (hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags) |
| int | _papi_nvml_write (hwd_context_t *ctx, hwd_control_state_t *ctl, long long *events) |
| int | _papi_nvml_reset (hwd_context_t *ctx, hwd_control_state_t *ctl) |
| int | _papi_nvml_shutdown_thread (hwd_context_t *ctx) |
| int | _papi_nvml_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option) |
| int | _papi_nvml_set_domain (hwd_control_state_t *cntrl, int domain) |
| int | _papi_nvml_ntv_enum_events (unsigned int *EventCode, int modifier) |
| int | _papi_nvml_ntv_code_to_name (unsigned int EventCode, char *name, int len) |
| int | _papi_nvml_ntv_code_to_descr (unsigned int EventCode, char *descr, int len) |
| int | _papi_nvml_ntv_code_to_info (unsigned int EventCode, PAPI_event_info_t *info) |
Variables | |
| void(* | _dl_non_dynamic_init )(void) |
| nvml_control_state_t | |
| static nvml_native_event_entry_t * | nvml_native_table = NULL |
| static int | device_count = 0 |
| static int | num_events = 0 |
| static nvmlDevice_t * | devices = NULL |
| static int * | features = NULL |
| static unsigned int * | power_management_initial_limit = NULL |
| static unsigned int * | power_management_limit_constraint_min = NULL |
| static unsigned int * | power_management_limit_constraint_max = NULL |
| papi_vector_t | _nvml_vector |
Definition in file linux-nvml.c.
| #define CUDAAPI __attribute__((weak)) |
| #define CUDARTAPI __attribute__((weak)) |
| #define DECLDIR __attribute__((weak)) |
| #define NVML_MAX_COUNTERS 100 |
| int _papi_nvml_ctl | ( | hwd_context_t * | ctx, |
| int | code, | ||
| _papi_int_option_t * | option | ||
| ) |
This function sets various options in the component
| code | valid are PAPI_SET_DEFDOM, PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL and PAPI_SET_INHERIT |
Definition at line 1471 of file linux-nvml.c.
| int _papi_nvml_init_component | ( | int | cidx | ) |
Initialize hardware counters, setup the function vector table and get hardware information, this routine is called when the PAPI process is initialized (IE PAPI_library_init)
Definition at line 1050 of file linux-nvml.c.

| int _papi_nvml_init_control_state | ( | hwd_control_state_t * | ctl | ) |
Setup a counter control state. In general a control state holds the hardware info for an EventSet.
Definition at line 1311 of file linux-nvml.c.
| int _papi_nvml_init_thread | ( | hwd_context_t * | ctx | ) |
| int _papi_nvml_ntv_code_to_descr | ( | unsigned int | EventCode, |
| char * | descr, | ||
| int | len | ||
| ) |
Takes a native event code and passes back the event description
| EventCode | is the native event code |
| descr | is a pointer for the description to be copied to |
| len | is the size of the descr string |
Definition at line 1598 of file linux-nvml.c.
| int _papi_nvml_ntv_code_to_info | ( | unsigned int | EventCode, |
| PAPI_event_info_t * | info | ||
| ) |
Takes a native event code and passes back the event info
| EventCode | is the native event code |
| info | is a pointer for the info to be copied to |
Definition at line 1615 of file linux-nvml.c.
| int _papi_nvml_ntv_code_to_name | ( | unsigned int | EventCode, |
| char * | name, | ||
| int | len | ||
| ) |
Takes a native event code and passes back the name
| EventCode | is the native event code |
| name | is a pointer for the name to be copied to |
| len | is the size of the name string |
Definition at line 1577 of file linux-nvml.c.
| int _papi_nvml_ntv_enum_events | ( | unsigned int * | EventCode, |
| int | modifier | ||
| ) |
Enumerate Native Events
| EventCode | is the event of interest |
| modifier | is one of PAPI_ENUM_FIRST, PAPI_ENUM_EVENTS If your component has attribute masks then these need to be handled here as well. |
Definition at line 1536 of file linux-nvml.c.
| int _papi_nvml_read | ( | hwd_context_t * | ctx, |
| hwd_control_state_t * | ctl, | ||
| long long ** | events, | ||
| int | flags | ||
| ) |
Triggered by PAPI_read()
Definition at line 1389 of file linux-nvml.c.

| int _papi_nvml_reset | ( | hwd_context_t * | ctx, |
| hwd_control_state_t * | ctl | ||
| ) |
Triggered by PAPI_reset() but only if the EventSet is currently running
Definition at line 1441 of file linux-nvml.c.

| int _papi_nvml_set_domain | ( | hwd_control_state_t * | cntrl, |
| int | domain | ||
| ) |
This function has to set the bits needed to count different domains In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER By default return PAPI_EINVAL if none of those are specified and PAPI_OK with success PAPI_DOM_USER is only user context is counted PAPI_DOM_KERNEL is only the Kernel/OS context is counted PAPI_DOM_OTHER is Exception/transient mode (like user TLB misses) PAPI_DOM_ALL is all of the domains
Definition at line 1495 of file linux-nvml.c.
| int _papi_nvml_shutdown_component | ( | ) |
Definition at line 1020 of file linux-nvml.c.


| int _papi_nvml_shutdown_thread | ( | hwd_context_t * | ctx | ) |
| int _papi_nvml_start | ( | hwd_context_t * | ctx, |
| hwd_control_state_t * | ctl | ||
| ) |
| int _papi_nvml_stop | ( | hwd_context_t * | ctx, |
| hwd_control_state_t * | ctl | ||
| ) |
Triggered by PAPI_stop()
Definition at line 1365 of file linux-nvml.c.

| int _papi_nvml_update_control_state | ( | hwd_control_state_t * | ctl, |
| NativeInfo_t * | native, | ||
| int | count, | ||
| hwd_context_t * | ctx | ||
| ) |
| int _papi_nvml_write | ( | hwd_context_t * | ctx, |
| hwd_control_state_t * | ctl, | ||
| long long * | events | ||
| ) |
Triggered by PAPI_write(), but only if the counters are running
Definition at line 1415 of file linux-nvml.c.

|
static |
Definition at line 751 of file linux-nvml.c.

|
static |
Definition at line 592 of file linux-nvml.c.


| unsigned long long getClockSpeed | ( | nvmlDevice_t | dev, |
| nvmlClockType_t | which_one | ||
| ) |
| unsigned long long getEccLocalErrors | ( | nvmlDevice_t | dev, |
| nvmlEccBitType_t | bits, | ||
| int | which_one | ||
| ) |
| unsigned long long getFanSpeed | ( | nvmlDevice_t | dev | ) |
| unsigned long long getMaxClockSpeed | ( | nvmlDevice_t | dev, |
| nvmlClockType_t | which_one | ||
| ) |
| unsigned long long getMemoryInfo | ( | nvmlDevice_t | dev, |
| int | which_one | ||
| ) |
| unsigned long long getPowerManagementLimit | ( | nvmlDevice_t | dev | ) |
| unsigned long long getPowerUsage | ( | nvmlDevice_t | dev | ) |
| unsigned long long getPState | ( | nvmlDevice_t | dev | ) |
| unsigned long long getTemperature | ( | nvmlDevice_t | dev | ) |
| unsigned long long getTotalEccErrors | ( | nvmlDevice_t | dev, |
| nvmlEccBitType_t | bits | ||
| ) |
| unsigned long long getUtilization | ( | nvmlDevice_t | dev, |
| int | which_one | ||
| ) |
|
static |
Definition at line 1151 of file linux-nvml.c.

|
static |
Code that reads event values.
Definition at line 449 of file linux-nvml.c.


|
static |
Definition at line 416 of file linux-nvml.c.

|
static |
Code that reads event values.
Definition at line 531 of file linux-nvml.c.

| void(* _dl_non_dynamic_init) (void) |
Holds control flags. Usually there's one of these per event-set. Usually this is out-of band configuration of the hardware
< Copy of counts, holds results when stopped
Definition at line 48 of file linux-nvml.c.
| papi_vector_t _nvml_vector |
Vector that points to entry points for our component
Definition at line 1637 of file linux-nvml.c.
|
static |
Number of devices detected at component_init time
Definition at line 158 of file linux-nvml.c.
|
static |
Definition at line 163 of file linux-nvml.c.
|
static |
Definition at line 164 of file linux-nvml.c.
|
static |
number of events in the table
Definition at line 161 of file linux-nvml.c.
| nvml_control_state_t |
Definition at line 147 of file linux-nvml.c.
|
static |
This table contains the native events
Definition at line 155 of file linux-nvml.c.
|
static |
Definition at line 165 of file linux-nvml.c.
|
static |
Definition at line 167 of file linux-nvml.c.
|
static |
Definition at line 166 of file linux-nvml.c.