achinda99

Program crashes on clEnqueueWriteImage for 2D image

Discussion created by achinda99 on May 5, 2010
Latest reply on May 6, 2010 by omkaranathan
NVIDIA compatible code crashes when writing to a 2D image from host to device

I have a 2D image object which has a new image written to it for every iteration of the kernel running.  The code correctly compiles and runs on NVIDIA hardware but on a Radeon 5770, crashes.  I'm using Windows 7 64-bit with the latest drivers and SDK.

I create the 2D image as follows (in a loop with iterator i):

t_dev_img = clCreateImage2D(context, CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, &img_format, img_dim[0], img_dim[1], 0, NULL, &error);

 

 

 

This works successfully.  The image format I use is initiated as:

size_t img_origin[3] = {0, 0, 0};

size_t img_region[3] = {img_dim[0], img_dim[1], 1};

size_t img_row_pitch = img_dim[0] * sizeof(float);

cl_image_format img_format;

img_format.image_channel_order = CL_RGBA;

img_format.image_channel_data_type = CL_FLOAT;

 

The clEnqueueWriteImage is called as follows (in a loop with iterator i):

clEnqueueWriteImage(command_queue, t_dev_img, CL_FALSE, img_origin, img_region, img_row_pitch, 0, cbi->img, 0, NULL, &img_event);

 

When I then called clFinish, it crashes.



 

Outcomes