2.4. Field APIs
These APIs are responsible for watching, unwatching, and updating specific fields as defined by DCGM_FI_*
Functions
- dcgmReturn_t dcgmGetLatestValues ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId, dcgmFieldValueEnumeration_f enumCB, void* userData )
- dcgmReturn_t dcgmGetLatestValuesForFields ( dcgmHandle_t pDcgmHandle, int gpuId, unsigned short fields[], unsigned int count, dcgmFieldValue_t values[] )
- dcgmReturn_t dcgmGetValuesSince ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId, long long sinceTimestamp, long long* nextSinceTimestamp, dcgmFieldValueEnumeration_f enumCB, void* userData )
- dcgmReturn_t dcgmUnwatchFields ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId )
- dcgmReturn_t dcgmWatchFields ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId, long long updateFreq, double maxKeepAge, int maxKeepSamples )
Functions
- dcgmReturn_t dcgmGetLatestValues ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId, dcgmFieldValueEnumeration_f enumCB, void* userData )
-
Parameters
- pDcgmHandle
- IN: DCGM Handle
- groupId
- IN: Group ID representing collection of one or more GPUs. Look at dcgmGroupCreate for details on creating the group. Alternatively, pass in the group id as DCGM_GROUP_ALL_GPUS to perform operation on all the GPUs.
- fieldGroupId
- IN: Fields to return data for.
- enumCB
- IN: Callback to invoke for every field value update. Note that multiple updates can be returned in each invocation
- userData
- IN: User data pointer to pass to the userData field of enumCB.
Description
Request latest field value for a field value collection
- dcgmReturn_t dcgmGetLatestValuesForFields ( dcgmHandle_t pDcgmHandle, int gpuId, unsigned short fields[], unsigned int count, dcgmFieldValue_t values[] )
-
Parameters
- pDcgmHandle
- IN: DCGM Handle
- gpuId
- IN: Gpu ID representing the GPU for which the fields are being requested.
- fields
- IN: Field IDs to return data for. See the definitions in dcgm_fields.h that start with DCGM_FI_.
- count
- IN: Number of field IDs in fields[] array.
- values
- OUT: Latest field values for the fields in fields[].
Description
Request latest field value for a group of fields
- dcgmReturn_t dcgmGetValuesSince ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId, long long sinceTimestamp, long long* nextSinceTimestamp, dcgmFieldValueEnumeration_f enumCB, void* userData )
-
Parameters
- pDcgmHandle
- IN: DCGM Handle
- groupId
- IN: Group ID representing collection of one or more GPUs. Look at dcgmGroupCreate for details on creating the group. Alternatively, pass in the group id as DCGM_GROUP_ALL_GPUS to perform operation on all the GPUs.
- fieldGroupId
- IN: Fields to return data for
- sinceTimestamp
- IN: Timestamp to request values since in usec since 1970. This will be returned in nextSinceTimestamp for subsequent calls 0 = request all data
- nextSinceTimestamp
- OUT: Timestamp to use for sinceTimestamp on next call to this function
- enumCB
- IN: Callback to invoke for every field value update. Note that multiple updates can be returned in each invocation
- userData
- IN: User data pointer to pass to the userData field of enumCB.
Description
Request updates for all field values that have updated since a given timestamp
- dcgmReturn_t dcgmUnwatchFields ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId )
-
Parameters
- pDcgmHandle
- IN: DCGM Handle
- groupId
- IN: Group ID representing collection of one or more GPUs. Look at dcgmGroupCreate for details on creating the group. Alternatively, pass in the group id as DCGM_GROUP_ALL_GPUS to perform operation on all the GPUs.
- fieldGroupId
- IN: Fields to unwatch.
Description
Request that DCGM stop recording updates for a given field collection.
- dcgmReturn_t dcgmWatchFields ( dcgmHandle_t pDcgmHandle, dcgmGpuGrp_t groupId, dcgmFieldGrp_t fieldGroupId, long long updateFreq, double maxKeepAge, int maxKeepSamples )
-
Parameters
- pDcgmHandle
- IN: DCGM Handle
- groupId
- IN: Group ID representing collection of one or more GPUs. Look at dcgmGroupCreate for details on creating the group. Alternatively, pass in the group id as DCGM_GROUP_ALL_GPUS to perform operation on all the GPUs.
- fieldGroupId
- IN: Fields to watch.
- updateFreq
- IN: How often to update this field in usec
- maxKeepAge
- IN: How long to keep data for this field in seconds
- maxKeepSamples
- IN: Maximum number of samples to keep. 0=no limit
Description
Request that DCGM start recording updates for a given field collection.
Note that the first update of the field will not occur until the next field update cycle. To force a field update cycle, call dcgmUpdateAllFields(1).