Posted by
Wade Walker on
Mar 15, 2014; 3:30pm
URL: https://forum.jogamp.org/JOCL-texture-generation-tp4031853p4031910.html
It looks like your CL kernel code isn't syntactically correct. For an "int2 ic" you can't say ic[0], you have to say ic.x or ic.s0. How could this program even run for you?

Here are the errors:
Exception in thread "AWT-EventQueue-0" com.jogamp.opencl.CLException$CLBuildProgramFailureException:
CLDevice [id: 457290976 name: GeForce GTX 660 type: GPU profile: FULL_PROFILE] build log:
:6:5: error: subscripted value is not an array, pointer, or vector
ic[0] = x;
^ ~
:8:5: error: subscripted value is not an array, pointer, or vector
color[0] = color[1] = color[2] = 0;
^ ~
:9:5: error: subscripted value is not an array, pointer, or vector
color[3] = 255;
^ ~
:12:8: error: subscripted value is not an array, pointer, or vector
ic[1] = y/aspect;
^ ~
:16:5: error: subscripted value is not an array, pointer, or vector
color[0] = 255;
^ ~
:17:5: error: subscripted value is not an array, pointer, or vector
ic[1] = x*aspect;
^ ~ [error: CL_BUILD_PROGRAM_FAILURE]
at com.jogamp.opencl.CLException.newException(CLException.java:79)
at com.jogamp.opencl.CLProgram.build(CLProgram.java:392)
at com.jogamp.opencl.CLProgram.build(CLProgram.java:230)
at com.jogamp.opencl.gl.CLGLTextureGenTest.initCL(CLGLTextureGenTest.java:337)
at com.jogamp.opencl.gl.CLGLTextureGenTest.init(CLGLTextureGenTest.java:187)
If you correct those errors, you get this console output:
NVIDIA CUDA platform: GeForce GTX 660
0/1/2
1/32, 0/32
{CLDevice [id: 453555424 name: GeForce GTX 660 type: GPU profile: FULL_PROFILE]=BUILD_SUCCESS}
true
CLDevice [id: 453555424 name: GeForce GTX 660 type: GPU profile: FULL_PROFILE] build log:
<empty>
cl buffer type: GL_OBJECT_TEXTURE2D
shared with gl buffer: 1
cl initialised
And this graphical output:

The window contents are chopped up bits of a recent web search I did, so I assume it's showing uninitialized GPU memory contents. Is this what you expect to see?