Skip to content

GPU显卡占用率监控(目前仅支持N卡)

Notifications You must be signed in to change notification settings

AyaneAI/GPUMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPUWatch

对GPU运行状态进行实时监控,如果GPU断开,则邮件报警

1. 需要安装pynvml

pip install pynvml

2. 功能

  • 定时监控功能,可设定update_interval控制监控间隔时间长短
  • 邮件报警功能,若波动小于所设定的阈值bound,则通过smtplib模块发送警报邮件

3. 参数输入

  • GPU监控编号:gpu_index
  • GPU显存允许波动范围:bound
  • 监控间隔时间:update_interval
  • 发送邮箱用户名:mail_user
  • 发送邮箱密码(验证码):mail_pass
  • 发送邮箱地址:sender
  • 接收邮箱地址:receivers(多个邮箱之间可通过,分隔)

4. 使用范例

python main.py --gpu_index 0,1 --bound -0.2 --update_interval 10 --mail_user xxx -- mail_pass xxx --sender xxx@qq.com --receivers xxx@qq.com,yyy@qq.com


GPU状态信息监控

  • client实现对设备GPU状态信息的获取,并且通过json发送给server
  • server接收数据,并且将数据存放至数据库中,并提供功能接口,实现GPU状态数据检索

使用方式

  • 在设备客户端部署client.py,并在后台运行

    nohup python -u client.py > monitor.log 2>&1 &
  • 在服务器端部署server.py,并在后台运行

    nohup python -u server.py > monitor.log 2>&1 &

接口(端口:5089)

  1. [GET] get_device

    • 功能:查询有哪些已经在监测中的设备
    • 发送:无
    • 返回:设备名称
  2. [GET] get_data

    • 功能:查询设备具体状态信息
    • 发送:需要查询的设备编号(需要为数组格式)
    • 返回:设备具体状态信息

About

GPU显卡占用率监控(目前仅支持N卡)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages