OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

GPU compilation : trap situation ?

Polar01
Beginner
523 Views

Hi,

I try to run my kernel on Intel GPU but during compilation I got the following error :

"error: trap situation detected...aborting"

"error: midlevel compiler failed build."

What that ?

Thx

0 Kudos
3 Replies
Raghupathi_M_Intel
523 Views

Not sure about the trap message but looks like the compiler crashed for some reason. Can you attach the kernel? Or isolate the crash to the snippet of code that is causing the crash?

Thanks,
Raghu

0 Kudos
Polar01
Beginner
523 Views

Hi,

It is for a commercial software... so, I cannot put the kernel publicly on the forum.

Please, can you contact my by email, then I will send you the kernel ?

Krys

0 Kudos
Alejandro_V_
Beginner
523 Views

Hi,

I post this because I faced the same problem and I thought that it would be useful to share my solution, as this is the only post I have found about it.
The problem is quite silly (and, somehow, embarrasing).
I could isolate the line that is crashing my code with the same problem. It is:

unsigned int A[2];
A[0] = 1; //This does not compile. Trap Situation error.

However, replacing the previous line by this line, it compiled:

unsigned int A[2];
A[0] = 0; //This does compile

That was strange and I spent some time working around the declaration of A, which I felt that was somehow wrong.
In fact, assigning to A[0] any value, expression or variable different than 0, results in a Trap Situation.

After some time, I figured out that I had a wrong declaration of variable unrelated to A:

unsigned int currentSnapshot[0]; //Wrong declaration

This declaration was undetected by the compiler and resulted in an unexpected behavior with the error messages:

"error: trap situation detected...aborting"
"error: midlevel compiler failed build."

I hope that this helps someone who is facing similar problems.

0 Kudos
Reply