cl::Program::build() crashes for x86. Fine for GPU.

Discussion created by CaptainN on May 18, 2011
Latest reply on Jun 20, 2011 by Steveyoungs
OpenCL run-time build for x86 crashes with floating point division error.

Inside the project there is a collection of open cl kernels as const char * array. One const char * has one or more kernels in form of C string. During runtime const char * strings collected as cl::Sources and compiled into program using open cl Program::build().  If target device set as GPU everything works nice.

If target device set as CPU Program::build() crashes somewhere in open cl run-time. In attempt to narrow down the problem I have just single kernel which compiles to GPU but crashes when target device is CPU. If this kernel taken to test environment as HelloOpenCl sample it compiles for CPU fine! Kernel Analyzer 1.8 generates x86 assembly with no problem.

Program build() crashes with following message: Unhandled exception at 0x… in project.exe: 0xC000008E: Floating-point division by zero.

Stack trace starts from: mydll!cl:rogram::build(&hellip and dives into amdocl.dll where eventually crashes. (of course, no names as I don't have pdbs).

System: HD5870, Catalist 11.5, sdk 2.4.

CPU: Intel Xeon (don’t think it is relate here).

Could you please advise how can I resolve the problem?

P.S. I have tried to trim the kernel which crashes on CPU (it is not a big kernel though) and at some point it compiles (but useless for me). Again, it crashes only when target device CPU. If target device GPU everything is ok.