Esempio n. 1
0
 def Set(self, policy, statusHandle=None):
     if statusHandle:
         statusHandle = statusHandle.handle
     dcgm_agent.dcgmPolicySet(self._dcgmHandle.handle, self._groupId, policy, statusHandle)
Esempio n. 2
0
config_values.mPerfState.minVPState.memClk = dcgmvalue.DCGM_INT32_BLANK
config_values.mPerfState.minVPState.procClk = dcgmvalue.DCGM_INT32_BLANK
config_values.mPerfState.maxVPState.memClk = dcgmvalue.DCGM_INT32_BLANK
config_values.mPerfState.maxVPState.procClk = dcgmvalue.DCGM_INT32_BLANK
config_values.mComputeMode = dcgmvalue.DCGM_INT32_BLANK
config_values.mPowerLimit.type = dcgm_structs.DCGM_CONFIG_POWER_CAP_INDIVIDUAL
config_values.mPowerLimit.val = powerLimit_set

## Set Config and verify the value
ret = dcgm_agent.dcgmConfigSet(handle, groupId, config_values, statusHandle)
assert (ret == dcgm_structs.DCGM_ST_OK
        ), "Failed to set configuration for the group: %s" % ret
dcgm_agent.dcgmStatusClear(statusHandle)
helper_verify_power_value_standalone(handle, groupId, powerLimit_set)

ret = dcgm_agent.dcgmPolicySet(handle, groupId, newPolicy, statusHandle)
assert (ret == dcgm_structs.DCGM_ST_OK)

time.sleep(5)  # give the policy manager a chance to start

requestId = dcgm_agent.dcgmPolicyRegister(
    handle, groupId, dcgm_structs.DCGM_POLICY_COND_MAX_PAGES_RETIRED,
    c_callback, c_callback)
assert (requestId != None)

# inject an error into page retirement
field = dcgm_structs_internal.c_dcgmInjectFieldValue_v1()
field.version = dcgm_structs_internal.dcgmInjectFieldValue_version1
field.fieldId = dcgm_fields.DCGM_FI_DEV_RETIRED_DBE
field.status = 0
field.fieldType = ord(dcgm_fields.DCGM_FT_INT64)