【发布时间】:2017-06-12 22:23:28
【问题描述】:
我有一台配备 GeForce 940 MX 的笔记本电脑。我想在 GPU 上启动并运行 Tensorflow。我从他们的教程页面安装了所有东西,现在当我导入 Tensorflow 时,我得到了
>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:119] Couldn't open CUDA library libcuda.so.1. LD_LIBRARY_PATH:
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: workLaptop
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:1092] LD_LIBRARY_PATH:
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1093] 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 locally
>>>
之后我认为它只是切换到在 cpu 上运行。
编辑:在我对所有东西都进行了核对之后,从头开始。现在我明白了:
>>> import tensorflow
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so 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: workLaptop
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:1092] LD_LIBRARY_PATH: :/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1093] 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 locally
【问题讨论】:
-
你真的安装了NVIDIA驱动吗? libcuda 是驱动程序的一部分,而不是 CUDA 工具包
-
使用
find /usr/ -name 'libcuda.so.1'定位文件是否在我假设您添加到LD_LIBRARY_PATH的标准cuda 库目录中?如果没有,只需在 cuda lib 目录中创建一个指向它的符号链接。 -
/usr/lib/x86_64-linux-gnu/libcuda.so.1 和 /usr/lib/i386-linux-gnu/libcuda.so.1。 cuda lib 目录到底在哪里?
-
我再重复一遍``could not open driver version path for reading: /proc/driver/nvidia/version" 表示您在运行 Tensorflow 时没有功能正常的 CUDA 驱动程序
-
这看起来不像是 Tensorflow 问题;相反,您似乎没有正确安装和运行 NVidia 驱动程序。一项测试:尝试运行“nvidia-smi”。如果驱动程序安装正确,它应该打印可用 GPU 的列表。
标签: cuda tensorflow nvidia