From 69c642a7203ed92d5985bf0470ee6fb912d3257c Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Tue, 26 Sep 2023 11:41:55 -0400 Subject: [PATCH] Updated the sample test for esmi wrappers Change-Id: Ie382b84a0aed4ae40f4befa0e922c19ae8a316c8 [ROCm/amdsmi commit: 7a2f3c8d56bac2d6474b77426e1f50333b361e09] --- .../example/amdsmi_esmi_intg_example.cc | 289 +++++++++++++++++- 1 file changed, 287 insertions(+), 2 deletions(-) diff --git a/projects/amdsmi/example/amdsmi_esmi_intg_example.cc b/projects/amdsmi/example/amdsmi_esmi_intg_example.cc index 363124bb01..0bf65df0f7 100644 --- a/projects/amdsmi/example/amdsmi_esmi_intg_example.cc +++ b/projects/amdsmi/example/amdsmi_esmi_intg_example.cc @@ -43,7 +43,6 @@ #include #include #include - #include #include #include @@ -317,7 +316,7 @@ int main(int argc, char **argv) { if (ret != AMDSMI_STATUS_SUCCESS) { cout<<"Failed to set power efficiency mode for socket["<>boost_limit; + ret = amdsmi_set_cpu_core_boostlimit(processor_handles[i], i, boost_limit); + CHK_AMDSMI_RET(ret) + + if(ret != AMDSMI_STATUS_SUCCESS) + cout<<"Failed: to set core"<<"["<>min; + cout<<"\nEnter the XGMI max value to be set:\n"; + cin>>max; + + ret = amdsmi_set_cpu_xgmi_width(sockets[i], min, max); + CHK_AMDSMI_RET(ret) + + if(ret) + cout<<"Failed: to set xGMI link width, Err["<>min_link_width; + cout<<"\nEnter the GMI3 link width max value to be set:\n"; + cin>>max_link_width; + + ret = amdsmi_set_cpu_gmi3_link_width_range(sockets[i], i, min_link_width, max_link_width); + CHK_AMDSMI_RET(ret) + + if(ret) + cout<<"Failed to set gmi3 link width for socket["<>pstate; + ret = amdsmi_cpu_apb_disable(sockets[i], i, pstate); + CHK_AMDSMI_RET(ret) + + if(ret) + cout<<"Failed: to set socket["<>rate_ctrl; + + ret = amdsmi_set_cpu_pcie_link_rate(sockets[i], i, rate_ctrl, &prev_mode); + CHK_AMDSMI_RET(ret) + + if(ret != AMDSMI_STATUS_SUCCESS) + cout<<"Failed to set pcie link rate control for socket["<>max_pstate; + cout<<"\nEnter the min_pstate to be set:\n"; + cin>>min_pstate; + + ret = amdsmi_set_cpu_df_pstate_range(sockets[i], i, max_pstate, min_pstate); + CHK_AMDSMI_RET(ret) + + if(ret != AMDSMI_STATUS_SUCCESS) + cout<<"Failed to set df pstate range, Err["<(1) ; + ret = amdsmi_get_cpu_current_io_bandwidth(sockets[i], i, io_link, &bw); + CHK_AMDSMI_RET(ret) + + if(ret != AMDSMI_STATUS_SUCCESS) + cout<<"Failed to get io bandwidth width for socket ["<(1<