tensorflow: version 1.2 doesn't show CUDA and cuDNN information

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • TensorFlow installed from (source or binary): pip install tensorflow-gpu
  • TensorFlow version (use command below): (ā€˜v1.2.0-rc2-21-g12f033d’, ā€˜1.2.0’)
  • CUDA/cuDNN version: CUDA 8.0, cuDNN 5.1
  • GPU model and memory: GTX 970M, 3GB

Describe the problem

In previous version, after importing tensorflow like import tensorflow as tf following output will be shown:

>>> import tensorflow as tf;
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so.5.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so.7.5 locally

However, after I installed CUDA and cuDNN, and then installed Tensorflow v1.2, I found there is NO output for import tensorflow as tf in python. And I cannot check whether gpu successfully uses CUDA or cuDNN. I have checked my GPU as follows and GPU works well. I have tried the method in #566 to adjust TF_CPP_MIN_LOG_LEVEL, but it seems have no effect. I suggest it would be great to include CUDA and cuDNN info when importing tensorflow.

>>> import tensorflow as tf
>>> sess = tf.Session()
2017-06-20 00:24:38.111017: 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-06-20 00:24:38.111060: 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-06-20 00:24:38.111074: 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-06-20 00:24:38.111086: 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-06-20 00:24:38.111097: 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-06-20 00:24:38.215890: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] 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-06-20 00:24:38.216159: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties: 
name: GeForce GTX 970M
major: 5 minor: 2 memoryClockRate (GHz) 1.038
pciBusID 0000:01:00.0
Total memory: 2.95GiB
Free memory: 2.63GiB
2017-06-20 00:24:38.216174: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0 
2017-06-20 00:24:38.216180: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   Y 
2017-06-20 00:24:38.216191: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 970M, pci bus id: 0000:01:00.0)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (5 by maintainers)

Most upvoted comments

A quick hack that might be useful: python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib() + "/python/_pywrap_tensorflow_internal.so")' | xargs ldd

I think that a reasonable approach would be to expose APIs to get versions and if these libraries were loaded or not, it would be the cleaner option here in my opinion, instead of just dumping log messages. If someone wants to print something, he can get all the info from API.

A quick hack that might be useful: python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib() + "/python/_pywrap_tensorflow_internal.so")' | xargs ldd

Thanks a lot! Unfortunately, (as with many hacks) this stops working for TF 2.x. I have not found another hack yet; all .so I found in the TF libs directory (which are also fewer than with 1.13.1) do not link against libcudnn.so; maybe it is now dynamically dlopened.