我试图在我的python代码中使用skcuda,但每当我想使用它时,它会引发以下异常:
Traceback (most recent call last):
File "/home/rohola/Projects/Python/wordnetwork/s.py", line 6, in <module>
from skcuda import cusolver
File "/home/rohola/anaconda3/lib/python3.4/site- packages/skcuda/cusolver.py", line 51, in <module>
raise OSError('cusolver library not found')
OSError: cusolver library not found
我刚刚尝试使用skcuda
from skcuda import cusolver
handle = cusolver.cusolverDnCreate()
我安装了pycuda,NVIDIA CUDA工具包。我的代码或依赖项出了什么问题?
答案 0 :(得分:3)
我终于找到了解决问题的方法。首先,我用
搜索了libcusolver.solocate libcusolver.so
然后在cusolver.py中更改了以下代码:
_libcusolver = ctypes.cdll.LoadLibrary(_libcusolver_libname)
为:
_libcusolver = ctypes.cdll.LoadLibrary("/usr/local/cuda-7.5/targets/x86_64-linux/lib/"+_libcusolver_libname)
现在出现以下代码:
from skcuda import cusolver
handle = cusolver.cusolverDnCreate()
没有任何错误。
更新:
如果您安装了cuda8.0或9.0,解决问题的最佳方法是在cusolver.py中找到这一行:
_libcusolver = ctypes.cdll.LoadLibrary(_libcusolver_libname)
并在其前添加此行: ctypes.CDLL(&#39; libgomp.so.1&#39;,mode = ctypes.RTLD_GLOBAL)
您必须确保已经安装了libgomp。
答案 1 :(得分:3)
APPL
让我
import ctypes
a = ctypes.cdll.LoadLibrary( "/usr/local/cuda-8.0/targets/x86_64-linux/lib/libcusolver.so" )
根据{{3}} ,这似乎是一个尚未解决的问题
虽然是7.5版本
OSError: /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcusolver.so: undefined symbol: GOMP_critical_end
似乎指出效果很好。作者的解决方案似乎也适用。