Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

OpenCL compiler crashes, example with 2 line kernel

I have problems compiling my some of my kernels for AMD GPUs, no problems with NVDIA OpenCL.

Used platform OpenCL 1.2 AMD-APP (1084.4) Juniper HD5700 Win7-64.

Minimal kernel extracted from bigger one as example:

kernel void AMDBug (const uint xx, global uint *gg) {
   uint x = get_global_id(0) + xx;
   if (x < xx) *gg = 1;

Compiler crashed when compiling for GPU, no problem for CPU.

Last message before crash:

LLVM ERROR: Cannot select: 0xb1e670: i8 = setcc <lots of hex codes>

Please your advice.

Best regards, Jaap.

1 Solution


A related question. I want to use my software on different OpenCL platforms like AMD, NVIDIA and Intel.

My host code can only link with one version of OpenCL.lib.

Do you expect problems linking with AMD's OpenCL.lib and executing NVIDIA or Intel OpenCL platform?

This is where ICD come to play.

Just think how "clGetPlatformIds" will work, if there are multiple platforms?

Although you link with AMD's opencl Lib -- the ICD will make sure that it detects all other platforms involved and will route your API calls correctly.

On Linux, I know for a fact that OpenCL drivers register themselves at /etc/OpenCL/vendors/

The ICD files present there are just plain text files that contain the name of the shared-library that implements the platform (icd)'s runt-ime. These files can be read at run-time, platform DLLs located and opened and queried.

On windows - Registry values @ HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors hold DLL file names that implement the platform

Note that OpenCl extension provides APIs to provide function addresses of a platform (clGetExtensionFunctionAddress)

You can check OpenCL extensions PDF for more details.

Hope this helps,

View solution in original post

20 Replies