A lightweight script for GPU monitoring. Automatically emails the user when VRAM usage drops below a specified threshold and then exits the script.
一个轻量级 GPU 监控脚本,当显存使用情况低于预设阈值时将会自动发送邮件至指定邮箱,并退出脚本。
This script is mainly used to check whether the training is completed and whether the GPUs are idle.
本脚本主要用于查看训练是否完成/显卡是否闲置。
- 本脚本支持通过
gpu_id监控指定GPU显,threshold是预设的显存阈值,默认为10MiB,check_interval为检测时间间隔,默认为300s。 - This script supports monitoring the VRAM of a specified GPU through the gpu_id. The
thresholdis the preset video memory threshold, with a default value of 10 MiB.check_intervalis the detection time interval, with a default value of 300 seconds.
Lines 128 to 129 in 768c15b
- 默认使用QQ邮箱,更换邮箱需修改
smtp_server和smtp_port - Default QQ Mail. For other providers, update
smtp_server&smtp_port
Lines 8 to 12 in 5c82370
- 必须使用邮箱安全密码(非登录密码)
- Use application-specific password (NOT login password)
nohup python monitor.py >monitor.log 2>&1&