A progress for ascent npu monitor
mkdir /usr/local/npu-monitor
cd /usr/local/npu-monitor
wget https://gitee.com/youwantto/Ascent-NPU-monitor/blob/main/monitor
wget https://gitee.com/youwantto/Ascent-NPU-monitor/blob/main/show_smi.py
wget https://gitee.com/youwantto/Ascent-NPU-monitor/blob/main/config.ini
-
需要python安装
prettytable
和configparser
库:python3 -m pip install prettytable python3 -m pip install configparser
-
给shell脚本添加可执行权限:
chmod +x monitor
-
运行脚本:
# 静态查看npu ./monitor # 动态查看npu ./monitor watch # 按q退出monitor
-
修改环境变量 (按需):
将脚本所在路径加入
~/.bashrc
配置中使环境变量修改生效:
source ~/.bashrc
之后可以直接通过
monitor
命令运行 -
配置文件
config.ini
:[config] npu_num = 8 [chart] chart_his_max_length = 30 use_threshold1 = 20 use_threshold2 = 70
npu_num参数为npu数量,chart_his_max_length参数为展示的内存使用率、npu使用率柱状图总长度,use_threshold1,use_threshold2为内存使用率、npu使用率的两个阈值,20,70表示使用率20以下展示颜色为绿色,20-70为黄色,70以上为红色。