openCL

Problem with OpenCL kernel patch

utopianational's picture

Hi,

I'm trying to create a OpenCL kernel but I cannot get it work well. This program is to convert X/Y mouse position queue to an image. It looks work fine, but it gets gradually slower, and finally crashes MacOSX after several minutes.

__kernel void main(__global const float *X,__global const float *Y,__wr image2d_t output)
{
 
 
   int2   pos = (int2)(get_global_id(0), get_global_id(1));
   float4 color;
 
   color.x=X[pos.x]; //R
   color.y=Y[pos.x]; //G
   color.z=0.0; //B
   if(color.x<0)
      color.x=0;
   if(color.y<0)
      color.y=0;
   if(color.x>1)
      color.x=1;
   if(color.y>1)
      color.y=1;      
   write_imagef(output, pos, color);
 
}

I set queue size to 80 in qc, so that it creates 80x1 pixels image.

I found that it gets work well when I continue to click "Sample Now" button in "Advanced Kernel Settings" every minute, but I have no idea to get code work stably. Could you help me?

Cheers

OpenCL Meshes

cybero's picture

I had been studying the Aurora [Rainbow Snow] example recently that was posted up in the Developer Sample Code section sometime ago.

I was peaked to look again when the Iteration degradation problem cropped up earlier this week from itsthejayj.

I already knew that the OpenCL audio spectrum mesh creation routine worked outside of iTunes and produced a pretty mesh ribbon. It completely fails to show inside of iTunes.

Either way, the composition produced a load of Console messages, patches failing and segmentation fault crashes. Even if I attached a static .dae, then the Fog Environment, containing a Camera macro patch, would still bleat a lot , but only if the Audio Peak information were lacking slightly - silent to low points. If only those messages didn't presage the aforementioned crashes, I wouldn't be so worried. The Iterative string of errors doesn't end until the Console is reloaded.

Definitely a structural problem and one that the use of Iterations means keeps repeating even after the Render has been ceased. This behaviour also evidences when running the visualizer in iTunes and not playing any audio. I don't think this is specifically an Open CL, .dae related issue BTW. However, thus far I have not been able to reproduce the problem when replacing the Mesh with a simple Circle.

In fact , the problem seems to to have 'gone away' since I forced the Enable to be on only when Audio was running, whilst I typed up this report / post :-). If anyone can reproduce the problem I'd be interested to hear.

BTW - I do already know that when iTunes stops audio this visualizer kind of freeze frames and the QC Render window blacks out , the iTunes re-renders on fresh audio and the QC needs a stop/ restart on the Render window FYFI :-)

GL Tools Patches With Structure Inputs

toneburst's picture

Would it be possible to modify the GL Tools patches that accept structure inputs (Point Structure, Line Structure etc.) so that they can work with 4-component inputs for each point, as well as the current 3-component XYZ arrays?

It's a slightly obscure request, I know, but there's a reason: The OpenCL patch can't deal with or output float3s, ie structures of 3-component arrays, so you can't, for example, plug an OpenCL kernel outputting a structure into a Point Structure patch. I guess the 4th value could just be ignored.

a|x

Iterated OpenCL Meshes

toneburst's picture

OpenCL experiment. OpenCL meshes being distorted/displaced inside an Iterator.

a|x http://machinesdontcare.wordpress.com

skybox shader

dust's picture

came across this glsl shader while checking out some developer open cl examples. thought it was a cool texture.