cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

klkblake
Journeyman III

Only first write to a texture works when run on GPU

The attached testcase writes an incrementing value to each pixel of a texture. It works fine on the GPU, but on the CPU only the first write to the texture works; subsequent writes are ignored.

0 Likes
3 Replies
himanshu_gautam
Grandmaster

I was able to compile your code after installing freeglut library. But I am not sure how to check for the bug after this. Also I can't see the code to create the GL context. Please refer to APP SDK Sample SimpleGL, and then give more details about how to reproduce the issue.

0 Likes

The program is meant to display a 512*512 blue square that fades to magenta over ~1 second. This works fine on the GPU, but on the CPU the square stays blue. Inserting print statements shows that the OpenCL kernel is being run with the appropriate values, but the texture is not updating. The OpenGL context is created automatically in glutInit().

0 Likes

Sorry for the late reply.

using glut for CL-GL interop is not recommended as there does not seem to be a way to get hold of the GL context from glut API. Can you try to use raw windowing capabilities, and create a testcase. You can refer to SimpleGL sample for testcase creation.

0 Likes