PDA

View Full Version : clBuildProgram return -45 error



xstopka
05-06-2011, 05:12 PM
Hi,
I wrote some kernels and now I am testing them.
Whole program (C++ & 2 kernels) is working fine when it is executed on AMD based environment (OpenCL compiled for CPU, GPU, everything is fine). But on NVidia (both linux and windows, both CPU and GPU), clBuildProgram returns error -45 (CL_INVALID_PROGRAM_EXECUTABLE) for all kernels, but other programs and kernels are running fine on same machine. I have tested it on more computers. When kernels are compiled in simpler program, but with same compiling procedure, compilation is successful.

Are there any general reasons, why kernels cannot be compiled with nvidia drivers?
Anyone have any idea, what I have to do to compile it?
Thanks a lot
stopa

david.garcia
05-06-2011, 07:37 PM
Have you tried querying the build log with clGetProgramBuildInfo(..., CL_PROGRAM_BUILD_LOG, ...)?

Have you passed a notify function "pfn_notify" to clCreateContext()?

xstopka
05-07-2011, 02:55 AM
my bad :(
clBuildProgram is OK. clCreateKernel returns this error.

david.garcia
05-07-2011, 05:57 AM
clCreateKernel returns CL_INVALID_PROGRAM_EXECUTABLE.

That means that the program has compiled with errors. Check the build log as I mentioned earlier. Just because clBuildProgram() returned CL_SUCCESS it doesn't mean that compilation was successful -- yes, it's a bit counterintuitive. The way to know whether compilation was successful is to call clGetProgramBuildInfo(..., CL_PROGRAM_BUILD_STATUS, ...)

The reason clBuildProgram() works like that is because in some (most?) OpenCL implementations, clBuildProgram() runs in separate threads for best performance.