Ubuntu14.04+cuda8.06+cudnn5.1+gtx1070的GPU环境配置中遇到的错误修改参考

 电脑配置: 系统Ubuntu14.04 cuda——8.0.61 NVIDIA驱动375.65 cudnn5.1  gpu:NVIDIA1070
报错:ImportError:libcudart.so.8.0:无法打开共享对象文件:没有这样的文件或目录
一个非常好用的教程:http://blog.csdn.net/u011197534/article/details/52965413按照这个教程走下去不会有问题,笔者试了不下十次,这个教程亲测有效,请不要忽略细节哦!
一般基于NVIDIA的GPU版本安照教程装好后都会报错,很多朋友都遇到!我遇到过两次一次是libcudnn.so.5的链接问题,这次是ImportError:libcudart.so.8.0:无法打开共享对象文件:没有这样的文件或目录,其实这两次的问题都一样。
先讲讲第一次问题的解决方法是:
sudo cp libcudnn.so libcudnn_copy.so
sudo cp libcudnn.so.5 libcudnn_copy.so.5 (这两条可以不要,但是在Ubuntu系统中做任何删除的事情,请注意备份哦!小心为了,笔者曾因为不小心重装过系统n次,血的教训,备份,备份,备份!)
sudo rm libcudnn.so
sudo rm libcudnn.so.5
sudo ln -s libcudnn.so.5.1.10 libcudnn.so.5
sudo ln -s libcudnn.so.5 libcudnn.so
建立软链接后,从新运行无问题:
2017-08-09 14:49:22.663563: 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.
2017-08-09 14:49:22.663578: 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.
2017-08-09 14:49:22.663581: 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.
2017-08-09 14:49:22.663584: 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.
2017-08-09 14:49:22.663586: 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.
2017-08-09 14:49:22.995677: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-08-09 14:49:22.995955: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: GeForce GTX 1070
major: 6 minor: 1 memoryClockRate (GHz) 1.7845
pciBusID 0000:01:00.0
Total memory: 7.92GiB
Free memory: 7.41GiB
2017-08-09 14:49:22.995965: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0
2017-08-09 14:49:22.995969: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   Y
2017-08-09 14:49:22.995974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0)
第二次问题的解决方法是:
其实他是配置问题,没有资源共享,因此运行如下指令:
sudo ldconfig /usr/local/cuda/lib(64) 需不需要加64根据自己安装的文件夹查看情况来确定!
但是运行这个命令后可能会报错,报错为:
/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.5 不是符号连接
因此这样又回到了第一个问题,所以我们只要用第一个问题的解决办法输入命令运行即可消除这个报错。
然后在输入: sudo ldconfig /usr/local/cuda/lib(64)
就不会报错了!
在用你的tensorflow去测试你的GPU版本的程序即可得到:
2017-08-09 14:49:22.663563: 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.
2017-08-09 14:49:22.663578: 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.
2017-08-09 14:49:22.663581: 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.
2017-08-09 14:49:22.663584: 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.
2017-08-09 14:49:22.663586: 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.
2017-08-09 14:49:22.995677: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:893] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-08-09 14:49:22.995955: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: GeForce GTX 1070
major: 6 minor: 1 memoryClockRate (GHz) 1.7845
pciBusID 0000:01:00.0
Total memory: 7.92GiB
Free memory: 7.41GiB
2017-08-09 14:49:22.995965: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0
2017-08-09 14:49:22.995969: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   Y
2017-08-09 14:49:22.995974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0)
此刻,恭喜你成功啦!好好开启你的GPU加速之路吧!加油!到这一步不容易!

猜你喜欢

转载自blog.csdn.net/jacktangyao/article/details/77417166
今日推荐