Linxue如何监视显存和内存的使用情况

Linux如何监视显存和内存的使用情况

显存(2秒刷新一次内存消耗):

nvidia-smi -l 2 > logGPU.txt

真的是服了,nvdia-smi会报错

WARNING: infoROM is corrupted at gpu 0000:60:00.0

新的解决方案:自己写一个watch脚本 。.sh

#!/bin/bash
while true
 do
    nvidia-smi  | tee -a /logMonitor.txt
    free -h | tee -a logMonitor.txt
    sleep 1s
done

内存(输出带时间戳的内存消耗):

vmstat 2 -a -S M -w -t > logCPU.txt

Log the Memory Consumption on Linux | Baeldung on Linux

vmstat 1 3 -a -S M -w -t

  • 1: delay in printing the statistics
  • 3: number of times we wanted to print the statistics
  • -a: print the active and inactive memory information; by default, it prints the buffer and cache information
  • -S M: tells to print the statistics in MB
  • -w: set the wide mode to accommodate the large values
  • -t: to print the timestamp in the result
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值