Hello,
I have tried to compile a simple opencl program using pyopencl.
---
__kernel void Pricing(__global float* simResults,
__global const unsigned int *d_MT,
__global const unsigned int *para,
__global const float *simPara,
__global const float *dt
)
{ ... }
---
Everything works fine for AMD (CPU) but for NVIDIA I get a compilation
error:
---
Choose platform:
[0] <pyopencl.Platform 'NVIDIA CUDA' at 0x2ea9450>
[1] <pyopencl.Platform 'AMD Accelerated Parallel Processing' at
0x7f2ef9485de0>
Choice [0]:
Set the environment variable PYOPENCL_CTX='' to avoid being asked again.
Workers 2
self.CLProgram.Pricing(self.queue, (16384,), (2,),
self.parameterList[0], self.parameterList[1], self.parameterList[2],
self.parameterList[3], self.parameterList[4])
Traceback (most recent call last):
File "test_ProductPricing.py", line 171, in <module>
res = instance.executeProgram(CODE, 'Pricing', para,
(data_points,) , (workers,) )
File "/work/pythonopencl/opencl/clinterface.py", line 82, in
executeProgram
exec_event = eval(command)
File "<string>", line 1, in <module>
File
"/usr/lib64/python2.7/site-packages/pyopencl-2014.1-py2.7-linux-x86_64.egg/pyopencl/__init__.py", line 523, in kernel_call
global_offset, wait_for, g_times_l=g_times_l)
pyopencl.LogicError: clEnqueueNDRangeKernel failed: invalid value
---
I have assumed that OpenCL programs are flexible in the sense that I can
execute them on different hardware platforms (in general it works for
all examples provided in the pyopencl package).
Does anybody have an idea why it is not working for cuda although it
works for AMD?
Best regards,
Lars
Gavin,
Gavin Coombes <gav(a)darkseas.org> writes:
> Seems to be having the the same dynamic lookup issue still.
> I removed the build directory, installed as you suggested, ain a new shell...
Please make sure to keep the list cc'd.
Try
CC=g++ LDSHARED="gcc -bundle -undefined dynamic_lookup" \
BLDSHARED="gcc -bundle -undefined dynamic_lookup" python setup.py \
install
as before.
Andreas
HI all,
I have used PyOpenCl successfully on Windows and Linux platforms but thought to take the Iris Pro graphics for a drive on a new MBP.
However, I have had problems getting started. Hope someone can help me find a solution, or suggest some better diagnostics to lay bare the issue.
I’m using
* Yosemite OS X 10.10
* Xcode 6.1
* Anaconda Python
* Numpy 1.9
* gcc 4.2.1
I have followed the Mavericks installation guide at http://wiki.tiker.net/PyOpenCL/Installation/Mac <http://wiki.tiker.net/PyOpenCL/Installation/Mac>, with a few warnings that didn’t seem too serious, mainly deprecated numpy warnings and string to char * warnings.
There was a ctags error on make:
➜ pyopencl git:(master) make
ctags -R src || true
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file …
And the main error was on the import of pyopencl.
➜ cl ipython
Python 2.7.8 |Anaconda 2.1.0 (x86_64)| (default, Aug 21 2014, 15:21:46)
Type "copyright", "credits" or "license" for more information.
IPython 2.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import pyopencl
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-63105a952239> in <module>()
----> 1 import pyopencl
//anaconda/lib/python2.7/site-packages/pyopencl-2014.1-py2.7-macosx-10.5-x86_64.egg/pyopencl/__init__.py in <module>()
28
29 try:
---> 30 import pyopencl._cl as _cl
31 except ImportError:
32 import os
ImportError: dlopen(//anaconda/lib/python2.7/site-packages/pyopencl-2014.1-py2.7-macosx-10.5-x86_64.egg/pyopencl/_cl.so, 2): Symbol not found: __ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE
Referenced from: //anaconda/lib/python2.7/site-packages/pyopencl-2014.1-py2.7-macosx-10.5-x86_64.egg/pyopencl/_cl.so
Expected in: dynamic lookup
The full install log is attached.
Thanks for any help, Gavin.