Support extra metrics in the RDC

Remove the * in the rdci stats
When a group is created, the GPUs can be added in the same command.
Add the support to the memory temperature.
Add the support to the memory clock.
Add the support to report the ECC errors.
Add the support to report the PCIe bandwidth throughput.

Since the RX/TX throughput may take 1 second to retreive, an async fetch is implemented
in the RdcMetricFetcherImpl.

Change-Id: If04f602fe1f2d14dbf7c2fb189549fd030523f9a
此提交包含在:
Bill(Shuzhou) Liu
2020-04-29 10:32:50 -04:00
提交者 Chris Freehill
父節點 096dc2dadb
當前提交 f4a3fd4dda
共有 20 個檔案被更改,包括 601 行新增 和 62 行删除
+26 -3
查看文件
@@ -82,7 +82,10 @@ void RdciGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
group_name_ = optarg;
break;
case 'a':
group_ops_ = GROUP_ADD_GPUS;
// Create may add GPUs as well.
if (group_ops_ != GROUP_CREATE) {
group_ops_ = GROUP_ADD_GPUS;
}
gpu_ids_ = optarg;
break;
case 'i':
@@ -116,7 +119,8 @@ void RdciGroupSubSystem::show_help() const {
std::cout << " group -- Used to create and maintain groups of GPUs.\n\n";
std::cout << "Usage\n";
std::cout << " rdci group [--host <IP/FQDN>:port] [-u] -l\n";
std::cout << " rdci group [--host <IP/FQDN>:port] [-u] -c <groupName>\n";
std::cout << " rdci group [--host <IP/FQDN>:port] [-u] -c <groupName> "
<< "[-a <entityId>]\n";
std::cout << " rdci group [--host <IP/FQDN>:port] [-u] -g <groupId> "
<< "[-a <entityId>]\n";
std::cout << " rdci group [--host <IP/FQDN>:port] [-u] "
@@ -157,6 +161,25 @@ void RdciGroupSubSystem::process() {
rdc_gpu_group_t group_id;
result = rdc_group_gpu_create(rdc_handle_, RDC_GROUP_EMPTY,
group_name_.c_str(), &group_id);
if (result != RDC_ST_OK) {
throw RdcException(result, "Fail to create group "
+ group_name_);
}
gpu_ids = split_string(gpu_ids_, ',');
for (uint32_t i = 0; i < gpu_ids.size(); i++) {
if (!IsNumber(gpu_ids[i])) {
throw RdcException(RDC_ST_BAD_PARAMETER,
"The GPU Id "+gpu_ids[i]+" needs to be a number");
}
result = rdc_group_gpu_add(rdc_handle_,
group_id, std::stoi(gpu_ids[i]));
if (result != RDC_ST_OK) {
throw RdcException(result, "Fail to add GPU "
+ gpu_ids[i] + " to the group");
}
}
if (result == RDC_ST_OK) {
std::cout << "Successfully created group with a group ID "
<< group_id << std::endl;
@@ -214,7 +237,7 @@ void RdciGroupSubSystem::process() {
for (uint32_t i = 0; i < gpu_ids.size(); i++) {
if (!IsNumber(gpu_ids[i])) {
throw RdcException(RDC_ST_BAD_PARAMETER,
"The GUP Id "+gpu_ids[i]+" needs to be a number");
"The GPU Id "+gpu_ids[i]+" needs to be a number");
}
result = rdc_group_gpu_add(rdc_handle_,
group_id_, std::stoi(gpu_ids[i]));