Metadata

group DCGMAPI_METADATA

This chapter describes the methods that query for DCGM metadata.

Functions

dcgmReturn_t dcgmIntrospectToggleState(dcgmHandle_t pDcgmHandle, dcgmIntrospectState_t enabledState)

Toggle the state of introspection metadata gathering in DCGM.

Metadata gathering will increase the memory usage of DCGM so that it can store the metadata it gathers.

Parameters
  • pDcgmHandle – IN: DCGM Handle

  • enabledState – IN: The state to set gathering of introspection data to

Returns

dcgmReturn_t dcgmIntrospectGetFieldsMemoryUsage(dcgmHandle_t pDcgmHandle, dcgmIntrospectContext_t *context, dcgmIntrospectFullMemory_t *memoryInfo, int waitIfNoData)

Get the current amount of memory used to store the given field collection.

Parameters
  • pDcgmHandle – IN: DCGM Handle

  • context – IN: see dcgmIntrospectContext_t. This identifies the level of fields to do introspection for (ex: all fields, field groups) context->version must be set to dcgmIntrospectContext_version prior to this call.

  • memoryInfo – IN/OUT: see dcgmIntrospectFullMemory_t. memoryInfo->version must be set to dcgmIntrospectFullMemory_version prior to this call.

  • waitIfNoData – IN: if no metadata has been gathered, should this call block until data has been gathered (1), or should this call just return DCGM_ST_NO_DATA (0).

Returns

dcgmReturn_t dcgmIntrospectGetHostengineMemoryUsage(dcgmHandle_t pDcgmHandle, dcgmIntrospectMemory_t *memoryInfo, int waitIfNoData)

Retrieve the total amount of memory that the hostengine process is currently using.

This measurement represents both the resident set size (what is currently in RAM) and the swapped memory that belongs to the process.

Parameters
  • pDcgmHandle – IN: DCGM Handle

  • memoryInfo – IN/OUT: see dcgmIntrospectMemory_t. memoryInfo->version must be set to dcgmIntrospectMemory_version prior to this call.

  • waitIfNoData – IN: if no metadata is gathered wait till this occurs (!0) or return DCGM_ST_NO_DATA (0)

Returns

dcgmReturn_t dcgmIntrospectGetFieldsExecTime(dcgmHandle_t pDcgmHandle, dcgmIntrospectContext_t *context, dcgmIntrospectFullFieldsExecTime_t *execTime, int waitIfNoData)

Get introspection info relating to execution time needed to update the fields identified by context.

Parameters
  • pDcgmHandle – IN: DCGM Handle

  • context – IN: see dcgmIntrospectContext_t. This identifies the level of fields to do introspection for (ex: all fields, field group ) context->version must be set to dcgmIntrospectContext_version prior to this call.

  • execTime – IN/OUT: see dcgmIntrospectFullFieldsExecTime_t. execTime->version must be set to dcgmIntrospectFullFieldsExecTime_version prior to this call.

  • waitIfNoData – IN: if no metadata is gathered, wait until data has been gathered (1) or return DCGM_ST_NO_DATA (0)

Returns

dcgmReturn_t dcgmIntrospectGetHostengineCpuUtilization(dcgmHandle_t pDcgmHandle, dcgmIntrospectCpuUtil_t *cpuUtil, int waitIfNoData)

Retrieve the CPU utilization of the DCGM hostengine process.

Parameters
  • pDcgmHandle – IN: DCGM Handle

  • cpuUtil – IN/OUT: see dcgmIntrospectCpuUtil_t. cpuUtil->version must be set to dcgmIntrospectCpuUtil_version prior to this call.

  • waitIfNoData – IN: if no metadata is gathered wait till this occurs (!0) or return DCGM_ST_NO_DATA (0)

Returns

dcgmReturn_t dcgmIntrospectUpdateAll(dcgmHandle_t pDcgmHandle, int waitForUpdate)

This method is used to manually tell the the introspection module to update all DCGM introspection data.

This is normally performed automatically on an interval of 1 second.

Parameters
  • pDcgmHandle – IN: DCGM Handle

  • waitForUpdate – IN: Whether or not to wait for the update loop to complete before returning to the caller

Returns