简体   繁体   中英

GPU tensorflow install issue

I am a new user to Ubuntu, and I spent more than a week trying to install gpu tensorflow. I tried to follow the tutorials from the website and blogs. But whenever I import tensorflow in my python console. It always shows:

import tensorflow
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5.1.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:119] Couldn't open CUDA   library libcuda.so.1. LD_LIBRARY_PATH:   :/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: HanGuo
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: Not found: was unable to find libcuda.so DSO loaded into this program
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: Permission denied: could not open driver version path for reading: /proc/driver/nvidia/version
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1091]  LD_LIBRARY_PATH: :/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1092] failed to find libcuda.so on this system: Failed precondition: could not dlopen DSO: libcuda.so.1; dlerror: libnvidia-fatbinaryloader.so.367.57: cannot open shared object file: No such file or directory
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so.8.0 locally

I tried to search the answer all over google, but no real solution came up yet.Can anyone help me out?

Based on the output for $ ls /usr/local/cuda , you have installed it successfully.

Now, what is missing there is the PATH definition so that TensorFlow can find where it is.

1) Open your .bashrc file: gedit ~/.bashrc

2) Append the following two lines to the end of the file:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/include"  
export CUDA_HOME=/usr/local/cuda

3) Once you save and close the text file you can return to your original terminal and type this command to reload your .bashrc file:

source ~/.bashrc

Although the third part is supposed to take care of that, if you want to be 100% sure that it will work restart the computer.

Now, for TensorFlow, remember to set the CUDA path as /usr/local/cuda and the version to 8.0.

安装libcuda5-dev可能会解决您的问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM