def GetEntityGroupEntities(self, entityGroupId, onlySupported): flags = 0 if onlySupported: flags |= dcgm_structs.DCGM_GEGE_FLAG_ONLY_SUPPORTED entityIds = dcgm_agent.dcgmGetEntityGroupEntities( self._dcgmHandle.handle, entityGroupId, flags) return entityIds
def initialize_devices(handle, flags): gpuIds = dcgm_agent.dcgmGetEntityGroupEntities(handle, dcgm_fields.DCGM_FE_GPU, flags) switchIds = dcgm_agent.dcgmGetEntityGroupEntities( handle, dcgm_fields.DCGM_FE_SWITCH, flags) i = 0 for gpuId in gpuIds: attributes = dcgm_agent.dcgmGetDeviceAttributes(handle, gpuId) gpuObj = Entity(gpuId, entityType=dcgm_fields.DCGM_FE_GPU, uuid=attributes.identifiers.uuid, bdf=attributes.identifiers.pciBusId) g_gpus.append(gpuObj) i = i + 1 i = 0 for switchId in switchIds: switchObj = Entity(switchId, entityType=dcgm_fields.DCGM_FE_SWITCH) g_switches.append(switchObj) i = i + 1