Change device_handle to processor_handle
grep -rli 'device_handle' * | xargs -i@ sed -i 's/device_handle/processor_handle/g' @ Change-Id: Ifc8b7fa3b5488ce1fa8d8cf9eb3981a09450de11
This commit is contained in:
1 szülő
3963036a05
commit
3f9e4d95d4
44 files changed
+1381
-1377
No files matched your search
@@ -102,11 +102,11 @@ void TestAPISupportRead::Run(void) {
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
IF_VERB(STANDARD) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
std::cout << "Supported AMDSMI Functions:" << std::endl;
|
||||
std::cout << "\tVariants (Monitors)" << std::endl;
|
||||
}
|
||||
err = amdsmi_dev_open_supported_func_iterator(device_handles_[i], &iter_handle);
|
||||
err = amdsmi_dev_open_supported_func_iterator(processor_handles_[i], &iter_handle);
|
||||
CHK_ERR_ASRT(err)
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -98,9 +98,9 @@ void TestErrCntRead::Run(void) {
|
||||
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
err = amdsmi_dev_get_ecc_enabled(device_handles_[i], &enabled_mask);
|
||||
err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], &enabled_mask);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout <<
|
||||
@@ -108,7 +108,7 @@ void TestErrCntRead::Run(void) {
|
||||
<< std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
continue;
|
||||
@@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) {
|
||||
CHK_ERR_ASRT(err)
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -126,7 +126,7 @@ void TestErrCntRead::Run(void) {
|
||||
}
|
||||
for (uint32_t b = AMDSMI_GPU_BLOCK_FIRST;
|
||||
b <= AMDSMI_GPU_BLOCK_LAST; b = b*2) {
|
||||
err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
&err_state);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -135,11 +135,11 @@ void TestErrCntRead::Run(void) {
|
||||
" block: " << GetErrStateNameStr(err_state) << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b), &ec);
|
||||
err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast<amdsmi_gpu_block_t>(b), &ec);
|
||||
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -148,7 +148,7 @@ void TestErrCntRead::Run(void) {
|
||||
": Not supported for this device" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
@@ -164,7 +164,7 @@ void TestErrCntRead::Run(void) {
|
||||
<< std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast<amdsmi_gpu_block_t>(b),
|
||||
nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void TestEvtNotifReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
ret = amdsmi_init_event_notification(device_handles_[dv_ind]);
|
||||
ret = amdsmi_init_event_notification(processor_handles_[dv_ind]);
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout <<
|
||||
@@ -119,7 +119,7 @@ void TestEvtNotifReadWrite::Run(void) {
|
||||
return;
|
||||
}
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS);
|
||||
ret = amdsmi_set_event_notification_mask(device_handles_[dv_ind], mask);
|
||||
ret = amdsmi_set_event_notification_mask(processor_handles_[dv_ind], mask);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void TestEvtNotifReadWrite::Run(void) {
|
||||
"Expected the number of elements found to be <= buffer size (10)";
|
||||
IF_VERB(STANDARD) {
|
||||
for (uint32_t i = 0; i < num_elem; ++i) {
|
||||
std::cout << "\tdv_handle=" << data[i].device_handle <<
|
||||
std::cout << "\tdv_handle=" << data[i].processor_handle <<
|
||||
" Type: " << NameFromEvtNotifType(data[i].event) <<
|
||||
" Mesg: " << data[i].message << std::endl;
|
||||
if (data[i].event == AMDSMI_EVT_NOTIF_GPU_PRE_RESET) {
|
||||
@@ -167,7 +167,7 @@ void TestEvtNotifReadWrite::Run(void) {
|
||||
"Expected the number of elements found to be <= buffer size (10)";
|
||||
IF_VERB(STANDARD) {
|
||||
for (uint32_t i = 0; i < num_elem; ++i) {
|
||||
std::cout << "\tdv_handle=" << data[i].device_handle <<
|
||||
std::cout << "\tdv_handle=" << data[i].processor_handle <<
|
||||
" Type: " << NameFromEvtNotifType(data[i].event) <<
|
||||
" Mesg: " << data[i].message << std::endl;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void TestEvtNotifReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
ret = amdsmi_stop_event_notification(device_handles_[dv_ind]);
|
||||
ret = amdsmi_stop_event_notification(processor_handles_[dv_ind]);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS);
|
||||
}
|
||||
}
|
||||
@@ -96,12 +96,12 @@ void TestFanRead::Run(void) {
|
||||
}
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**Current Fan Speed: ";
|
||||
}
|
||||
err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, &val_i64);
|
||||
err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, &val_i64);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**" << ": " <<
|
||||
@@ -114,30 +114,30 @@ void TestFanRead::Run(void) {
|
||||
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, nullptr);
|
||||
err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, &val_ui64);
|
||||
err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, &val_ui64);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << val_i64/static_cast<float>(val_ui64)*100;
|
||||
std::cout << "% ("<< val_i64 << "/" << val_ui64 << ")" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, nullptr);
|
||||
err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**Current fan RPMs: ";
|
||||
}
|
||||
err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, &val_i64);
|
||||
err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, &val_i64);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << val_i64 << std::endl;
|
||||
}
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, nullptr);
|
||||
err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,9 +98,9 @@ void TestFanReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &orig_speed);
|
||||
ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &orig_speed);
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**" << ": " <<
|
||||
@@ -120,7 +120,7 @@ void TestFanReadWrite::Run(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_get_fan_speed_max(device_handles_[dv_ind], 0, &max_speed);
|
||||
ret = amdsmi_dev_get_fan_speed_max(processor_handles_[dv_ind], 0, &max_speed);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
new_speed = 1.1 * orig_speed;
|
||||
@@ -136,12 +136,12 @@ void TestFanReadWrite::Run(void) {
|
||||
std::cout << "Setting fan speed to " << new_speed << std::endl;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_set_fan_speed(device_handles_[dv_ind], 0, new_speed);
|
||||
ret = amdsmi_dev_set_fan_speed(processor_handles_[dv_ind], 0, new_speed);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
sleep(4);
|
||||
|
||||
ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed);
|
||||
ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -163,12 +163,12 @@ void TestFanReadWrite::Run(void) {
|
||||
std::cout << "Resetting fan control to auto..." << std::endl;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_reset_fan(device_handles_[dv_ind], 0);
|
||||
ret = amdsmi_dev_reset_fan(processor_handles_[dv_ind], 0);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
sleep(3);
|
||||
|
||||
ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed);
|
||||
ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
|
||||
@@ -116,12 +116,12 @@ void TestFrequenciesRead::Run(void) {
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
auto freq_output = [&](amdsmi_clk_type_t t, const char *name) {
|
||||
err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, &f);
|
||||
err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, &f);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**Get " << name <<
|
||||
": Not supported on this machine" << std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr);
|
||||
err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
} else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
|
||||
std::cout << "\t**Get " << name <<
|
||||
@@ -133,13 +133,13 @@ void TestFrequenciesRead::Run(void) {
|
||||
std::cout << f.num_supported << std::endl;
|
||||
print_frequencies(&f);
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr);
|
||||
err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
freq_output(CLK_TYPE_MEM, "Supported GPU Memory");
|
||||
freq_output(CLK_TYPE_SYS, "Supported GPU");
|
||||
@@ -147,12 +147,12 @@ void TestFrequenciesRead::Run(void) {
|
||||
freq_output(CLK_TYPE_DCEF, "Display Controller Engine Clock");
|
||||
freq_output(CLK_TYPE_SOC, "SOC Clock");
|
||||
|
||||
err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], &b);
|
||||
err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], &b);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**Get PCIE Bandwidth: Not supported on this machine"
|
||||
<< std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
|
||||
std::cout << "\t**Get PCIE Bandwidth "
|
||||
@@ -164,7 +164,7 @@ void TestFrequenciesRead::Run(void) {
|
||||
std::cout << b.transfer_rate.num_supported << std::endl;
|
||||
print_frequencies(&b.transfer_rate, b.lanes);
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_pci_bandwidth(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void TestFrequenciesReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
for (uint32_t clk = (uint32_t)CLK_TYPE_FIRST;
|
||||
clk <= CLK_TYPE__MAX; ++clk) {
|
||||
@@ -113,7 +113,7 @@ void TestFrequenciesReadWrite::Run(void) {
|
||||
std::cout << amdsmi_clk << std::endl;
|
||||
if (amdsmi_clk == CLK_TYPE_PCIE)
|
||||
return false;
|
||||
ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f);
|
||||
ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f);
|
||||
std::cout << ret << std::endl;
|
||||
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED ||
|
||||
@@ -151,7 +151,7 @@ void TestFrequenciesReadWrite::Run(void) {
|
||||
FreqEnumToStr(amdsmi_clk) << " to 0b" << freq_bm_str << " ..." <<
|
||||
std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, freq_bitmask);
|
||||
ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, freq_bitmask);
|
||||
//Certain ASICs does not allow to set particular clocks. If set function for a clock returns
|
||||
//permission error despite root access, manually set ret value to success and return
|
||||
if (ret == AMDSMI_STATUS_NO_PERM && geteuid() == 0) {
|
||||
@@ -166,7 +166,7 @@ void TestFrequenciesReadWrite::Run(void) {
|
||||
return;
|
||||
}
|
||||
CHK_ERR_ASRT(ret)
|
||||
ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f);
|
||||
ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f);
|
||||
if (ret != AMDSMI_STATUS_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
@@ -175,12 +175,12 @@ void TestFrequenciesReadWrite::Run(void) {
|
||||
std::cout << "Frequency is now index " << f.current << std::endl;
|
||||
std::cout << "Resetting mask to all frequencies." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF);
|
||||
ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF);
|
||||
if (ret != AMDSMI_STATUS_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
if (ret != AMDSMI_STATUS_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -97,9 +97,9 @@ void TestGPUBusyRead::Run(void) {
|
||||
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
err = amdsmi_dev_get_busy_percent(device_handles_[i], &val_ui32);
|
||||
err = amdsmi_dev_get_busy_percent(processor_handles_[i], &val_ui32);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_FILE_ERROR) {
|
||||
IF_VERB(STANDARD) {
|
||||
|
||||
@@ -97,13 +97,13 @@ void TestGpuMetricsRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**GPU METRICS:\n";
|
||||
}
|
||||
amdsmi_gpu_metrics_t smu;
|
||||
err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], &smu);
|
||||
err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], &smu);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -188,7 +188,7 @@ void TestGpuMetricsRead::Run(void) {
|
||||
}
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ void TestHWTopologyRead::Run(void) {
|
||||
std::vector<uint32_t> numa_numbers(num_devices);
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_devices; ++dv_ind) {
|
||||
amdsmi_processor_handle dev_handle = device_handles_[dv_ind];
|
||||
amdsmi_processor_handle dev_handle = processor_handles_[dv_ind];
|
||||
err = amdsmi_topo_get_numa_node_number(dev_handle, &numa_numbers[dv_ind]);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -138,8 +138,8 @@ void TestHWTopologyRead::Run(void) {
|
||||
gpu_links[dv_ind_src][dv_ind_dst].accessible = true;
|
||||
} else {
|
||||
AMDSMI_IO_LINK_TYPE type;
|
||||
err = amdsmi_topo_get_link_type(device_handles_[dv_ind_src],
|
||||
device_handles_[dv_ind_dst],
|
||||
err = amdsmi_topo_get_link_type(processor_handles_[dv_ind_src],
|
||||
processor_handles_[dv_ind_dst],
|
||||
&gpu_links[dv_ind_src][dv_ind_dst].hops, &type);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -170,8 +170,8 @@ void TestHWTopologyRead::Run(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
err = amdsmi_topo_get_link_weight(device_handles_[dv_ind_src],
|
||||
device_handles_[dv_ind_dst],
|
||||
err = amdsmi_topo_get_link_weight(processor_handles_[dv_ind_src],
|
||||
processor_handles_[dv_ind_dst],
|
||||
&gpu_links[dv_ind_src][dv_ind_dst].weight);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -185,8 +185,8 @@ void TestHWTopologyRead::Run(void) {
|
||||
CHK_ERR_ASRT(err)
|
||||
}
|
||||
}
|
||||
err = amdsmi_is_P2P_accessible(device_handles_[dv_ind_src],
|
||||
device_handles_[dv_ind_dst],
|
||||
err = amdsmi_is_P2P_accessible(processor_handles_[dv_ind_src],
|
||||
processor_handles_[dv_ind_dst],
|
||||
&gpu_links[dv_ind_src][dv_ind_dst].accessible);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
|
||||
@@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) {
|
||||
}
|
||||
|
||||
// Get the device ID, name, vendor ID and vendor name for the device
|
||||
err = amdsmi_dev_get_id(device_handles_[i], &id);
|
||||
err = amdsmi_dev_get_id(processor_handles_[i], &id);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
amdsmi_status_t ret;
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_dev_get_id(device_handles_[i], nullptr);
|
||||
ret = amdsmi_dev_get_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -118,25 +118,25 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_id(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
// vendor_id, unique_id
|
||||
amdsmi_asic_info_t asci_info;
|
||||
err = amdsmi_get_asic_info(device_handles_[0], &asci_info);
|
||||
err = amdsmi_get_asic_info(processor_handles_[0], &asci_info);
|
||||
CHK_ERR_ASRT(err)
|
||||
|
||||
// device name, brand, serial_number
|
||||
amdsmi_board_info_t board_info;
|
||||
err = amdsmi_get_board_info(device_handles_[0], &board_info);
|
||||
err = amdsmi_get_board_info(processor_handles_[0], &board_info);
|
||||
CHK_ERR_ASRT(err)
|
||||
|
||||
err = amdsmi_dev_get_vram_vendor(device_handles_[i], buffer, kBufferLen);
|
||||
err = amdsmi_dev_get_vram_vendor(processor_handles_[i], buffer, kBufferLen);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout <<
|
||||
"\t**Vram Vendor string not supported on this system." << std::endl;
|
||||
err = amdsmi_dev_get_vram_vendor(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_vram_vendor(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -145,10 +145,10 @@ void TestIdInfoRead::Run(void) {
|
||||
}
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_drm_render_minor(device_handles_[i], &drm_render_minor);
|
||||
err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], &drm_render_minor);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -156,15 +156,15 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << "\t**DRM Render Minor: " << drm_render_minor << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen);
|
||||
err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**Device Vendor name string not found on this system." <<
|
||||
std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -172,15 +172,15 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << "\t**Device Vendor name: " << buffer << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
// Get the device ID, name, vendor ID and vendor name for the sub-device
|
||||
err = amdsmi_dev_get_subsystem_id(device_handles_[i], &id);
|
||||
err = amdsmi_dev_get_subsystem_id(processor_handles_[i], &id);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -188,15 +188,15 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << "\t**Subsystem ID: 0x" << std::hex << id << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
err = amdsmi_dev_get_subsystem_name(device_handles_[i], buffer, kBufferLen);
|
||||
err = amdsmi_dev_get_subsystem_name(processor_handles_[i], buffer, kBufferLen);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**Subsystem name string not found on this system." <<
|
||||
std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -204,7 +204,7 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << "\t**Subsystem name: " << buffer << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
@@ -213,13 +213,13 @@ void TestIdInfoRead::Run(void) {
|
||||
asci_info.subvendor_id << std::endl;
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen);
|
||||
err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout <<
|
||||
"\t**Subsystem Vendor name string not found on this system." <<
|
||||
std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -227,11 +227,11 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << "\t**Subsystem Vendor name: " << buffer << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen);
|
||||
err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64);
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64);
|
||||
// Don't check for AMDSMI_STATUS_NOT_SUPPORTED since this should always be
|
||||
// supported. It is not based on a sysfs file.
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -240,7 +240,7 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << " (" << std::dec << val_ui64 << ")" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_pci_id(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
@@ -94,9 +94,9 @@ void TestMemPageInfoRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, nullptr);
|
||||
err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, nullptr);
|
||||
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout <<
|
||||
@@ -104,7 +104,7 @@ void TestMemPageInfoRead::Run(void) {
|
||||
<< std::endl;
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr);
|
||||
err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
|
||||
continue;
|
||||
@@ -115,7 +115,7 @@ void TestMemPageInfoRead::Run(void) {
|
||||
std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr);
|
||||
err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void TestMemPageInfoRead::Run(void) {
|
||||
|
||||
assert(records != nullptr);
|
||||
|
||||
err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, records);
|
||||
err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, records);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**Getting Memory Page Retirement Status not "
|
||||
"supported for this device" << std::endl;
|
||||
|
||||
@@ -116,7 +116,7 @@ void TestMemUtilRead::Run(void) {
|
||||
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
#if 0
|
||||
err = amdsmi_dev_get_memory_busy_percent(i, &mem_busy_percent);
|
||||
@@ -131,14 +131,14 @@ void TestMemUtilRead::Run(void) {
|
||||
#endif
|
||||
for (uint32_t mem_type = AMDSMI_MEM_TYPE_FIRST;
|
||||
mem_type <= AMDSMI_MEM_TYPE_LAST; ++mem_type) {
|
||||
err = amdsmi_dev_get_memory_total(device_handles_[i],
|
||||
err = amdsmi_dev_get_memory_total(processor_handles_[i],
|
||||
static_cast<amdsmi_memory_type_t>(mem_type), &total);
|
||||
err_chk("amdsmi_dev_get_memory_total()");
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_memory_usage(device_handles_[i],
|
||||
err = amdsmi_dev_get_memory_usage(processor_handles_[i],
|
||||
static_cast<amdsmi_memory_type_t>(mem_type), &usage);
|
||||
err_chk("amdsmi_dev_get_memory_usage()");
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
|
||||
@@ -97,7 +97,7 @@ void TestMetricsCounterRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**GPU METRICS ENERGY COUNTER:\n";
|
||||
@@ -106,7 +106,7 @@ void TestMetricsCounterRead::Run(void) {
|
||||
uint64_t power;
|
||||
uint64_t timestamp;
|
||||
float counter_resolution;
|
||||
err = amdsmi_dev_get_energy_count(device_handles_[i], &power, &counter_resolution, ×tamp);
|
||||
err = amdsmi_dev_get_energy_count(processor_handles_[i], &power, &counter_resolution, ×tamp);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -128,14 +128,14 @@ void TestMetricsCounterRead::Run(void) {
|
||||
}
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_energy_count(device_handles_[i], nullptr, nullptr, nullptr);
|
||||
err = amdsmi_dev_get_energy_count(processor_handles_[i], nullptr, nullptr, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
// Coarse Grain counters
|
||||
amdsmi_utilization_counter_t utilization_counters[2];
|
||||
utilization_counters[0].type = AMDSMI_COARSE_GRAIN_GFX_ACTIVITY;
|
||||
utilization_counters[1].type = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY;
|
||||
err = amdsmi_get_utilization_count(device_handles_[i], utilization_counters,
|
||||
err = amdsmi_get_utilization_count(processor_handles_[i], utilization_counters,
|
||||
2, ×tamp);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -158,7 +158,7 @@ void TestMetricsCounterRead::Run(void) {
|
||||
}
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_utilization_count(device_handles_[i], nullptr,
|
||||
err = amdsmi_get_utilization_count(processor_handles_[i], nullptr,
|
||||
1 , nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
} // end for
|
||||
|
||||
@@ -197,63 +197,63 @@ void TestMutualExclusion::Run(void) {
|
||||
std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \
|
||||
} \
|
||||
}
|
||||
ret = amdsmi_dev_get_id(device_handles_[0], &dmy_ui16);
|
||||
ret = amdsmi_dev_get_id(processor_handles_[0], &dmy_ui16);
|
||||
|
||||
// vendor_id, unique_id
|
||||
amdsmi_asic_info_t asci_info;
|
||||
ret = amdsmi_get_asic_info(device_handles_[0], &asci_info);
|
||||
ret = amdsmi_get_asic_info(processor_handles_[0], &asci_info);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
|
||||
// device name, brand, serial_number
|
||||
amdsmi_board_info_t board_info;
|
||||
ret = amdsmi_get_board_info(device_handles_[0], &board_info);
|
||||
ret = amdsmi_get_board_info(processor_handles_[0], &board_info);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
|
||||
ret = amdsmi_dev_get_vendor_name(device_handles_[0], dmy_str, 10);
|
||||
ret = amdsmi_dev_get_vendor_name(processor_handles_[0], dmy_str, 10);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_vram_vendor(device_handles_[0], dmy_str, 10);
|
||||
ret = amdsmi_dev_get_vram_vendor(processor_handles_[0], dmy_str, 10);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_subsystem_id(device_handles_[0], &dmy_ui16);
|
||||
ret = amdsmi_dev_get_subsystem_id(processor_handles_[0], &dmy_ui16);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_pci_id(device_handles_[0], &dmy_ui64);
|
||||
ret = amdsmi_dev_get_pci_id(processor_handles_[0], &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_pci_throughput(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64);
|
||||
ret = amdsmi_dev_get_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[0], &dmy_ui64);
|
||||
ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[0], &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_set_pci_bandwidth(device_handles_[0], 0);
|
||||
ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[0], 0);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_fan_rpms(device_handles_[0], dmy_ui32, &dmy_i64);
|
||||
ret = amdsmi_dev_get_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_fan_speed(device_handles_[0], 0, &dmy_i64);
|
||||
ret = amdsmi_dev_get_fan_speed(processor_handles_[0], 0, &dmy_i64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_fan_speed_max(device_handles_[0], 0, &dmy_ui64);
|
||||
ret = amdsmi_dev_get_fan_speed_max(processor_handles_[0], 0, &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_temp_metric(device_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64);
|
||||
ret = amdsmi_dev_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_reset_fan(device_handles_[0], 0);
|
||||
ret = amdsmi_dev_reset_fan(processor_handles_[0], 0);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_set_fan_speed(device_handles_[0], dmy_ui32, 0);
|
||||
ret = amdsmi_dev_set_fan_speed(processor_handles_[0], dmy_ui32, 0);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[0], &dmy_perf_lvl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[0], &dmy_perf_lvl);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_overdrive_level(device_handles_[0], &dmy_ui32);
|
||||
ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[0], CLK_TYPE_SYS, &dmy_freqs);
|
||||
ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_od_volt_info(device_handles_[0], &dmy_od_volt);
|
||||
ret = amdsmi_dev_get_od_volt_info(processor_handles_[0], &dmy_od_volt);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_od_volt_curve_regions(device_handles_[0], &dmy_ui32, &dmy_vlt_reg);
|
||||
ret = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_set_overdrive_level_v1(device_handles_[0], dmy_i32);
|
||||
ret = amdsmi_dev_set_overdrive_level_v1(processor_handles_[0], dmy_i32);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_set_clk_freq(device_handles_[0], CLK_TYPE_SYS, 0);
|
||||
ret = amdsmi_dev_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_ecc_count(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt);
|
||||
ret = amdsmi_dev_get_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_ecc_enabled(device_handles_[0], &dmy_ui64);
|
||||
ret = amdsmi_dev_get_ecc_enabled(processor_handles_[0], &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_ecc_status(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st);
|
||||
ret = amdsmi_dev_get_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
|
||||
/* Other functions holding device mutexes. Listed for reference.
|
||||
|
||||
@@ -96,14 +96,14 @@ void TestOverdriveRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
err = amdsmi_dev_get_overdrive_level(device_handles_[i], &val_ui32);
|
||||
err = amdsmi_dev_get_overdrive_level(processor_handles_[i], &val_ui32);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**OverDrive Level:" << val_ui32 << std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_overdrive_level(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_overdrive_level(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,27 +95,27 @@ void TestOverdriveReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "Set Overdrive level to 0%..." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0);
|
||||
ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0);
|
||||
CHK_ERR_ASRT(ret)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "Set Overdrive level to 10%..." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 10);
|
||||
ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 10);
|
||||
CHK_ERR_ASRT(ret)
|
||||
ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val);
|
||||
ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val);
|
||||
CHK_ERR_ASRT(ret)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**New OverDrive Level:" << val << std::endl;
|
||||
std::cout << "Reset Overdrive level to 0%..." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0);
|
||||
ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0);
|
||||
CHK_ERR_ASRT(ret)
|
||||
ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val);
|
||||
ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val);
|
||||
CHK_ERR_ASRT(ret)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**New OverDrive Level:" << val << std::endl;
|
||||
|
||||
@@ -98,9 +98,9 @@ void TestPciReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], &u64int);
|
||||
ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], &u64int);
|
||||
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout <<
|
||||
@@ -108,7 +108,7 @@ void TestPciReadWrite::Run(void) {
|
||||
" on this machine" << std::endl;
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr);
|
||||
ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(ret)
|
||||
@@ -116,11 +116,11 @@ void TestPciReadWrite::Run(void) {
|
||||
std::cout << "\tPCIe Replay Counter: " << u64int << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr);
|
||||
ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_get_pci_throughput(device_handles_[dv_ind], &sent, &received, &max_pkt_sz);
|
||||
ret = amdsmi_dev_get_pci_throughput(processor_handles_[dv_ind], &sent, &received, &max_pkt_sz);
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "TEST FAILURE: Current PCIe throughput is not detected. "
|
||||
"This is likely because it is not indicated in the pcie_bw sysfs "
|
||||
@@ -141,14 +141,14 @@ void TestPciReadWrite::Run(void) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw);
|
||||
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw);
|
||||
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "TEST FAILURE: Current PCIe bandwidth is not detected. "
|
||||
"This is likely because it is not indicated in the pp_dpm_pcie sysfs "
|
||||
"file. Aborting test." << std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], nullptr);
|
||||
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
|
||||
return;
|
||||
@@ -163,7 +163,7 @@ void TestPciReadWrite::Run(void) {
|
||||
std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], nullptr);
|
||||
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
|
||||
|
||||
// First set the bitmask to all supported bandwidths
|
||||
@@ -182,10 +182,10 @@ void TestPciReadWrite::Run(void) {
|
||||
std::cout << "\tSetting bandwidth mask to " << "0b" << freq_bm_str <<
|
||||
" ..." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], freq_bitmask);
|
||||
ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw);
|
||||
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -193,10 +193,10 @@ void TestPciReadWrite::Run(void) {
|
||||
std::endl;
|
||||
std::cout << "\tResetting mask to all bandwidths." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], 0xFFFFFFFF);
|
||||
ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], 0xFFFFFFFF);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
CHK_ERR_ASRT(ret)
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ void TestPerfCntrReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
amdsmi_processor_handle dev_handle = device_handles_[dv_ind];
|
||||
amdsmi_processor_handle dev_handle = processor_handles_[dv_ind];
|
||||
PrintDeviceHeader(dev_handle);
|
||||
try {
|
||||
testEventsIndividually(dev_handle);
|
||||
|
||||
@@ -102,8 +102,8 @@ void TestPerfDeterminism::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t** Not supported on this machine" << std::endl;
|
||||
@@ -114,14 +114,14 @@ void TestPerfDeterminism::Run(void) {
|
||||
clkvalue = (odv.curr_sclk_range.lower_bound/1000000) + 50;
|
||||
}
|
||||
|
||||
err = amdsmi_set_perf_determinism_mode(device_handles_[i], clkvalue);
|
||||
err = amdsmi_set_perf_determinism_mode(processor_handles_[i], clkvalue);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**Not supported on this machine" << std::endl;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) <<
|
||||
@@ -130,9 +130,9 @@ void TestPerfDeterminism::Run(void) {
|
||||
}
|
||||
|
||||
std::cout << "\t**Resetting performance determinism" << std::endl;
|
||||
err = amdsmi_dev_set_perf_level(device_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);;
|
||||
err = amdsmi_dev_set_perf_level(processor_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);;
|
||||
CHK_ERR_ASRT(err)
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) <<
|
||||
|
||||
@@ -96,16 +96,16 @@ void TestPerfLevelRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
err = amdsmi_dev_get_perf_level(device_handles_[i], &pfl);
|
||||
err = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**Performance Level:" << std::dec << (uint32_t)pfl <<
|
||||
std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_perf_level(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_perf_level(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
@@ -99,9 +99,9 @@ void TestPerfLevelReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &orig_pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &orig_pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -120,14 +120,14 @@ void TestPerfLevelReadWrite::Run(void) {
|
||||
GetPerfLevelStr(static_cast<amdsmi_dev_perf_level_t>(pfl_i)) <<
|
||||
" ..." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind],
|
||||
ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind],
|
||||
static_cast<amdsmi_dev_perf_level_t>(pfl_i));
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**" << GetPerfLevelStr(static_cast<amdsmi_dev_perf_level_t>(pfl_i))
|
||||
<< " returned AMDSMI_STATUS_NOT_SUPPORTED" << std::endl;
|
||||
} else {
|
||||
CHK_ERR_ASRT(ret)
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) <<
|
||||
@@ -139,9 +139,9 @@ void TestPerfLevelReadWrite::Run(void) {
|
||||
std::cout << "Reset Perf level to " << GetPerfLevelStr(orig_pfl) <<
|
||||
" ..." << std::endl;
|
||||
}
|
||||
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], orig_pfl);
|
||||
ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], orig_pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
|
||||
@@ -100,13 +100,13 @@ void TestPowerCapReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
amdsmi_power_cap_info_t info;
|
||||
ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info);
|
||||
ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info);
|
||||
CHK_ERR_ASRT(ret)
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, nullptr);
|
||||
ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
|
||||
min = info.min_power_cap;
|
||||
max = info.max_power_cap;
|
||||
@@ -121,13 +121,13 @@ void TestPowerCapReadWrite::Run(void) {
|
||||
std::cout << "Setting new cap to " << new_cap << "..." << std::endl;
|
||||
}
|
||||
start = clock();
|
||||
ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, new_cap);
|
||||
ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, new_cap);
|
||||
end = clock();
|
||||
cpu_time_used = ((double) (end - start)) * 1000000UL / CLOCKS_PER_SEC;
|
||||
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info);
|
||||
ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info);
|
||||
CHK_ERR_ASRT(ret)
|
||||
new_cap = info.default_power_cap;
|
||||
|
||||
@@ -139,10 +139,10 @@ void TestPowerCapReadWrite::Run(void) {
|
||||
std::cout << "Resetting cap to " << orig << "..." << std::endl;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, orig);
|
||||
ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, orig);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info);
|
||||
ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info);
|
||||
CHK_ERR_ASRT(ret)
|
||||
new_cap = info.default_power_cap;
|
||||
|
||||
|
||||
@@ -97,10 +97,10 @@ void TestPowerRead::Run(void) {
|
||||
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
amdsmi_power_cap_info_t info;
|
||||
err = amdsmi_get_power_cap_info(device_handles_[i], 0, &info);
|
||||
err = amdsmi_get_power_cap_info(processor_handles_[i], 0, &info);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**Current Power Cap: " << info.power_cap << "uW" <<std::endl;
|
||||
@@ -112,7 +112,7 @@ void TestPowerRead::Run(void) {
|
||||
info.max_power_cap << " uW" << std::endl;
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_power_ave(device_handles_[i], 0, &val_ui64);
|
||||
err = amdsmi_dev_get_power_ave(processor_handles_[i], 0, &val_ui64);
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**Averge Power Usage: ";
|
||||
CHK_AMDSMI_PERM_ERR(err)
|
||||
@@ -120,7 +120,7 @@ void TestPowerRead::Run(void) {
|
||||
std::cout << static_cast<float>(val_ui64)/1000 << " mW" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_power_ave(device_handles_[i], 0, nullptr);
|
||||
err = amdsmi_dev_get_power_ave(processor_handles_[i], 0, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ void TestPowerReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
PrintDeviceHeader(device_handles_[dv_ind]);
|
||||
PrintDeviceHeader(processor_handles_[dv_ind]);
|
||||
|
||||
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status);
|
||||
ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status);
|
||||
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "The power profile presets settings is not supported. "
|
||||
<< std::endl;
|
||||
@@ -131,7 +131,7 @@ void TestPowerReadWrite::Run(void) {
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, nullptr);
|
||||
ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, nullptr);
|
||||
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
@@ -172,27 +172,27 @@ void TestPowerReadWrite::Run(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
ret = amdsmi_dev_set_power_profile(device_handles_[dv_ind], 0, new_prof);
|
||||
ret = amdsmi_dev_set_power_profile(processor_handles_[dv_ind], 0, new_prof);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
amdsmi_dev_perf_level_t pfl;
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_MANUAL);
|
||||
|
||||
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status);
|
||||
ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ASSERT_EQ(status.current, new_prof);
|
||||
|
||||
ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl);
|
||||
ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl);
|
||||
CHK_ERR_ASRT(ret)
|
||||
ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_AUTO);
|
||||
|
||||
ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status);
|
||||
ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status);
|
||||
CHK_ERR_ASRT(ret)
|
||||
|
||||
ASSERT_EQ(status.current, orig_profile);
|
||||
|
||||
@@ -100,10 +100,10 @@ void TestSysInfoRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
amdsmi_vbios_info_t info;
|
||||
err = amdsmi_get_vbios_info(device_handles_[i], &info);
|
||||
err = amdsmi_get_vbios_info(processor_handles_[i], &info);
|
||||
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_FILE_ERROR) {
|
||||
@@ -112,11 +112,11 @@ void TestSysInfoRead::Run(void) {
|
||||
<< std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_vbios_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_get_vbios_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_vbios_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_get_vbios_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -128,36 +128,36 @@ void TestSysInfoRead::Run(void) {
|
||||
}
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64);
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**PCI ID (BDFID): 0x" << std::hex << val_ui64;
|
||||
std::cout << " (" << std::dec << val_ui64 << ")" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_pci_id(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
err = amdsmi_topo_get_numa_affinity(device_handles_[i], &val_ui32);
|
||||
err = amdsmi_topo_get_numa_affinity(processor_handles_[i], &val_ui32);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**NUMA NODE: 0x" << std::hex << val_ui32;
|
||||
std::cout << " (" << std::dec << val_ui32 << ")" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_topo_get_numa_affinity(device_handles_[i], nullptr);
|
||||
err = amdsmi_topo_get_numa_affinity(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
|
||||
// vendor_id, unique_id
|
||||
amdsmi_asic_info_t asci_info;
|
||||
err = amdsmi_get_asic_info(device_handles_[0], &asci_info);
|
||||
err = amdsmi_get_asic_info(processor_handles_[0], &asci_info);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout <<
|
||||
"\t**amdsmi_dev_unique_id() is not supported"
|
||||
" on this machine" << std::endl;
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_asic_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_get_asic_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
if (err == AMDSMI_STATUS_SUCCESS) {
|
||||
@@ -169,7 +169,7 @@ void TestSysInfoRead::Run(void) {
|
||||
*/
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_get_asic_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_get_asic_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
} else {
|
||||
std::cout << "amdsmi_dev_unique_id_get() failed with error " <<
|
||||
@@ -190,11 +190,11 @@ void TestSysInfoRead::Run(void) {
|
||||
std::cout << std::setbase(10);
|
||||
|
||||
amdsmi_fw_info_t fw_info;
|
||||
err = amdsmi_get_fw_info(device_handles_[i], &fw_info);
|
||||
err = amdsmi_get_fw_info(processor_handles_[i], &fw_info);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
std::cout << "\t**No FW " <<
|
||||
" available on this system" << std::endl;
|
||||
err = amdsmi_get_fw_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_get_fw_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
|
||||
@@ -110,11 +110,11 @@ void TestTempRead::Run(void) {
|
||||
uint32_t type;
|
||||
for (uint32_t x = 0; x < num_iterations(); ++x) {
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
auto print_temp_metric = [&](amdsmi_temperature_metric_t met,
|
||||
std::string label) {
|
||||
err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, &val_i64);
|
||||
err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, &val_i64);
|
||||
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -124,7 +124,7 @@ void TestTempRead::Run(void) {
|
||||
}
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, nullptr);
|
||||
err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
return;
|
||||
} else {
|
||||
@@ -132,7 +132,7 @@ void TestTempRead::Run(void) {
|
||||
}
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, nullptr);
|
||||
err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast<amdsmi_temperature_type_t>(type), met, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
|
||||
@@ -155,9 +155,9 @@ void TestVoltCurvRead::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv);
|
||||
err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv);
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout <<
|
||||
@@ -165,12 +165,12 @@ void TestVoltCurvRead::Run(void) {
|
||||
<< std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
} else {
|
||||
CHK_ERR_ASRT(err)
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr);
|
||||
err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ void TestVoltCurvRead::Run(void) {
|
||||
ASSERT_TRUE(regions != nullptr);
|
||||
|
||||
num_regions = odv.num_regions;
|
||||
err = amdsmi_dev_get_od_volt_curve_regions(device_handles_[i], &num_regions, regions);
|
||||
err = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[i], &num_regions, regions);
|
||||
CHK_ERR_ASRT(err)
|
||||
ASSERT_TRUE(num_regions == odv.num_regions);
|
||||
|
||||
|
||||
@@ -100,11 +100,11 @@ void TestVoltRead::Run(void) {
|
||||
amdsmi_voltage_type_t type = AMDSMI_VOLT_TYPE_VDDGFX;
|
||||
|
||||
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
|
||||
PrintDeviceHeader(device_handles_[i]);
|
||||
PrintDeviceHeader(processor_handles_[i]);
|
||||
|
||||
auto print_volt_metric = [&](amdsmi_voltage_metric_t met,
|
||||
std::string label) {
|
||||
err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, &val_i64);
|
||||
err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, &val_i64);
|
||||
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -113,7 +113,7 @@ void TestVoltRead::Run(void) {
|
||||
"Not supported on this machine" << std::endl;
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, nullptr);
|
||||
err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void TestVoltRead::Run(void) {
|
||||
}
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, nullptr);
|
||||
err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
|
||||
@@ -98,7 +98,7 @@ void TestXGMIReadWrite::Run(void) {
|
||||
}
|
||||
|
||||
for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) {
|
||||
auto device = device_handles_[dv_ind];
|
||||
auto device = processor_handles_[dv_ind];
|
||||
PrintDeviceHeader(device);
|
||||
|
||||
amdsmi_xgmi_info_t info;
|
||||
|
||||
@@ -124,16 +124,16 @@ void TestBase::SetUp(uint64_t init_flags) {
|
||||
for (uint32_t i=0; i < socket_count_; i++) {
|
||||
// Get all devices of the socket
|
||||
uint32_t device_count = 0;
|
||||
err = amdsmi_get_device_handles(sockets_[i],
|
||||
err = amdsmi_get_processor_handles(sockets_[i],
|
||||
&device_count, nullptr);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
setup_failed_ = true;
|
||||
}
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_SUCCESS);
|
||||
|
||||
std::vector<amdsmi_processor_handle> device_handles(device_count);
|
||||
err = amdsmi_get_device_handles(sockets_[i],
|
||||
&device_count, &device_handles[0]);
|
||||
std::vector<amdsmi_processor_handle> processor_handles(device_count);
|
||||
err = amdsmi_get_processor_handles(sockets_[i],
|
||||
&device_count, &processor_handles[0]);
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
setup_failed_ = true;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void TestBase::SetUp(uint64_t init_flags) {
|
||||
setup_failed_ = true;
|
||||
ASSERT_EQ(AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS, AMDSMI_STATUS_SUCCESS);
|
||||
}
|
||||
device_handles_[num_monitor_devs_] = device_handles[j];
|
||||
processor_handles_[num_monitor_devs_] = processor_handles[j];
|
||||
num_monitor_devs_++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class TestBase {
|
||||
bool setup_failed_; ///< Record that setup failed to return ierr in Run
|
||||
uint32_t num_monitor_devs_; ///< Number of monitor devices found
|
||||
///< device handles
|
||||
amdsmi_processor_handle device_handles_[MAX_MONITOR_DEVICES];
|
||||
amdsmi_processor_handle processor_handles_[MAX_MONITOR_DEVICES];
|
||||
uint32_t socket_count_; ///< socket count
|
||||
std::vector<amdsmi_socket_handle> sockets_; ///< sockets
|
||||
|
||||
|
||||
Reference in new issue
Block a user