From 6122d9b04d39c5be65392893d06f93adfc6eefae Mon Sep 17 00:00:00 2001 From: wql Date: Wed, 11 Sep 2024 10:02:59 +0800 Subject: [PATCH] test: fix --- npu_status.sh | 70 ++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/npu_status.sh b/npu_status.sh index 865a1490..1c75bf32 100644 --- a/npu_status.sh +++ b/npu_status.sh @@ -11,39 +11,6 @@ chip_id_arr_from_info=(0 1 0 1 0 1 0 1) npu_id_arr_from_info=(2 2 3 3 5 5 6 6) npu_id_arr=(2 3 5 6) -loop_cnt=0 - -while true; do - device_mem_usage="" - for ((i=0; i> output_file_path - sleep sleep_time - - if [ "$print_to_screen" -eq "1" ]; then - echo "$json" - fi - - loop_cnt+=1 - if [ "$loop_cnt" -eq "1500" ]; then - exit 0 - fi - -done get_power_dissipation() { local npu_id="$1" @@ -57,4 +24,39 @@ get_mem_usage() { local device="$2" mem_usage=$(npu-smi info | grep '${chip} ${device}' | awk '{print $8}') echo "${mem_usage}" -} \ No newline at end of file +} + + +loop_cnt=0 + +while true; do + device_mem_usage="" + for ((i=0; i> output_file_path + sleep "${sleep_time}" + + if [ "$print_to_screen" -eq "1" ]; then + echo "$json" + fi + + loop_cnt+=1 + if [ "$loop_cnt" -eq "1500" ]; then + exit 0 + fi + +done