首页 > 解决方案 > Theano 找不到 libcuda.so

问题描述

我已经使用 miniconda 安装了 theano:

conda install theano

这个安装

 libgpuarray: 0.7.6-h14c3975_0
 mkl-service: 1.1.2-py27hb2d42c5_4
 pygpu:       0.7.6-py27h3010b51_0
 theano:      1.0.2-py27h6bb024c_0

然后我运行我的程序并收到消息:

 Could not initialize pygpu, support disable
 [...]
 File "pygpu/gpuarray.pyx", line 658, in pygpu.gpuarray.init
 File "pygpu/gpuarray.pyx", line 587, in pygpu.gpuarray.pygpu_init
 GpuArrayException: Could not load "libcuda.so": libcuda.so: cannot open shared object file: No such file or directory

所以它找不到libcuda。如果我这样做,我会收到类似的消息

 python
 import pygpu
 pygpu.test()

我在 /opt/cuda 中有一个 cuda 安装。libcuda.so 在 /opt/cuda/lib64 下。

我尝试将 /opt/cuda/lib64 添加到我的 LD_LIBRARY_PATH 但没有成功。我还尝试了多个以前版本的 theano 和 pygpu。它还在我脸上笑。在没有成功的情况下来回走了几个小时。

标签: pythongputheanotheano-cuda

解决方案


推荐阅读