I am attempting to debug a kernel on the CPU with gdb. I appended -g to the build options, and clc runs for a much longer period of time than normal. Finally, clBuildProgram returns -11 (buiild failure), and checking the value of CL_PROGRAM_BUILD_STATUS I get -2 (build error). The program does compile normally without the -g option.
I'm running on Linux, Ubuntu 10.04. Any ideas?
What does build log say?
I should have said, the build log is empty. I strongly suspect that the system has run out of memory as a result.... I do notice that the clc process consumes a lot of resources before this happens, and my program crashes with an std::bad_alloc exception thrown (inside my own code) immediately after the compilation fails. Again, this code does compile properly without -g enabled.
Could you post the source code?
It looks like it's one particular function that the compiler doesn't like. When I make that function into a __kernel the compiler segfaults. When I comment out that function, the -g compilation succeeds.
I will attempt to find what makes the code segfault so that I can post an example. I don't want to make the code available to the public at this time, but I would be willing to submit a bug report with it if that would help.
I will, however, attempt to narrow down what precisely makes this code segfault the SDK and I will post the code of that minimal test case here.
You can also send your code to streamdeveloper@amd.com if you don't want to post the code in forum.