fix: fix bug
This commit is contained in:
parent
ab82c952f1
commit
0640628e46
|
@ -14,7 +14,6 @@ npu_id_arr=(2 3 5 6)
|
||||||
|
|
||||||
get_power_dissipation() {
|
get_power_dissipation() {
|
||||||
local npu_id="$1"
|
local npu_id="$1"
|
||||||
# need to varify
|
|
||||||
power_dissipation=$(npu-smi info -t power -i ${npu_id} | grep 'Power Dissipation(W)' | awk '{print $4}')
|
power_dissipation=$(npu-smi info -t power -i ${npu_id} | grep 'Power Dissipation(W)' | awk '{print $4}')
|
||||||
echo "${power_dissipation}"
|
echo "${power_dissipation}"
|
||||||
}
|
}
|
||||||
|
@ -22,7 +21,7 @@ get_power_dissipation() {
|
||||||
get_mem_usage() {
|
get_mem_usage() {
|
||||||
local chip="$1"
|
local chip="$1"
|
||||||
local device="$2"
|
local device="$2"
|
||||||
mem_usage=$(npu-smi info | grep '${chip} ${device}' | awk '{print $8}')
|
mem_usage=$(npu-smi info | grep "${chip} ${device}" | awk '{print $8}')
|
||||||
echo "${mem_usage}"
|
echo "${mem_usage}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +31,6 @@ loop_cnt=0
|
||||||
while true; do
|
while true; do
|
||||||
device_mem_usage=""
|
device_mem_usage=""
|
||||||
for ((i=0; i<device_cnt; i++)); do
|
for ((i=0; i<device_cnt; i++)); do
|
||||||
echo "get_mem_usage ${chip_id_arr_from_info[i]} ${i}"
|
|
||||||
mem_usage=$(get_mem_usage ${chip_id_arr_from_info[i]} ${i})
|
mem_usage=$(get_mem_usage ${chip_id_arr_from_info[i]} ${i})
|
||||||
device_mem_usage="${device_mem_usage}{"npu_id": ${npu_id_arr_from_info[i]}, "chip_id": ${chip_id_arr_from_info[i]}, "device_id": ${i}, "mem_usage": ${mem_usage}}, "
|
device_mem_usage="${device_mem_usage}{"npu_id": ${npu_id_arr_from_info[i]}, "chip_id": ${chip_id_arr_from_info[i]}, "device_id": ${i}, "mem_usage": ${mem_usage}}, "
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue