GPU tensorflow 安装问题 [英] GPU tensorflow install issue

查看:38
本文介绍了GPU tensorflow 安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Ubuntu 的新用户,我花了一个多星期的时间尝试安装 gpu tensorflow.我尝试按照网站和博客中的教程进行操作.但是每当我在 python 控制台中导入 tensorflow 时.它总是显示:

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?

推荐答案

根据 $ ls/usr/local/cuda 的输出,你已经安装成功.

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

现在,缺少的是 PATH 定义,以便 TensorFlow 可以找到它的位置.

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

1) 打开你的 .bashrc 文件:gedit ~/.bashrc

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

2) 在文件末尾追加以下两行:

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) 保存并关闭文本文件后,您可以返回原始终端并键入以下命令以重新加载 .bashrc 文件:

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

虽然第三部分应该解决这个问题,但如果您想 100% 确定它会工作,请重新启动计算机.

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.

现在,对于 TensorFlow,记得将 CUDA 路径设置为 /usr/local/cuda,并将版本设置为 8.0.

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

这篇关于GPU tensorflow 安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆