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.
1718 Discussions

opencl build program error on Intel 630 graphics

liang_p_
Beginner
834 Views

Hi,

Please help on this opencl issue:

I have a kernel program file that runs fine on AMD and NVidia graphics cards, as well as on Intel CPUs. But when trying to build on Intel 630 graphics card, I got the following message:

error: undefined reference to `_Z5clampDv2_ddd()'

error: backend compiler failed build.

I am pretty sure this is related to calls to clamp(double2, double,double).

when I change the above call to clamp(double, double, double) and try to build the kernels again, the program simply clashes (from igc64.dll) and no exception can be caught to investigate the cause of the crash.

Any insight into this issue is welcome and is greatly appreciated.

Thanks,

0 Kudos
4 Replies
Jeffrey_M_Intel1
Employee
834 Views

Thank you for this report.  This may be a bug.  However, to process it we will need a kernel which shows this behavior.  If you can make a simple example you don't mind sharing you can attach it in this forum.  Otherwise, please feel free to contact us with a private message.  You can do this with "send author a message" which you can see in the same line as my name above this reply.

0 Kudos
liang_p_
Beginner
834 Views

Hi Jeffrey,

Thanks for replying.

I agree with you that this may be a bug. This is simple demonstrated: just a one function call in ANY kernel to clamp(double2, double, double) will give you the error message. Changing the call to  clamp(float2, float, float) will work (of course that would not be what I wanted). Changing the call to two separate clamp(double, double, double) will also work.

After some experimenting, I found that the crashing was related to the length of the program file (mine is >76KB single file). If I truncate the content of the file (with disregard to functionality and correctness) to certain length, the compile and link with code-builder will be successful. Any one extra line of code will make code-builder report error logging to file, with the file path apparently wrong (sometimes the directory separator becomes "/" on windows 10 in stead of "\"). It seems as if some fixed length buffer boundary is exceeded in igc64.dll.

Another interesting phenomenon is with code-builder if you use a function call to pow(double,double) it will succeed in building kernels, but report error on disassembly of SPIRV and the ".txtspirv" file will not be created.

I will try to make my program files into separate smaller ones and link them in the end. I have just begun to use code-builder. I find it handy. But have not figured out how to load multiple program files into one session yet. Could you direct me on how that can be done.

regards,

Liang

0 Kudos
liang_p_
Beginner
834 Views

Hi Jeffrey,

Here is a simple kernel form the Intel kernel template, in which I inserted the bug test section:

#pragma OPENCL EXTENSION cl_khr_fp64 : enable
 
__kernel void Add(__global int* pA, __global int* pB, __global int* pC)
{
    const int x     = get_global_id(0);
    const int y     = get_global_id(1);
    const int width = get_global_size(0);
 

    const int id = y * width + x;

//build bug test
double b=25.0;
double2 a=(double2)(10.0, 50.0);
a = clamp(a, -b, b);
//build bug test
 
//disasseble bug test
b=pow(b,2.5);
//disasseble bug test
 
    pC[id] = pA[id] + pB[id];
}
 
It can be tested using Code-Builder
 

This kernel program will compile but will result in build error "error: undefined reference to `_Z5clampDv2_ddd()'". 

If you comment out the line with "a = clamp(a, -b, b);" you will get "Failed to disassemble SPIR-V output file: error: 203: End of input reached while decoding OpExtInst starting at word 196: expected more operands after 7 words."

On another note, the Intel(R) HD Graphics 630 device disappeared with the Intel(R) OpenCL platform from my ordinary OpenCL inquiry process (using clGetPlatformIDs), but they still appear in Code-Builder environment. Do you have any idea what might have caused this phenomenon and how to get them back?

 

thanks 

0 Kudos
liang_p_
Beginner
834 Views

OK, the cause of the Intel(R) OpenCL platform and  HD Graphics 630 device disappearing was the installation of Intel OpenCL SDK, which enabled the CPU only platform and disabled the normal Intel(R) OpenCL platform. After uninstalling the Intel OpenCL SDK, Intel(R) OpenCL platform and  HD Graphics 630 device both reappeared again. This should not be normal I suppose.

0 Kudos
Reply