我是张力流初学者。当我运行test.py.有一个错误:
2018-05-13 10:00:03.012495: 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-05-13 10:00:03.312772: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.911
pciBusID: 0000:05:00.0
totalMemory: 11.90GiB freeMemory: 11.58GiB
2018-05-13 10:00:03.591350: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 1 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.911
pciBusID: 0000:06:00.0
totalMemory: 11.90GiB freeMemory: 11.74GiB
2018-05-13 10:00:03.862648: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 2 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.911
pciBusID: 0000:09:00.0
totalMemory: 11.90GiB freeMemory: 11.74GiB
2018-05-13 10:00:04.117984: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 3 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.911
pciBusID: 0000:0a:00.0
totalMemory: 11.90GiB freeMemory: 11.74GiB
2018-05-13 10:00:04.123222: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1423] Adding visible gpu devices: 0, 1, 2, 3
2018-05-13 10:00:04.123350: 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 "test.py", line 5, in <module>
sess = tf.Session()
File "/home/zhe/anaconda3/envs/tf_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1509, in __init__
super(Session, self).__init__(target, graph, config=config)
File "/home/zhe/anaconda3/envs/tf_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 638, in __init__
self._session = tf_session.TF_NewDeprecatedSession(opts, status)
File "/home/zhe/anaconda3/envs/tf_env/lib/python3.6/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.
tensorflow-gpu version 1.7.0
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61
test.py:
import tensorflow as tf
import os
#os.environ["CUDA_VISIBLE_DEVICES"]="3"
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
我的实验室同事没有这个问题。我试图使用注释的代码行,但它不起作用,并且它是相同的错误。
感谢您的帮助!
答案 0 :(得分:1)
问题在错误消息的这一行中指定:
内部:cudaGetDevice()失败。状态:CUDA驱动程序版本不足以支持CUDA运行时版本
您需要更新CUDA驱动程序。或者,只需reinstall the whole CUDA toolkit。