Will try to run your Solarsystem on a gcn card here
From problems perspective, it can be helpful, if you can try to do more debugging, and come up with some pointers. Probably compare your CL-GL interop with that of APP SDK's Samples. Also you have not run it on devices formally supported by AMD, so maybe you can try that too.
Thanks. That would be great.
From what I am told it will run if you comment out the #pragmas in adams.cl and start it like this
.\OpenCLSolarSystem.exe -amd -cpu -nsmall
i.e. AMD opencl CPU driver with AMD graphics card opengl
The thing that bothers me the most about this is that I do alot of error checking and people are reporting that no error dialog is appearing.
It is as if the copy from the cl buffer containing the positions to the shared GL_VERTEX_ARRAY object is silently failing.
In the worse case an I was somehow failing to make a GL context properly then clCreateFromGLBuffer should be failing with CL_INVALID_CONTEXT but no error dialog appears.
The cl buffer and the GL_VERTEX_ARRAY are double4 vectors could that be an issue?
glVertexPointer(3, GL_DOUBLE, sizeof(cl_double4), 0);
The only error on clBuildProgram
Warning: adamsBashforth16 kernel has register spilling. Lower performance is expected.
However that kernel is'nt that important.
I included a adamsBashforth16 integration because I'm using a 16 element ring history buffer (so that mod 16 = and &0xF) and hence 16 stages is the max. (there is at most 16 elements in the history buffer)
Anyway I am planning to buy a new system umm early next month and that will include and AMD graphics card.
I have looked at the APP SDK's Samples SimpleGL.
With AMD opencl am I required to call clGetGLContextInfoKHR in order to enable cl_khr_gl_sharing?
Anyway I have added alot of debugging code and clGetGLContextInfoKHR is giving expected output for intel opencl and amd opencl (I have access to cpu only).
i..e. CL_DEVICES_FOR_GL_CONTEXT_KHR is returning a array of devices and my selected device is on the list.
For nvidia its returning 0 as the parameter size for CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR and CL_DEVICES_FOR_GL_CONTEXT_KHR.
I have uploaded OpenCL Solar System Debug1.01b.zip that has the clGetGLContextInfoKHR debug messages.
I found a discussion that said that the vbo's must be created after the cl context
So I have copied the sample ordering for the Gl context, CL context and interopt objects.
It didn't help.
1) Create and Initialize OpenGL
2) Create CL context and Command Queue
3) Create VBO's
4) Create CL interop to the vbo's and other cl buffers.
Note I;m still setting up my GL_PROJECTION and GL_MODELVIEW in 1
Is there some document specifying the order. Other than your simplegl sample I have not see other programs doing this.
creates the vbo before creating the cl context
Next thing I will try is changing the GL_DOUBLE vertex array to GL_FLOAT and change my copy kernel to down cast double4 -> float4
Although... I think that all graphics cards that support cl_khr_fp64 should support GL_DOUBLE vertex arrays...
Refer to Appendix G in AMD OpenCL Programming Guide
I have gotten it running with help from people on the Beyond3d forum http://forum.beyond3d.com/showthread.php?p=1746278
>Refer to Appendix G in AMD OpenCL Programming Guide
Which fails to mention Section 5.3 Interoperability of the AMD APP Developer Release Notes (v2.8)
Could this information be included in Appendix G, thanks
Thanks mozoo for the beyond3d link. Also I had already raised a request to add the Known Issue (in release notes) to Appendix G as well. It should happen soon.