Support rocm-smi related device information

A few fields are added to board_info and asic_info for rocm-smi
device information.

Implement rocm-smi related fw block in amdsmi_get_fw_info().

Change-Id: I825d3e5c7feaa07a6e05386d4f1a59ebf528dfc0
This commit is contained in:
Bill(Shuzhou) Liu
2022-09-09 15:18:08 -04:00
parent f1d02aca79
commit 1ec3a2182e
8 changed files with 390 additions and 216 deletions
@@ -112,7 +112,7 @@ void TestFrequenciesReadWrite::Run(void) {
// Skip CLOCK_TYPE_PCIE, which does not supported in rocm-smi.
std::cout << amdsmi_clk << std::endl;
if (amdsmi_clk == CLOCK_TYPE_PCIE)
return true;
return false;
ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[dv_ind], amdsmi_clk, &f);
std::cout << ret << std::endl;
@@ -158,6 +158,11 @@ void TestFrequenciesReadWrite::Run(void) {
": Not supported on this machine. Skipping..." << std::endl;
ret = AMDSMI_STATUS_SUCCESS;
return;
} else if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Set " << FreqEnumToStr(amdsmi_clk) <<
": Not supported on this machine. Skipping..." << std::endl;
ret = AMDSMI_STATUS_SUCCESS;
return;
}
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[dv_ind], amdsmi_clk, &f);
+4 -13
View File
@@ -207,21 +207,12 @@ void TestIdInfoRead::Run(void) {
err = amdsmi_dev_subsystem_name_get(device_handles_[i], nullptr, kBufferLen);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
err = amdsmi_dev_subsystem_vendor_id_get(device_handles_[i], &id);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
// Verify api support checking functionality is working
err = amdsmi_dev_subsystem_vendor_id_get(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
IF_VERB(STANDARD) {
std::cout << "\t**Sub-system Vendor ID: 0x" << std::hex <<
id << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_subsystem_vendor_id_get(device_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
asci_info.subvendor_id << std::endl;
}
err = amdsmi_dev_vendor_name_get(device_handles_[i], buffer, kBufferLen);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout <<
@@ -215,8 +215,6 @@ void TestMutualExclusion::Run(void) {
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_subsystem_id_get(device_handles_[0], &dmy_ui16);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_subsystem_vendor_id_get(device_handles_[0], &dmy_ui16);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_pci_id_get(device_handles_[0], &dmy_ui64);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_pci_throughput_get(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64);
+10 -12
View File
@@ -163,25 +163,23 @@ void TestBase::PrintDeviceHeader(amdsmi_device_handle dv_ind) {
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Device name: " << board_info.product_name << std::endl;
err = amdsmi_get_asic_info(dv_ind, &info);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Device Vendor ID: 0x" << std::hex <<
info.vendor_id << std::endl;
}
}
err = amdsmi_get_asic_info(dv_ind, &info);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Device Vendor ID: 0x" << std::hex << info.vendor_id <<
std::endl;
}
err = amdsmi_dev_subsystem_id_get(dv_ind, &val_ui16);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Subsystem ID: 0x" << std::hex << val_ui16 << std::endl;
std::cout << "\t**Subsystem Vendor ID: 0x" << std::hex
<< info.subvendor_id << std::endl;
}
err = amdsmi_dev_subsystem_vendor_id_get(dv_ind, &val_ui16);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Subsystem Vendor ID: 0x" << std::hex << val_ui16 <<
std::endl;
}
std::cout << std::setbase(10);
}
void TestBase::Run(void) {