#!/bin/bash

while true;do
  sleep 10
  flag=true
  dcus=`hy-smi | awk 'NR>4 && NR<13 {print $6}' | awk -F "%" '{print int($1)}'`
  for dcu in $dcus;do
    if [[ $dcu > 0 ]];then
        echo $dcu
        flag=false
        break
    fi
  done
  if $flag;then
    echo "start exec"
    #bash finetune_hunyuan.sh | tee fv_subcompile_251.log
    bash finetune_hunyuan.sh
    break
  else
    echo "continue poll"
  fi
done
