我已經安裝了pyopencl。當我嘗試:pyopencl errror:undefined symbol:clCreateSubDevices
python /home/a/pyopencl/examples/benchmark.py
然後我有一個錯誤:
Traceback (most recent call last):
File "/home/a/pyopencl/examples/benchmark.py", line 6, in <module>
import pyopencl as cl
File "/usr/local/lib/python2.7/dist-packages/pyopencl-2013.3-py2.7-linux-
x86_64.egg/pyopencl/__init__.py", line 28, in <module>
import pyopencl._cl as _cl
ImportError: /usr/local/lib/python2.7/dist-packages/pyopencl-2013.3-py2.7-linux-
x86_64.egg/pyopencl/_cl.so: undefined symbol: clCreateSubDevices
我該如何解決呢?
TIA
Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
[GCC 4.8.1] on linux2
Linux zalman 3.11.0-15-generiC#23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux
+------------------------------------------------------+ | NVIDIA-SMI 4.304.88 Driver Version: 304.88 | |-------------------------------+----------------------+----------------------+ | GPU Name | Bus-Id Disp. | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 770 | 0000:01:00.0 N/A | N/A | | 25% 29C N/A N/A/N/A | 7% 149MB/2047MB | N/A Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Compute processes: GPU Memory | | GPU PID Process name Usage | |=============================================================================| | 0 Not Supported | +-----------------------------------------------------------------------------+
ls /etc/OpenCL/vendors
nvidia.icd
locate libOpenCL.so
/etc/alternatives/x86_64-linux-gnu_libOpenCL.so
/etc/alternatives/x86_64-linux-gnu_libOpenCL.so_lib32
/usr/lib/libOpenCL.so
/usr/lib/x86_64-linux-gnu/libOpenCL.so
/usr/lib32/libOpenCL.so
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Fri_Sep_21_17:28:58_PDT_2012
Cuda compilation tools, release 5.0, V0.2.1221
如果有人絆倒在這一點,也想知道在哪裏可以找到siteconf.py。您必須從github獲得pyopencl源代碼(clone [pyopencl](https://github.com/pyopencl/pyopencl)),然後在資源庫中運行'python configure.py'並創建一個'siteconf.py' 。編輯完成後,您可以運行'pip install .'來安裝它。 'ImportError'是由於過時版本爲6,並且可以通過更新它'pip install --upgrade six'來修復。 – swenzel