Hi all,
I am not quite getting the function of the event system together with
non-blocking copies.
I want to enqueue a non-blocking copy function which returns an event
for a kernel to wait on:
wev1 = cl.enqueue_copy(IOqueue, device_image, host_image,
is_blocking=False, origin=(0,0,0), region=host_image_shape)
program.kernel_name(workqueue,(work_group_shape,),None,device_image,wait_for
= [wev1])
Both queues are defined as OoO queues in the same context on the same
device.
In my profiling I can see the start of the kernel, before the copying is
finished. Does that mean, I have to use blocking copies,
or am I doing something else wrong?
Thanks for any help
Jonathan
On Thu, 2016-03-10 at 08:15 +0000, Bert Vandereydt wrote:
> Dear mr Rybak,
>
> I am an aerospace engineering student at the University of Technology
> Delft.
> At the moment, I am working with eight fellow students on an image
> processing platform (TIPP) for the university.
>
> We are working specifically on analysis of 3D shape reconstruction
> with fringe projection technique. For this we are making a python
> program, which can in a way transform pictures into point clouds.
> In this program there are two matrix equations which have to be run
> twice for each pixel, all of these pixels are independent of each
> other. For this we think PyOpenCL would vastly improve the speed of
> the calculations.
>
> Because we are a group of nine aerospace engineering students, trying
> to understand PyOpenCL is difficult. And because this program will be
> on the platform for years to come, we want it to run as best as
> possible.
>
> Therefore I am writing this email. Is it possible, when our program
> is written, to ask you for advise regarding GPU optimisation?
>
> We would really appreciate any help you can provide.
>
Sorry for writing response so late.
I'm glad that you are finding PyOpenCL useful.
I believe the best for you is to subscribe to PyOpenCL mailing list
(in CC) - there are many people developing and using PyOpenCL who
should be able to help you.
I'm just maintaining Debian packages for PyOpenCL (and PyCUDA) and
not using PyOpenCL every day. While I might be able to help if
you have problems with packages, I am not the best person for
performance tuning.
Best regards.
--
Tomasz Rybak, Debian Maintainer <tomasz.rybak(a)post.pl>
GPG: A481 824E 7DD3 9C0E C40A 488E C654 FB33 2AD5 9860
http://member.acm.org/~tomaszrybak
Hey Gregor,
Thanks, upgrading to the latest github version (bbb2ca7dd) got rid of
the INVALID_VALUE error,
however the host-image copy still is off and empties the input data
ndarray as a side effect
#--------code
from __future__ import print_function
import numpy as np
import pyopencl as cl
#host -> image
data = np.random.randn(100,100).astype(np.float32)
fmt = cl.ImageFormat(cl.channel_order.R, cl.channel_type.FLOAT)
im = cl.Image(ctx,cl.mem_flags.READ_WRITE, fmt, data.T.shape)
cl.enqueue_copy(queue,im,data, origin = (0,0), region = data.T.shape)
#image -> host
out = np.empty_like(data)
cl.enqueue_copy(queue,out, im, origin = (0,0), region = data.T.shape)
print(np.allclose(out,data))
# prints False
# data is zeroed out
#--------
I'll most have to revert to an earlier version then,
cheers,
Martin
Am 05/04/2016 um 15:41 schrieb Gregor Thalhammer:
>> Am 05.04.2016 um 15:09 schrieb Martin Weigert <mweigert(a)mpi-cbg.de>:
>>
>> Hey Gregor,
>>
>> thanks!
>> Actually the intial error was on me, as my example included the "(interactive=False)" during context creation and the CPU got selected by default, of course lacking the right image format.
>>
>> The code example now (with the Intel Iris selected as device) breaks at
>>
>> cl.enqueue_copy(queue,out,im, origin = (0,0), region = (100,100))
>>
>> which gives (on 2015.2.4 and both the Iris and Titan) a
>>
>>> clenqueuereadimage failed: INVALID_VALUE
>> but runs fine on 2015.1.
>>
>> Did my snippet run fine on your machine when selecting either the Iris or GT 750?
>>
>> Thanks,
>>
>> Martin
>>
> Hi Martin,
>
> your code runs without error with both GPUs. I am running a (not recent) git version of pyopencl, your 2015.2.4 is probably missing a bug fix, issue #106 for enqueue_copy_buffer_rect.
>
> Gregor
>
Hi all,
Since updating to version 2015.2.4. some of the image creation/reading
function that use to work are throwing errors on my machine.
Specifically, running the following minimal code that creates an OpenCL
Image from an array and reads it back:
#--------------code
from __future__ import print_function
import numpy as np
import pyopencl as cl
ctx = cl.create_some_context(interactive=False)
queue = cl.CommandQueue(ctx)
data = np.random.randn(100,100).astype(np.float32)
im = cl.image_from_array(ctx, np.asarray(data))
out = np.empty_like(data)
cl.enqueue_copy(queue,out,im, origin = (0,0), region = (100,100))
print(np.allclose(data,out))
#--------------/code
results in the following error*
pyopencl.cffi_cl.RuntimeError: clcreateimage failed:
IMAGE_FORMAT_NOT_SUPPORTED
The same code runs just fine with version 2015.1.
Can anybody else confirm that issue and are there any thoughts where
that error might originate from?
Thanks very much for any help!
Martin
*both on
Mac OS 10.10, Intel Iris, OpenCL 1.2., pyopencl 2015.2.4
Ubuntu 14.04, Titan X, OpenCL 1.2, pyopencl 2015.2.4