Got it. I thought it would automatically forward. But I'll reply to all. I
switched to an ATI graphics card, because it was much faster. I built
pyopencl and everything was fine.
When I run it, it gives an error when making an elementwise kernel:
"ValueError: unable to map dtype 'uint32'". I saw your previous post on the
PyCUDA list about doing "git submodule update", and I did that, and still
have the same problem. So this is on the most recent version of the code
from git.
Relevant code:
def init_gpu():
''' init_gpu(): initialize PyOpenCL, build all kernels
'''
global ctx,queue,cl_moving_average
if USE_GPU:
os.environ['CL_LOG_ERRORS'] = 'stdout'
#ctx = cl.create_some_context()
ctx = cl.Context(dev_type=cl.device_type.GPU)
print ctx
queue = cl.CommandQueue(ctx)
print queue
cl_moving_average = ElementwiseKernel(ctx,
"float *act, float *act_l",
"""
float delta = act[i]-act_l[i];
float change = 0.0;
if (delta >= 0.0)
change = %f*delta; // alpha_plus
else
change = %f*delta; // alpha_minus
act_l[i] = change + act_l[i];
"""%(alpha_plus,alpha_minus),
"moving_average") # FAILURE IS HERE
Stacktrace:
landerson@lewis-anderson-desktop:~/Dropbox/Cortex/code$ python
visual_cortex.py
--- Cortex.py ---
eta:0.1000, alpha+:0.6000, alpha-:0.0500
<pyopencl.Context at 0x973b148 on <pyopencl.Device 'ATI RV770' on 'AMD
Accelerated Parallel Processing' at 0x972ccd8>>
<pyopencl._cl.CommandQueue object at 0x95b725c>
Traceback (most recent call last):
File "visual_cortex.py", line 2, in <module>
import cortex as c, numpy as np, math, retina as r,os,time
File "/home/landerson/Dropbox/Cortex/code/cortex.py", line 1427, in
<module>
init_gpu()
File "/home/landerson/Dropbox/Cortex/code/cortex.py", line 1280, in
init_gpu
"moving_average")
File
"/usr/local/lib/python2.7/dist-packages/pyopencl-2011.2-py2.7-linux-i686.egg/pyopencl/elementwise.py",
line 126, in __init__
**kwargs)
File
"/usr/local/lib/python2.7/dist-packages/pyopencl-2011.2-py2.7-linux-i686.egg/pyopencl/elementwise.py",
line 91, in get_elwise_kernel_and_types
name=name, options=options, preamble=preamble, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/pyopencl-2011.2-py2.7-linux-i686.egg/pyopencl/elementwise.py",
line 61, in get_elwise_program
"arguments": ", ".join(arg.declarator() for arg in arguments),
File
"/usr/local/lib/python2.7/dist-packages/pyopencl-2011.2-py2.7-linux-i686.egg/pyopencl/elementwise.py",
line 61, in <genexpr>
"arguments": ", ".join(arg.declarator() for arg in arguments),
File
"/usr/local/lib/python2.7/dist-packages/pyopencl-2011.2-py2.7-linux-i686.egg/pyopencl/tools.py",
line 240, in declarator
return "%s %s" % (dtype_to_ctype(self.dtype), self.name)
File
"/usr/local/lib/python2.7/dist-packages/pyopencl-2011.2-py2.7-linux-i686.egg/pyopencl/compyte/dtypes.py",
line 107, in dtype_to_ctype
raise ValueError, "unable to map dtype '%s'" % dtype
ValueError: unable to map dtype 'uint32'
System specs:
Ubuntu 11.10 32-bit
ATI Radeon 4870
PyOpenCL
Any ideas? Thanks,
Lewis
On Fri, Dec 30, 2011 at 5:25 PM, Andreas Kloeckner
<[email protected]>wrote:
> On Fri, 30 Dec 2011 15:29:14 -0800, Lewis Anderson <[email protected]>
> wrote:
> > Okay. So I took a closer look at the build process. I am linking against
> > /usr/lib/nvidia-current/libOpenCL.so.1.0.0, which I have confirmed
> exists.
> > The problem is that it doesnt seem to get linked, because I get this
> > warning when I do "make":
> >
> > warning: no library file corresponding to
> > '/usr/lib/nvidia-current/libOpenCL.so.1.0.0' found (skipping)
> >
> > And then the final g++ command (in the make process) doesnt contain
> > libOpenCL.so, meaning it doesnt get linked which leads to the undefined
> > symbol failure.
> >
> >
> > So, the question now, is why does make fail to find libOpenCL.so? Any
> > ideas?
>
> You are not allowed to specify the "lib" and ".so.1.0.0" parts in
> configuring pyopencl. I.e. when you link using "-lOpenCL", the linker
> will look for "libOpenCL.so" (no version tag numbers), which it expects
> to be a symlink to the desired version. Also, the path goes in the
> separate "lib dir" entry. Also make sure to use Nvidia headers when
> linking against an Nvidia libOpenCL.
>
> HTH,
> Andreas
>
> PS: Please make sure to keep the list cc'd for archival. Thanks.
>
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl