Dear All,
After several days I did a certain progress, but still can't make my
Macports installed python work with pyopencl on Snow Leopard. And I'm going
crazy...
First I run ./configure.py with certain options specified in one ticket:
./configure.py --boost-inc-dir=/opt/local/include
--boost-inc-dir=/usr/local/include --boost-lib-dir=/opt/local/lib
--boost-lib-dir=/usr/local/lib --boost-python-libname=boost_python
--boost-thread-libname=boost_thread --cl-libname=''
Creating
/Users/shurik/Downloads/pyopencl-0.91.4/setuptools-0.6c9-py2.6.egg-info
Creating /Users/shurik/Downloads/pyopencl-0.91.4/setuptools.pth
Then I run the python setup.py install. Here what I've got:
alexandr-kuzmins-macbook:pyopencl-0.91.4 shurik$ sudo
/opt/local/bin/python2.6 setup.py install
Password:
Scanning installed packages
Setuptools installation detected at /Users/shurik/Downloads/pyopencl-0.91.4
Non-egg installation
Removing elements out of the way...
Already patched.
/Users/shurik/Downloads/pyopencl-0.91.4/setuptools-0.6c9-py2.6.egg-info
already patched.
Downloading
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.4.tar.gz
Extracting in /tmp/tmpjhxrOM
Now working in /tmp/tmpjhxrOM/distribute-0.6.4
Building a Distribute egg in /Users/shurik/Downloads/pyopencl-0.91.4
/Users/shurik/Downloads/pyopencl-0.91.4/setuptools-0.6c9-py2.6.egg-info
already exists
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:267:
UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-i386-2.6
creating build/lib.macosx-10.6-i386-2.6/pyopencl
copying pyopencl/__init__.py -> build/lib.macosx-10.6-i386-2.6/pyopencl
copying pyopencl/version.py -> build/lib.macosx-10.6-i386-2.6/pyopencl
running build_ext
building '_cl' extension
creating build/temp.macosx-10.6-i386-2.6
creating build/temp.macosx-10.6-i386-2.6/src
creating build/temp.macosx-10.6-i386-2.6/src/wrapper
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -O3
-DNDEBUG -Isrc/cpp -I/usr/local/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
-c src/wrapper/wrap_cl.cpp -o
build/temp.macosx-10.6-i386-2.6/src/wrapper/wrap_cl.o -arch i386 -arch
x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk
In file included from src/wrapper/wrap_cl.cpp:1:
src/wrapper/wrap_cl.hpp: In function ‘pyopencl::event*
pyopencl::enqueue_nd_range_kernel(pyopencl::command_queue&,
pyopencl::kernel&, boost::python::api::object, boost::python::api::object,
boost::python::api::object, boost::python::api::object)’:
src/wrapper/wrap_cl.hpp:2207: warning: comparison between signed and
unsigned integer expressions
src/wrapper/wrap_cl.hpp:2220: warning: comparison between signed and
unsigned integer expressions
src/wrapper/wrap_cl.cpp: In function ‘void init_module__cl()’:
src/wrapper/wrap_cl.cpp:83: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp:87: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp:88: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp:89: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp: In function ‘void init_module__cl()’:
src/wrapper/wrap_cl.cpp:83: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp:87: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp:88: warning: deprecated conversion from string
constant to ‘char*’
src/wrapper/wrap_cl.cpp:89: warning: deprecated conversion from string
constant to ‘char*’
/usr/bin/g++-4.2 -L/opt/local/lib -bundle -undefined dynamic_lookup
build/temp.macosx-10.6-i386-2.6/src/wrapper/wrap_cl.o -L/usr/local/lib
-lboost_python -lboost_thread -o
build/lib.macosx-10.6-i386-2.6/pyopencl/_cl.so -arch i386 -arch x86_64
-isysroot /Developer/SDKs/MacOSX10.6.sdk -Wl,-framework,OpenCL
ld: warning: in
/Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libboost_python.dylib, file is
not of required architecture
ld: warning: in
/Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libboost_thread.dylib, file is
not of required architecture
running install_lib
copying build/lib.macosx-10.6-i386-2.6/pyopencl/_cl.so ->
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyopencl
running install_egg_info
Removing
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyopencl-0.91.4-py2.6.egg-info
Writing
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyopencl-0.91.4-py2.6.egg-info
It seems to me that it was successfully compiled, because there were only
warnings. Also, I can't understand where the errors from ld come from:
ld: warning: in
/Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libboost_python.dylib, file is
not of required architecture
ld: warning: in
/Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libboost_thread.dylib, file is
not of required architecture
Because the specified directory contain libboost_python.dylib and
libboost_python.a compiled on the Snow Leopard system.
After that I run python and I've got error:
alexandr-kuzmins-macbook:pyopencl-0.91.4 shurik$ /opt/local/bin/python2.6
Python 2.6.4 (r264:75706, Jan 24 2010, 02:46:32)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyopencl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pyopencl/__init__.py", line 3, in <module>
import pyopencl._cl as _cl
ImportError: No module named _cl
>>> quit()
Please if anybody knows the solution or any ideas - spend a few minutes and
write to this email-list. I spent a few days dealing with it but no results
at all...
Thank you,
Alex
Hi,
I just downloaded, compiled and installed pyopencl from the git tree.
I am using AMD's opencl sdk for cpu's and it is working alright. When
I tried to run the demo.py example in the pyopencl distribution, it
threw an error.
Traceback (most recent call last):
File "demo.py", line 8, in <module>
ctx = cl.Context()
pyopencl.LogicError: Context failed: invalid platform
It appears that these examples have to be modified to specifically
select the device as now AMD's sdk ships with an ICD.
Here's the corresponding C example.
http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm…
--
Rohit Garg
http://rpg-314.blogspot.com/
Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay
The rst docs for pyopencl are failing to build for me.
~/Documents/opencl/pyopencl/doc@rpg-laptop> make html
python make_constants.py > source/constants.inc
mkdir -p build/html build/doctrees source/.static
python `which sphinx-build` -b html -d build/doctrees source build/html
Running Sphinx v0.6.2
loading pickled environment... not found
building [html]: targets for 3 source files that are out of date
updating environment: 3 added, 0 changed, 0 removed
reading sources... [100%] reference
reST markup error:
/home/rpg/Documents/opencl/pyopencl/doc/source/reference.rst:660:
(SEVERE/4) Title level inconsistent:
Buffers
^^^^^^^
make: *** [html] Error 1
~/Documents/opencl/pyopencl/doc@rpg-laptop>
Is there something else I should be doing?
--
Rohit Garg
http://rpg-314.blogspot.com/
Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay
I'm interested in doing some investigation into what performance I could
obtain by implementing various signal processing algorithms in GPU. Any
suggestion on an environment I could setup to try this? I'm thinking of a
simulation environment running under linux, without using a real gpu.
Hi community,
I'm new here and I'm starting to learn openCL and pyopencl seems very
attractive. I want to make a simple program that will compute lines of
the pascal triangle. How can I copy a buffer into another one ? On the
reference API from Khronos, there's a function called
clEnqueueCopyBuffer, but I don't find the equivalent on the pyopencl API.
Am I missing something or is this function not yet implemented ?
Best regards,
Nicolas Bonnel
this seems like a stupid question but :
I am trying to port a PyCUDA project to PyOpenCL, and can't find the
equivalent to "memcpy_htod" and "memcpy_dtoh" in PyOpenCL. I need to
be able to modify the contents of a device buffer from the host after
the device buffer has been initialized. Is this possible ?
--mrule
A few things I noticed about this:
1) After the install the setuptools in:
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/
is trashed
2) Which causes the easy_install in /usr/bin to break
3) Neither py.test nor pytools is installed so the test doesn't run
After installing setuptools again and creating a symbolic from
/usr/local/bin/easy_install to /usr/bin/easy_install, I installed pil (this
may be for PyCUDA), py and pytools. Now the test runs with the following
error message:
new-host:test daviddreisigmeyer$ python test_wrapper.py
==========================================================================================
test session starts
==========================================================================================
python: platform darwin -- Python 2.6.1 -- pytest-1.1.1
test object 1: /Users/daviddreisigmeyer/Installed
Stuff/pyopencl-0.91.4/test/test_wrapper.py
test_wrapper.py ...........FFF
===============================================================================================
FAILURES
================================================================================================
______ TestCL.test_image_2d.test_image_2d[device=<pyopencl.Device 'GeForce
9600M GT' at 0x1022600>, context=<pyopencl.Context at 0x1326d80 on
<pyopencl.Device 'GeForce 9600M GT' at 0x1022600>>] _______
self = <test_wrapper.TestCL instance at 0x160cd28>, device =
<pyopencl.Device 'GeForce 9600M GT' at 0x1022600>
context = <pyopencl.Context at 0x1326d80 on <pyopencl.Device 'GeForce 9600M
GT' at 0x1022600>>
def test_image_2d(self, device, context):
if not device.image_support:
from py.test import skip
skip("images not supported on %s" % device)
prg = cl.Program(context, """
__kernel void copy_image(
__global float *dest,
__read_only image2d_t src,
sampler_t samp,
int width)
{
int x = get_global_id(0);
int y = get_global_id(1);
/*
const sampler_t samp =
CLK_NORMALIZED_COORDS_FALSE
| CLK_ADDRESS_CLAMP
| CLK_FILTER_NEAREST;
*/
dest[x + width*y] = read_imagef(src, samp, (float2)(x,
y)).x;
// dest[x + width*y] = get_image_height(src);
}
""").build()
a = numpy.random.rand(1024, 1024).astype(numpy.float32)
queue = cl.CommandQueue(context)
mf = cl.mem_flags
a_img = cl.Image(context, mf.READ_ONLY | mf.COPY_HOST_PTR,
cl.ImageFormat(cl.channel_order.R, cl.channel_type.FLOAT),
> hostbuf=a)
E RuntimeError: clCreateImage2D failed: image format not supported
test_wrapper.py:244: RuntimeError
_________ TestCL.test_image_2d.test_image_2d[device=<pyopencl.Device
'GeForce 9400M' at 0x2022600>, context=<pyopencl.Context at 0x13326b0 on
<pyopencl.Device 'GeForce 9400M' at 0x2022600>>] __________
self = <test_wrapper.TestCL instance at 0x160cd28>, device =
<pyopencl.Device 'GeForce 9400M' at 0x2022600>, context = <pyopencl.Context
at 0x13326b0 on <pyopencl.Device 'GeForce 9400M' at 0x2022600>>
def test_image_2d(self, device, context):
if not device.image_support:
from py.test import skip
skip("images not supported on %s" % device)
prg = cl.Program(context, """
__kernel void copy_image(
__global float *dest,
__read_only image2d_t src,
sampler_t samp,
int width)
{
int x = get_global_id(0);
int y = get_global_id(1);
/*
const sampler_t samp =
CLK_NORMALIZED_COORDS_FALSE
| CLK_ADDRESS_CLAMP
| CLK_FILTER_NEAREST;
*/
dest[x + width*y] = read_imagef(src, samp, (float2)(x,
y)).x;
// dest[x + width*y] = get_image_height(src);
}
""").build()
a = numpy.random.rand(1024, 1024).astype(numpy.float32)
queue = cl.CommandQueue(context)
mf = cl.mem_flags
a_img = cl.Image(context, mf.READ_ONLY | mf.COPY_HOST_PTR,
cl.ImageFormat(cl.channel_order.R, cl.channel_type.FLOAT),
> hostbuf=a)
E RuntimeError: clCreateImage2D failed: image format not supported
test_wrapper.py:244: RuntimeError
TestCL.test_image_2d.test_image_2d[device=<pyopencl.Device 'Intel(R)
Core(TM)2 Duo CPU T9400 @ 2.53GHz' at 0x1020400>,
context=<pyopencl.Context at 0x13334e0 on <pyopencl.Device 'Intel(R)
Core(TM)2 Duo CPU T9400 @ 2.53GHz' at 0x1020400>>]
self = <test_wrapper.TestCL instance at 0x160cd28>, device =
<pyopencl.Device 'Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz' at
0x1020400>
context = <pyopencl.Context at 0x13334e0 on <pyopencl.Device 'Intel(R)
Core(TM)2 Duo CPU T9400 @ 2.53GHz' at 0x1020400>>
def test_image_2d(self, device, context):
if not device.image_support:
from py.test import skip
skip("images not supported on %s" % device)
prg = cl.Program(context, """
__kernel void copy_image(
__global float *dest,
__read_only image2d_t src,
sampler_t samp,
int width)
{
int x = get_global_id(0);
int y = get_global_id(1);
/*
const sampler_t samp =
CLK_NORMALIZED_COORDS_FALSE
| CLK_ADDRESS_CLAMP
| CLK_FILTER_NEAREST;
*/
dest[x + width*y] = read_imagef(src, samp, (float2)(x,
y)).x;
// dest[x + width*y] = get_image_height(src);
}
""").build()
a = numpy.random.rand(1024, 1024).astype(numpy.float32)
queue = cl.CommandQueue(context)
mf = cl.mem_flags
a_img = cl.Image(context, mf.READ_ONLY | mf.COPY_HOST_PTR,
cl.ImageFormat(cl.channel_order.R, cl.channel_type.FLOAT),
> hostbuf=a)
E RuntimeError: clCreateImage2D failed: image format not supported
test_wrapper.py:244: RuntimeError
==================================================================================
3 failed, 11 passed in 1.01 seconds
==================================================================================
new-host:test daviddreisigmeyer$
--
David W. Dreisigmeyer
Visiting Assistant Professor and Visiting Research Assistant Professor
Department of Mathematics
Department of Critical Care Medicine, School of Medicine
School of Arts and Sciences
601 Thackeray Hall
University of Pittsburgh, Pittsburgh, PA 15260
david.dreisigmeyer(a)gmail.com
Hi!
I'm trying to install pyopencl on OSX 10.6. I've installed Boost 1.41
and pyopencl 0.91.4. This is what I get when I run 'demo.py' from the
examples:
Smithers:examples markus$ python demo.py
Traceback (most recent call last):
File "demo.py", line 1, in <module>
import pyopencl as cl
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/pyopencl-0.91.4-py2.6-macosx-10.3-fat.egg/
pyopencl/__init__.py", line 3, in <module>
import pyopencl._cl as _cl
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/pyopencl-0.91.4-py2.6-macosx-10.3-fat.egg/
pyopencl/_cl.so, 2): Symbol not found:
__ZNK5boost6python7objects21py_function_impl_base9max_arityEv
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/pyopencl-0.91.4-py2.6-macosx-10.3-fat.egg/
pyopencl/_cl.so
Expected in: dynamic lookup
What am I doing wrong?
thanks,
Markus