OSX 10.9.2 + CUDA 5.5 + EDP 2.7.3 下的 PyCUDA 示例错误

-1 投票
1 回答
570 浏览
提问于 2025-04-18 02:40

我遇到了一个pycuda运行时错误,这个错误和这个链接中的情况很相似:https://stackoverflow.com/questions/20078191/opencv-2-4-7-mac-osx-10-9-python-2-7-6-cuda-5-5。执行示例时出现的错误是:

cordelia:examples xxx$ python demo.py

Traceback (most recent call last):
  File "demo.py", line 3, in <module>
    import pycuda.driver as cuda
  File "/Users/xxx/canopy/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/driver.py", line 2, in <module>
    from pycuda._driver import *

ImportError: dlopen(/Users/xxx/canopy/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/_driver.so, 2): Library not loaded: @rpath/libcurand.dylib
  Referenced from: /Users/xxx/canopy/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/_driver.so
  Reason: Incompatible library version: _driver.so requires version 1.1.0 or later, but libcurand.dylib provides version 0.0.0

这个错误在命令行上又出现了,导致我的程序现在无法继续运行:

Enthought Canopy Python 2.7.3 | 64-bit | (default, Aug  8 2013, 05:37:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pycuda._driver

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/xxx/canopy/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/_driver.so, 2): Library not loaded: @rpath/libcurand.dylib
  Referenced from: /Users/xxx/canopy/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/_driver.so
  Reason: Incompatible library version: _driver.so requires version 1.1.0 or later, but libcurand.dylib provides version 0.0.0

有什么建议吗?

谢谢!

1 个回答

1

实际上,http://wiki.tiker.net/PyCuda/Installation/Mac#Step_3:_Install_PyCUDA 上的步骤是有效的 - 真是松了一口气!

撰写回答