windows(包括CMD)查看GPU占用率以及GPU未执行原因

本文转载自:https://blog.csdn.net/weixin_41770169/article/details/80349088

1、CPU利用率

进行深度学习时,发现电脑CPU占用率太高,接近100%,磁盘有时也达到100%。怀疑没有用GPU进行训练。

任务管理器中只有CPU、内存、磁盘的占用率情况

2、查看GPU占用率

(1)打开cmd窗口(win+R,再输入cmd)

(2)在文件夹C:\Program Files\NVIDIA Corporation\NVSMI里找到文件nvidia-smi.exe

(3)将文件拖入cmd窗口,就可以显示GPU信息。发现:GPU利用率很低,不到5%。

第一行是版本信息,第二行是标题栏,第三行就是具体显卡信息了。

GPU:编号,0

Name:显卡名,NVS 4200M

TCC/WDDM:WDDM

Fan:风扇转速,这里N/A,应该是没转

Temp:显卡温度,这里是66摄氏度

Perf:性能状态,congP0-P12,P0性能最大,P12最小,这里是P0

Pwr:能耗,Usage是使用量,Cap是总量

BusId:涉及GPU总线

Disp.A:表示GPU的显示是否已经初始化

Memory-Usage:显存使用率,这里才用很少,5%不到

CPU-Util:GPU利用率

Compute M:计算模式

 

(参考文章:https://blog.csdn.net/Cloudox_/article/details/78651637)

(4)用GPU-Z工具查看GPU使用情况:发现负载为0

----------------------------------------------------------------------------------------------------------------------------------

综合nvidia-smi.exe和GPU-Z发现GPU没有执行。

3、查看GPU没有执行的原因

>>> import tensorflow as tf
>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
2018-05-17 15:25:30.744860: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties:
name: NVS 4200M major: 2 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
totalMemory: 1.00GiB freeMemory: 826.13MiB
2018-05-17 15:25:30.745094: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1406] <strong><span style="color:#ff0000;">Ignoring visible gpu device (device: 0, name: NVS 4200M, pci bus id: 0000:01:00.0, compute capability: 2.1) with Cuda compute capability 2.1. The minimum required Cuda capability is 3.0.</span></strong>
2018-05-17 15:25:30.746883: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-05-17 15:25:30.747687: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929]      0
2018-05-17 15:25:30.748385: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0:   N
<strong><span style="color:#ff0000;">Device mapping: no known devices</span></strong>.
2018-05-17 15:25:30.750654: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:284] Device mapping:


Ignoring visible gpu device (device: 0, name: NVS 4200M, pci bus id: 0000:01:00.0, compute capability: 2.1) with Cuda compute capability 2.1. The minimum required Cuda capability is 3.0.
2018-05-17 15:25:30.746883: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-05-17 15:25:30.747687: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929]      0
2018-05-17 15:25:30.748385: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0:   N
Device mapping: no known devices.
2018-05-17 15:25:30.750654: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:284] Device mapping:
信息提示:电脑gpu设备cuda计算能力为2.1,但gpu加速需要的最小cuda计算能力为3.0。

搜索查看https://blog.csdn.net/wyx100/article/details/78473732?locationnum=7&fps=1?%3E这篇文章也说到,cuda计算能力要达到3.0以上,才能进行gpu加速。否则会自动调用cpu进行计算。

  • 8
    点赞
  • 36
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值