2017-02-23 86 views
0

的最新版本的Tensorflow(1.0)中安裝CUDA 8.0我已經升級到Tensorflow 1.0版,並安裝了CUDA 8.0 cudnn 5.1版本和nvidia驅動程序最新375.39。我的NVIDIA硬件是Amazon Web Services上使用p2.xlarge實例(一種特斯拉K-80)的硬件。我的操作系統是Linux 64位。如何在AWS p2.xlarge實例,AMI ami-edb11e8d和nvidia驅動程序最新版本(375.39)

每次都遇到我用命令的時間一個錯誤信息:tf.Session()

[[email protected] CUDA]$ python 
Python 2.7.12 (default, Sep 1 2016, 22:14:00) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import tensorflow as tf 
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally 
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally 
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally 
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally 
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally 
>>> sess = tf.Session() 
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. 
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. 
E tensorflow/stream_executor/cuda/cuda_driver.cc:509] failed call to cuInit: CUDA_ERROR_NO_DEVICE 
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: ip-172-31-7-96 
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: ip-172-31-7-96 
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: Invalid argument: expected %d.%d or %d.%d.%d form for driver version; got "1" 
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:363] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 375.39 Tue Jan 31 20:47:00 PST 2017 
GCC version: gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) 
""" 
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 375.39.0 

我完全茫然不知如何解決這個問題。 我已經嘗試過不同版本的Nvidia驅動程序和CUDA,但仍然無法正常工作。

任何提示將不勝感激。

+1

也許是你的GPU驅動程序安裝不正確。運行'nvidia-smi'的結果是什麼?您是否按照[cuda linux安裝指南](http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#abstract)中所述執行了CUDA安裝的任何驗證? –

+0

謝謝您的及時答覆。 nvidia-smi工作,我沒有按照網站上描述的「驗證」。 我決定在Redhat 7.3系統上從頭開始。 它起初工作,所以不需要進一步的援助。 – basuam

回答

0

卸載驅動程序& cuda,然後按照official guide重新安裝。

運行deviceQuery來檢查設備是否安裝正確。

+0

非常感謝您的回覆。正如你所建議的那樣,我從頭開始安裝所有東西后運行了deviceQuery。我使用RedHat 7.3創建了另一個實例,並花費了一些時間更新所有軟件包。最後,它工作得很好。 – basuam

+0

很高興現在正在工作! – tblue

2

您需要安裝NVIDIA驅動程序並運行CUDA 8.0安裝程序。

# Requirements 
# - NVIDIA Driver - NVIDIA-Linux-x86_64-375.39.run - http://www.nvidia.fr/Download/index.aspx 
# - CUDA runfile (local) - cuda_8.0.61_375.26_linux.run - https://developer.nvidia.com/cuda-downloads 
# - cudnn-8.0-linux-x64-v5.0-ga.tgz 

sudo apt update -y && sudo apt upgrade -y 
sudo apt install build-essential linux-image-extra-`uname -r` -y 

chmod +x NVIDIA-Linux-x86_64-375.39.run 
sudo ./NVIDIA-Linux-x86_64-375.39.run 

chmod +x cuda_8.0.61_375.26_linux.run 
./cuda_8.0.61_375.26_linux.run --extract=`pwd`/extracts 
sudo ./extracts/cuda-linux64-rel-8.0.61-21551265.run 

echo -e "export CUDA_HOME=/usr/local/cuda\nexport PATH=\$PATH:\$CUDA_HOME/bin\nexport LD_LIBRARY_PATH=\$LD_LINKER_PATH:\$CUDA_HOME/lib64" >> ~/.bashrc 
source .bashrc 

tar xf cudnn-8.0-linux-x64-v5.0-ga.tgz 
cd cuda 
sudo cp lib64/* /usr/local/cuda/lib64/ 
sudo cp include/cudnn.h /usr/local/cuda/include/ 
+0

我以爲cudnn 8不支持張量流 – Goddard

相關問題