我要接受GPU训练吗?

时间:2019-02-12 17:57:50

标签: python-3.x tensorflow keras gpu

我正在训练一个以keras和tensorflow为后端的神经模型。日志文件以以下消息开头:

nohup: ignoring input
2019-02-12 17:44:29.414526: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-02-12 17:44:30.191565: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties: 
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:65:00.0
totalMemory: 7.93GiB freeMemory: 7.81GiB
2019-02-12 17:44:30.191601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0
2019-02-12 17:44:30.409790: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-02-12 17:44:30.409828: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971]      0 
2019-02-12 17:44:30.409834: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0:   N 
2019-02-12 17:44:30.410015: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7535 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:65:00.0, compute capability: 6.1)

这是否意味着对gpu进行训练?

我会说是的,但是当我执行nvtop时,我看到所有的gpu内存都被使用,而gpu的计算能力却被使用了0%(请参见下面的黄色屏幕截图):

see screenshot

此外,当我在命令行中输入htop时,我看到一个CPU已被完全使用(请参见下面的黑色屏幕截图)

see screenshot

为什么使用gpu内存而不使用gpu容量计算来使用cpu容量计算?

1 个答案:

答案 0 :(得分:0)

我认为您已经使用CUDA支持编译了(或已安装了已编译的软件包)张量流,但不支持所有适用于您的CPU的指令(您的CPU支持张量流可以使用的AVX2,AVX512F和FMA指令)。

这意味着,tensorflow可以正常工作(具有完整的GPU支持),但是您不能完全使用处理器。

尝试通过以下示例比较时间(GPU与CPU):https://stackoverflow.com/a/54661896/10418812