PDA

View Full Version : Nvidia bug in clCreateKernelsInProgram



Amnon
04-07-2011, 09:31 PM
When a program was created for two Nvidia devices, but built for only one of them, Nvidia's implementation of clCreateKernelsInProgram() returns the error CL_INVALID_PROGRAM_DEFINITION.

Needless to mention, this error is not even listed in the OpenCL specification for the "clCreateKernelsInProgram" function, besides there should be no error in the first place as the OpenCL specifications clearly states:

"Kernel objects are not created for any __kernel functions in program that do not have the same function definition across all devices for which a program executable has been successfully built.

program is a program object with a successfully built executable"

david.garcia
04-08-2011, 04:24 AM
Maybe this is something you should bring up in NVidia's support forums.

How did you get the human-readable error string "CL_INVALID_PROGRAM_DEFINITION"? What numeric error code do you get fro clCreateKernelsInProgram?

As for the specification, I believe it's saying that you will only get kernel objects for those kernels that are defined with the same name and signature for all devices in the context. If you haven't built the program for one of the two devices in the context, then it makes sense that you won't get any kernel objects.

The error code that should be returned is CL_INVALID_PROGRAM_EXECUTABLE. Perhaps there's a small issue with the numeric-code-to-human-readable-string function.

Amnon
04-09-2011, 02:32 AM
How did you get the human-readable error string "CL_INVALID_PROGRAM_DEFINITION"? What numeric error code do you get fro clCreateKernelsInProgram?
Oops, sorry for the typo - the correct error-code that I get is "CL_INVALID_KERNEL_DEFINITION" (-47)


If you haven't built the program for one of the two devices in the context, then it makes sense that you won't get any kernel objects.
But I can get kernel objects using clCreateKernel, just not using clCreateKernelsInProgram.

(in my case, I must use "clCreateKernelsInProgram" because I don't know the kernel-names: if I had a way to know, then indeed I could simply use "clCreateKernel" instead)

david.garcia
04-09-2011, 06:14 AM
Okay, that sounds like an honest bug. You would have better luck posting it in NVidia's support forums since I doubt we have any NVidia engineers lurking around here :)