On Thu, 22 Nov 2012 16:15:54 -0500
Andreas Kloeckner <[email protected]> wrote:


> > try: queue=pyopencl.CommandQueue(ctx)
> > except RuntimeError: print("Sorry, switched off")
> 
> What package printed this error message? Doesn't seem to be PyOpenCL?

Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) 
Type "copyright", "credits" or "license" for more information.

IPython 0.14.dev -- An enhanced Interactive Python.
?         -> 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

In [2]: ctx=pyopencl.create_some_context()
Choose device(s):
[0] <pyopencl.Device 'Intel(R) Core(TM)2 Duo CPU     T9550  @ 2.66GHz' on 
'Apple' at 0xffffffff>
[1] <pyopencl.Device 'GeForce 9400M' on 'Apple' at 0x1022600>
[2] <pyopencl.Device 'GeForce 9600M GT' on 'Apple' at 0x2022600>
Choice, comma-separated [0]:2
Set the environment variable PYOPENCL_CTX='2' to avoid being asked again.

In [3]: queue=pyopencl.CommandQueue(ctx)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-3-d651b6b9e540> in <module>()
----> 1 queue=pyopencl.CommandQueue(ctx)

RuntimeError: CommandQueue failed: device not available

> 
> > Second bug: "pyopencl.RuntimeError: clBuildProgram failed: build program 
> > failure"
> > Solution: options to build the kernel need to be stripped under MacOSX !!!
> 
> Was this for code built by PyOpenCL, or from within your application? In
> any case, the CL standard documents a few options that are required to
> be cross-vendor. Everything else is likely vendor-specific.

I was simply doing :
kernel_src = """__kernel void ... """
compile_options = " -D BLOCK_SIZE=%i  -D BINS=%i "%(BLOCK_SIZE,bins)
prg = pyopencl.Program(ctx, kernel_src).build(options=compile_options)

Stripping options is not difficult, finding it was more tricky :/

> > Third bug: "LogicError: clEnqueueNDRangeKernel failed: invalid work group 
> > size"
> > When running on CPU, I have the fealing that the only valid workgroup size 
> > is "1", even when 
> > device.max_work_group_size advertizes 1024 !!!
> 
> This is known:
> 
> http://wiki.tiker.net/OpenCLOddities

I wish this page was better referenced by google  !!!
Thanks Andrea for summarizing such oddities.

-- 
Jérôme Kieffer
On-Line Data analysis / Software Group 
ISDD / ESRF
tel +33 476 882 445

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to