0

I recently installed Nvidia driver-375.39, Cuda-8.0 & CUDNN-5.1 with much headache and difficulties. After this i installed Tensorflow, since thats what i wanted to do since beginning.
I took help from sources like:
http://queirozf.com/entries/installing-cuda-tk-and-tensorflow-on-a-clean-ubuntu-16-04-install
https://pythonprogramming.net/how-to-cuda-gpu-tensorflow-deep-learning-tutorial/

I had installed tensorflow with virtualenv on ubuntu 16.04 running Nvidia Geforce 940MX.
Though I was not able to run Cuda samples (which came with the cuda_8.0.61_375.26_linux.run file itself), giving me few errors, like these:

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/bin/ld: cannot find -lglut
collect2: error: ld returned 1 exit status
Makefile:267: recipe for target 'simpleGL' failed
make[1]: *** [simpleGL] Error 1
make[1]: Leaving directory '/home/jayant/NVIDIA_CUDA-8.0_Samples/2_Graphics/simpleGL'
Makefile:52: recipe for target '2_Graphics/simpleGL/Makefile.ph_build' failed
make: *** [2_Graphics/simpleGL/Makefile.ph_build] Error 2

still I installed tensorflow and now I am in doubt whether it is using Cuda or not.
My doubt arises when I try to import tensorflow, like so:

>>>import tensorflow as tf
>>>hello = tf.constant('Hello, TensorFlow!')
>>>sess = tf.Session()
>>>print(sess.run(hello))

I dont get these messages (as mentioned in many blogs) :

I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally

rather, I get this:

2017-05-01 00:08:12.079557: W 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-05-01 00:08:12.079584: W 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-05-01 00:08:12.079588: W 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-05-01 00:08:12.079591: W 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-05-01 00:08:12.079595: W 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-05-01 00:08:12.322193: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-05-01 00:08:12.322566: I tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0 with properties: 
name: GeForce 940MX
major: 5 minor: 0 memoryClockRate (GHz) 1.189
pciBusID 0000:01:00.0
Total memory: 3.95GiB
Free memory: 3.93GiB
2017-05-01 00:08:12.322580: I tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0 
2017-05-01 00:08:12.322584: I tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0:   Y 
2017-05-01 00:08:12.322593: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0)
Hello, TensorFlow!

Can someone please tell me if my Cuda was installed correctly and tensorflow is running correctly with Cuda?
Or what changes do I need to make changes in order to suppress these warnings, run the cuda samples with success and get those tensorflow messages regarding cuda open libraries?
PS: please let me know if any other info is needed.

0

First ensure you are using the Nvidia hardware and driver. Check in your UEFI settings (formerly known as BIOS) for any video hardware selection. Probably select the "discrete" over any hybrid or optimized until you get things working. Then use the Ubuntu supplied Nvidia drivers from the "Software Updater"/Settings button/Additional drivers tab. Select the "tested" Nvidia driver (probably the latest one). Be aware of some issues with drivers after 367 and before 381 causing some screen artifacts after sleep. When the Nvidia driver you select is the driver in use, logout/in or reboot and check that the Nvidia driver shows in the lshw -C video output, or just run the Nvidia Settings from Dash to check. Then proceed with the CUDA installation.


Some of the CUDA samples need additional libraries. The one you picked needs libglut, so install the freeglut3 package. Definietly get the samples working before trying anything more complicated. Many of the samples allow a "-cpu" argument to show what slowdown you get when using the CPU instead of the GPU. Maybe tensorflow has something similar.

Did you check that the libraries mentioned in the other blogs exist on your system? If not, they may need to be installed separately, but again, maybe tensorflow does not need them for every function it can perform.

1
  • I think I found the problem... Nvidia is not working... when i do lspci -vnn | grep -i VGA -A 12, it shows: Kernel driver in use: i915 and this command glxinfo | grep OpenGL | grep renderer gives me this: OpenGL renderer string: Mesa DRI Intel(R) Kabylake GT2 . clearly Nvidia is not active. Do you know how can i make it my kernel driver, instead of my default Intel Graphics driver? – jAYANT YADAV May 1 '17 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.