AnsweredAssumed Answered

clEnqueueWriteBufferRect crashes 7970

Question asked by amcelroy on Jun 10, 2013
Latest reply on Jun 13, 2013 by amcelroy

Howdy folks,


Ran into a nasty issue and was wondering if I could get some help.  OpenCL device is an AMD7970 running Catalyst 13.4 release.  As the title of the post states, I'm either crashing the OS or causing a driver display timeout when trying to use  clEnqueueWriteBufferRect. 


This thread ( seems to be along a similar vein, but the thread author reported the issue fixed at the end. A basic example of the code causing the problem is:


#include <CL/cl.h>

void main(){

  int Width = 4096;

  int Height = 1;

  int Depth = 1;

  int Error = 0;


  float *WriteData = new float[Width*Height*Depth];

  float *ReadData = new float[Width*Height*Depth];


  for(int i = 0; i < Width*Height*Depth; i++){

  WriteData[i] = i;



  cl_context Context;

  cl_command_queue Queue;




  /****END DEVICE SETUP*****/


  size_t Region[3] = {sizeof(float)*Width, Height, Depth};

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

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


  cl_mem DeviceTestData = clCreateBuffer(Context, CL_MEM_READ_WRITE, sizeof(float)*Width*Height*Depth, NULL, NULL);

  Error = clEnqueueWriteBufferRect(Queue, DeviceTestData, true, DevOrigin, HostOrigin, Region, 0, 0, 0, 0, WriteData, NULL, NULL, NULL);

  Error = clEnqueueReadBufferRect(Queue, DeviceTestData, true, DevOrigin, HostOrigin, Region, 0, 0, 0, 0, ReadData, NULL, NULL, NULL);    



As noted in the code, please setup your device however needed.  Save your work though!