我的机器是Ubuntu 18.04.1 LTS,已经成功安装了 CUDA。的输出$nvcc --version
是
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176
我有两个 Tesla K80 的 GPU,命令nvidia-smi显示:
我也尝试使用./deviceQuery
from进行测试,NVIDIA_CUDA-9.0_Samples
其输出如下:
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 2 CUDA Capable device(s)`
...
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.0, CUDA Runtime Version = 9.0, NumDevs = 2
Result = PASS
但是,一旦我version 1.11.0
从 pip 安装了 Tensorflow GPU,我就无法打开 Tensorflow 会话。
>>> import tensorflow as tf
>>> sess = tf.Session()
它输出:
2018-11-15 00:13:46.593039: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/quoctin.phan/tools/anaconda/envs/tensorflow_1.11/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1511, in __init__
super(Session, self).__init__(target, graph, config=config)
File "/home/quoctin.phan/tools/anaconda/envs/tensorflow_1.11/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 634, in __init__
self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
tensorflow.python.framework.errors_impl.InternalError: failed initializing StreamExecutor for CUDA device ordinal 0: Internal: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_NOT_SUPPORTED: operation not supported
我尝试重新安装 Tensorflow 1.12.0,但没有任何变化。感谢您的帮助。