2016-10-02 525 views
0

我的系統是Ubuntu的14.04上EC2:CUDA,CuDNN安裝,但Tensorflow不能使用GPU

nvidia-smi 
Sun Oct 2 13:35:28 2016  
+------------------------------------------------------+      
| NVIDIA-SMI 352.63  Driver Version: 352.63   |      
|-------------------------------+----------------------+----------------------+ 
| GPU Name  Persistence-M| Bus-Id  Disp.A | Volatile Uncorr. ECC | 
| Fan Temp Perf Pwr:Usage/Cap|   Memory-Usage | GPU-Util Compute M. | 
|===============================+======================+======================| 
| 0 GRID K520   Off | 0000:00:03.0  Off |     N/A | 
| N/A 37C P0 35W/125W |  11MiB/4095MiB |  0%  Default | 
+-------------------------------+----------------------+----------------------+ 

+-----------------------------------------------------------------------------+ 
| Processes:              GPU Memory | 
| GPU  PID Type Process name        Usage  | 
|=============================================================================| 
| No running processes found             | 
+-----------------------------------------------------------------------------+ 
[email protected]:~$ nvcc -V 
nvcc: NVIDIA (R) Cuda compiler driver 
Copyright (c) 2005-2015 NVIDIA Corporation 
Built on Tue_Aug_11_14:27:32_CDT_2015 
Cuda compilation tools, release 7.5, V7.5.17 

我安裝CUDA 7.5和5.1 CuDNN。

我在/ usr/local/local/lib64中包含正確的文件幷包含文件夾。

Tensorflow行給出什麼:

sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) 

>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) 
Device mapping: no known devices. 
I tensorflow/core/common_runtime/direct_session.cc:252] Device mapping: 

>>> 

請幫忙(感謝很多:))。

+0

@talonmies現有的解決方案是n沒有工作,我一次又一次檢查了路徑變量。 – John77

+0

您似乎有一個正在運行的CUDA安裝。因此,這個問題是一個張量配置問題,與CUDA編程無關。這就是我回收標籤的原因。 – talonmies

+0

@talonmies是的,多數民衆贊成我認爲,必須有一些問題在鏈接或路徑......就像那樣。你能提出一些我可以嘗試的建議嗎?謝謝。 – John77

回答

2

你是如何構建張量流的?

如果你是用bazel做的,你是否正確添加--config = cuda?

如果你使用pip安裝它,你是否正確地使用了gpu enable?

編輯:

您可以在這裏看到如何使用PIP安裝: https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#pip-installation

你需要採取一個二進制兼容GPU:

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below. 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl 

# Mac OS X, GPU enabled, Python 2.7: 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py2-none-any.whl 

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below. 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp34-cp34m-linux_x86_64.whl 

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below. 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp35-cp35m-linux_x86_64.whl 

# Mac OS X, GPU enabled, Python 3.4 or 3.5: 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py3-none-any.whl 

然後安裝tensorflow:

# Python 2 
$ sudo pip install --upgrade $TF_BINARY_URL 

# Python 3 
$ sudo pip3 install --upgrade $TF_BINARY_URL 
+1

gpu的pip選項是什麼?我沒有看到任何gpu命令alonside pip。請讓我知道是否有任何命令,我會將其標記爲答案。謝謝。 – John77

+0

我編輯了我的答案,你可以檢查它。我希望它有幫助。沒有真正的選擇只需要採取正確的二進制。 – rAyyy

相關問題