0

So I installed Tensorflow for Python 3.5 on my Laptop, which is a Windows machine hosting a Nvidia Geforce Pascal GPU. I also installed CUDA and downloaded cuDNN and added it to the PATH variables. My tensorflow code does compile, but if I monitor my GPU, I can see, it does not compute anything, instead my CPU is doing the whole work. I also get an output in console which confirms, that the GPU was detected:

2017-06-02 15:22:22.140283: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.140600: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.140899: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.141108: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.141321: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.141582: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.141803: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.142130: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. 2017-06-02 15:22:22.561687: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:887] Found device 0 with properties: name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate (GHz) 1.645 pciBusID 0000:01:00.0 Total memory: 8.00GiB Free memory: 6.65GiB 2017-06-02 15:22:22.561949: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:908] DMA: 0 2017-06-02 15:22:22.562073: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:918] 0: Y 2017-06-02 15:22:22.562435: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0)

Can anybody explain that to me?

EDIT: Okay, it seems like, I didn't watch the usage enaugh accurate. The GPU is actually used, but only in small peaks. most of the work is still done by the CPU. I'm running a CNN with 3 convolutional and 2 fully connected layer. But that can't be right?![GPU Usage]1

talonmies
  • 70,661
  • 34
  • 192
  • 269
Baffel
  • 63
  • 6

1 Answers1

1

In order to improve performance, I suggest to take a look at this tensorflow performance guide.

In particular I have experimented a sensible speed up by locating the preprocessing on the cpu side with the command with tf.device('/cpu:0'):

Please notice that the speed-up factor is architecture-dependant as reported in this article

ale-6
  • 365
  • 5
  • 14