cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

gwz
Journeyman III

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.

0 Likes
16 Replies

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

0 Likes

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.

Just experienced the same problem.

My OpenCL program actually compiled well a few months ago. I then upgraded all drivers and OpenCL SDK. The cl program now cause clBuildProgram to crash. The cl program still compiles well when tagarted at Intel CPU.

0 Likes

Without a test case we cannot confirm that the problem still exists and we cannot fix it if it still exists.

0 Likes

Having the same problem. I used 10n02's advice and disabled optimization and it stopped crashing as well.

My code is 70Kb long so I can't paste it here.

0 Likes

The problem does exist.

Because my program is a bit complex, it takes time to make a problem sample from it to show you.

I have pinpointed the problem. It happens on an operation like __local int3 x = (int3)(0, 0, 0); but much more complex than this.

0 Likes

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,

Tino

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;

  */

}

0 Likes

Tino,

What device are you attempting to compile on and with what SDK? This test case compiles fine for me.

0 Likes

I used a Radeon 6310 aka Loveland in combination with an E350 CPU. It crashed on the 6310.

Sent from Samsung Galaxy Note

0 Likes

 AMD APP v2.6 831.4

Sent from Samsung Galaxy Note

0 Likes

Thanks,

This should be working fine with an updated catalyst driver. Most likely this was a one-off error that snuck through our testing.

0 Likes

Hi Micah,

It does!

Kind regards,

Tino

0 Likes

Thanks and thanks for your quick response.

0 Likes

Hi,

Is there an updated driver which fixes this problem already? If not, are there beta drivers which do?

I have downloaded today's latest drivers and the clBuildProgram still crashes.

Regards,

Tomer Gal

0 Likes
lvezzaro
Journeyman III

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).

Thanks,

Luca

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

0 Likes

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.

Duf

0 Likes