2
votes

The command

conda install -c anaconda tensorflow-gpu 

is now installing Tensorflow-gpu 1.7 by default, which is always throwing an error of "Cannot create session"

Here is the traceback in a screenshot :

import tensorflow as tf
tf.Session()

2018-04-26 16:34:37.971115: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2018-04-26 16:34:38.588037: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties: name: Tesla M40 24GB major: 5 minor: 2 memoryClockRate(GHz): 1.112 pciBusID: 0000:02:00.0 totalMemory: 22.40GiB freeMemory: 10.62GiB 2018-04-26 16:34:38.588119: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1423] Adding visible gpu devices: 0 2018-04-26 16:34:38.604343: E tensorflow/core/common_runtime/direct_session.cc:167] Internal: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version Traceback (most recent call last): File "", line 1, in File "/home/16mcmi17/anaconda3/envs/myEnv/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1509, in init super(Session, self).init(target, graph, config=config) File "/home/16mcmi17/anaconda3/envs/myEnv/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 638, in init self._session = tf_session.TF_NewDeprecatedSession(opts, status) File "/home/16mcmi17/anaconda3/envs/myEnv/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InternalError: Failed to create session.

Earlier tensorflow-gpu 1.4 was working fine.

I want to know whether the problem is with the version or something else? Also, How can I install tensorflow-gpu with conda (not pip) with a specific version?

1

1 Answers

2
votes

According to this part of your trace:

Internal: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

It seems like you are not meeting the CUDA version requirement. Tensorflow 1.4 required CUDA 8.0+, while Tensorflow 1.7 needs CUDA 9.0+.

Try upgrading your CUDA to 9.0 (CUDA installation guide for Linux).