From 4ab27528befd07ba92c5368f9f031a4701525262 Mon Sep 17 00:00:00 2001 From: Chris Freehill Date: Fri, 8 Feb 2019 09:51:10 -0600 Subject: [PATCH] Replace fan test failure with warning In some cases, the fan sysfs files will exist even if the device doesn't have a fan. In these cases, the tests will give apparently random results. Also, remove documentation and ifdef'd test of debugfs related power functions. --- example/rocm_smi_example.cc | 12 --------- include/rocm_smi/rocm_smi.h | 22 --------------- tests/rocm_smi_test/functional/rsmi_sanity.cc | 27 +++++-------------- 3 files changed, 7 insertions(+), 54 deletions(-) diff --git a/example/rocm_smi_example.cc b/example/rocm_smi_example.cc index 3a323ef0d5..5bec1a426d 100755 --- a/example/rocm_smi_example.cc +++ b/example/rocm_smi_example.cc @@ -453,18 +453,6 @@ int main() { CHK_RSMI_RET(ret) std::cout << "\t**Current fan RPMs: " << val_i64 << std::endl; - ret = rsmi_dev_power_max_get(i, 0, &val_ui64); - if (ret == RSMI_STATUS_NOT_SUPPORTED) { - const char *s_str; - ret = rsmi_status_string(RSMI_STATUS_NOT_SUPPORTED, &s_str); - CHK_RSMI_RET(ret) - std::cout << "\t**rsmi_dev_power_max_get(): " << s_str << std::endl; - } else { - CHK_RSMI_PERM_RET(ret) - std::cout << "\t**Max Power Usage: "; - std::cout << static_cast(val_ui64)/1000 << " W" << std::endl; - } - ret = rsmi_dev_power_cap_get(i, 0, &val_ui64); CHK_RSMI_PERM_RET(ret) std::cout << "\t**Current Power Cap: " << val_ui64 << "uW" < 0.95 * new_speed && cur_speed < 1.1 * new_speed) || - cur_speed > 0.95 * RSMI_MAX_FAN_SPEED); + // EXPECT_TRUE((cur_speed > 0.95 * new_speed && cur_speed < 1.1 * new_speed) || + // cur_speed > 0.95 * RSMI_MAX_FAN_SPEED); + if (!((cur_speed > 0.95 * new_speed && cur_speed < 1.1 * new_speed) || + (cur_speed > 0.95 * RSMI_MAX_FAN_SPEED))) { + std::cout << "WARNING: Fan speed is not within the expected range!" << + std::endl; + } IF_VERB(STANDARD) { std::cout << "Resetting fan control to auto..." << std::endl; @@ -805,24 +810,6 @@ void TestSanity::Run(void) { IF_VERB(STANDARD) { std::cout << "\t**Current fan RPMs: " << val_i64 << std::endl; } -#if 0 // Apparently recent change in debug fs causes crash here. - // Disable able this for now until we debug error path. - err = rsmi_dev_power_max_get(i, &val_ui64); - if (err == RSMI_STATUS_NOT_SUPPORTED) { - const char *s_str; - err = rsmi_status_string(RSMI_STATUS_NOT_SUPPORTED, &s_str); - CHK_ERR_ASRT(err) - std::cout << "\t**rsmi_dev_power_max_get(): " << s_str << std::endl; - } else { - IF_VERB(STANDARD) { - std::cout << "\t**Max Power Usage: "; - CHK_RSMI_PERM_ERR(err) - if (err == RSMI_STATUS_SUCCESS) { - std::cout << static_cast(val_ui64)/1000 << " W" << std::endl; - } - } - } -#endif err = rsmi_dev_power_cap_get(i, 0, &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) {