2

I am trying to compile OpenCL kernels on OS X. Everything is ok when there are just a few lines. However, after the code grows over 1.5k lines, clGetProgramBuildInfo with CL_PROGRAM_BUILD_LOG flag returned "Compile Server Error." every time. I googled but found nothing about it. Could anyone help me?

3
  • 1
    Altough it is unlikely, you might run into the maximal allowed kernel length. Better check the compiled programm and its size. 1500 lines of OpenCL code compilation could lead to a large blow off. Commented May 3, 2015 at 5:44
  • @Christian Well, maybe you are right. Could you please tell me the way to check whether it's over the maximum allowed. Commented May 4, 2015 at 4:17
  • One way could be to compile the host programm on the command shell and check the code length with an editor. Just to make it simple, you might also check out some lines, compile it, add some more lines, compile again, ... At one point you compilation might fail due to the size, or you found your error. Commented May 4, 2015 at 11:02

2 Answers 2

1

You can learn the meaning of OpenCL error codes by searching in cl.h. In this case, -11 is just what you'd expect, CL_BUILD_PROGRAM_FAILURE. It's certainly curious that the build log is empty. Two questions:

1.) What is the return value from clGetProgramBuildInfo?

2.) What platform are you on? If you are using Apple's OpenCL implementation, you could try setting CL_LOG_ERRORS=stdout in your environment. For example, from Terminal:

$ CL_LOG_ERRORS=stdout ./myprog

It's also pretty easy to set this in Xcode (Edit Scheme -> Arguments -> Environment Variables).

Please find the original answer by @James

Sign up to request clarification or add additional context in comments.

Comments

0

This unhelpful error message indicates that there is bug in Apple's compiler. You can inform them of such bugs by using the Apple Bug Reporting System.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.