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

编程知识 更新时间:2023-05-02 03:30:00

本文转载自:https://blog.csdn/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/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: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: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: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:929]      0
2018-05-17 15:25:30.748385: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device: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: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: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:929]      0
2018-05-17 15:25:30.748385: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device: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:284] Device mapping:
信息提示:电脑gpu设备cuda计算能力为2.1,但gpu加速需要的最小cuda计算能力为3.0。

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

更多推荐

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

本文发布于:2023-04-25 13:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/c1d2a29f454dacc849a3d29a4c891c78.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:原因   占用率   windows   CMD   GPU

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 103240文章数
  • 26179阅读数
  • 0评论数