赞
踩
要获取显卡信息,只有两种可能,一种是通过系统的API访问,或者直接读取/dev/下相关文件的状态,另一种方式是通过BIOS读取。
1. 通过PCI查看
通用的方法,通过lspci查看:
lspci | grep -i vga
前边的序号 "00:0f.0"是显卡的代号,然后
lspci -v -s 00:0f.0
其他方法:
监控程序glances与其GPU monitoring plug-in一起使用:
开源
安装:sudo apt-get install -y python-pip; sudo pip install glances[gpu]
发布:sudo glances
使用conky作为CPU和GPU的real-time监视器。
英特尔i7-6700HQ iGPU HD 530
在这种情况下,我使用集成GPU而不是nVidia GTX 970M启动:
conky代码根据使用prime-select intel或prime-select nvidia启动进行调整
amd显卡有工具,执行atigetsysteminfo.sh
fglrx(闭源驱动程序):aticonfig --odgc --odgt
mesa(开源驱动程序):RadeonTop:apt install radeontop
rocm-smi 显示设备及显存占用,等价于 rocm-svm --alldevice
显示独立内存占用:
rocm-smi --showmeminfo vram vis_vram gtt
显示占用GPU的进程id
rocm-smi --showpids
类似jupyter之类的占用大量显存不释放
查看GPU(多卡)的温度
用watch命令来监控:
$ watch [options] command
参数 -n 后面指定是每多少秒来执行一次命令。
$ watch -n 10 xxxx
每 10s 执行一次xxxx命令
intel-gpu-tools工具安装完毕后, 系统中会多种三个gpu工具: intel_gpu_abrt intel_gpu_time intel_gpu_top。
其中,常用的是intel_gpu_top和intel_gpu_time
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。