16 Replies Latest reply on Sep 10, 2013 2:42 PM by duftopia

    clBuildProgram crashes


      building an OpenCL program for GPU crashes.

      The code has some parameters, namely loop bounds and local array sizes. For some parameter combinations clBuildProgram causes a segmentation fault, some are working fine and some builds are nor reproducible. The program builds and runs fine with AMDAPP OpenCL for CPU device (and for Nvidia OpenCL for GPU). The problem occurs with current and previous versions of AMDAPP.


      The clBuildProgram invokes a compiler, which may print warnings or error messages, may fail to optimize code, but should never crash.

        • Re: clBuildProgram crashes

          Please provide the crashing kernel and the compile options, otherwise we cannot debug the issue.

            • Re: clBuildProgram crashes

              I have the same issue.

              the problem didn't occur with CCC 11.12 but occurs with CCC 12.1

              my projet is big, it's hard to isolate it in a small sample


              but here is the idea:


              In my kernel prog, I have something like that:




              ... lot of code ....


              //I declare an "internal" function: no __kernel in front of it

              void OneFunction(

              ... lot of args ...

              float* argsOut,

              ... lot of args ...



              ... lot of code ...

              if ( t1 >= 0.0f ) {  *argsOut= t1;  }

              ... lot of code ...



              ... lot of code ....




              If I build this kernel on the GPU, clBuildProgram will crash (that doesn't crash on the CPU)


              but for example, if I do something like that, that works:



              //I replace t1 with a random value, my code becomes wrong BUT clBuildProgram doesn't crash

              if ( t1 >= 0.0f ) {  *argsOut= 123456.0f;  }



              Weird isn't it ???

              (Once again, this is since CCC 12.1)



              Edit: it seems that the problem doesn't come from the condition, but just the set of the variable


              Edit #2 : For the moment, I avoid the crash with -cl-opt-disable in the clBuildProgram arguments... hope this crash will be corrected in the next driver version.

              • Re: clBuildProgram crashes

                Hi Micah,


                I can confirm that clBuildPRogram crashes on __local char <name>[<constant>];

                and there is no support for 16 and 64 bits local data.

                A simple test reveals that there is only 32 bit support on local data.


                Kind regards,




                My kernel test:

                void TVPclAmdTestSharedMemory ()


                  // Ok

                  __local float sdf[4];

                  sdf[0] = 0;

                  sdf[1] = 1;


                  // Ok

                  __local int sdi[4];

                  sdi[0] = 0;

                  sdi[1] = 1;


                  // Compilation fails


                  __local double sdd[4];

                  sdd[0] = 0;

                  sdd[1] = 1;



                  // Compilation fails


                  __local short sds[4];

                  sds[0] = 0;

                  sds[1] = 1;



                  // Causes AMD compiler clBuildProgram to crash


                  __local char sdc[4];

                  sdc[0] = 0;

                  sdc[1] = 1;



              • Re: clBuildProgram crashes

                I'm experiencing this problem too. I'm using a Firepro V7800 with latest drivers and SDK version 2.6. Do I need to wait for updated drivers?


                My source is attached (the code doesn't make much sense right now, i know).






                EDIT: The float3 kernel argument was the offending part (thanks to http://devgurus.amd.com/thread/158608)

                  • Re: clBuildProgram crashes

                    Was this problem ever solved, I am having issues too on the bootstrap "KDB<aml> installation %0 complete in {00:02} ...  ERROR: CBuildProgram() -> -11"


                    My graphics are running slow and I almost never see my GPU contribute anything to renders even in crossfire mode.