0

我的机器是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显示:

nvidia-smi 的输出

我也尝试使用./deviceQueryfrom进行测试,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,但没有任何变化。感谢您的帮助。

4

1 回答 1

0

您认为您的问题可能与计算能力有关吗?问题在此处描述。

您可以在运行 deviceQuery.exe 时检查它们。是一个关于在 CUDA 包的 Windows 分发版中在哪里可以找到它的线程。

于 2018-12-15T21:58:28.717 回答