Getting proper OpenCL enqueue_kernel error codes
![Multi tool use Multi tool use](http://sgv.ssvwv.com/sg/ssvwvcomimagb.png)
Multi tool use
I've got an OpenCL program that utilizes the enqueue_kernel function inside my parent kernel.
Currently, after enqueue_kernel is called, enqueue_kernel is returning "-11" as its error code.
The CLK_XXX error codes (enqueue_kernel's return values) listed in the spec are not enumerated anywhere in the docs or header files, so I don't know which code I'm getting. How can I get my kernel to return meaningful errors?
Also, the spec states that by enabling the "-g" flag during clBuildProgram, enqueue_kernel will return more verbose codes. However, when I add "-g" to my list of flags, I get a compilation error saying "-g" flag is not recognized. I have the latest NVidia drivers which officially support OpenCL1.2, and unofficially support OpenCL2.0 (I'm not using any unsupported functions from 2.0 that I'm aware of, only the unofficially supported ones). I'm guessing I get a compilation error with "-g" because it's not officially or unofficially supported by NVidia yet. Is there a way to get NVidia's latest drivers to spit out better errors? A different flag, perhaps?
As a side note, I can get enqueue_kernel working for some child kernels, and not others...so it's not a matter of enqueue_kernel simply being unsupported on my drivers/hardware, hence the need to understand the error codes I'm getting.
c++ opencl
add a comment |
I've got an OpenCL program that utilizes the enqueue_kernel function inside my parent kernel.
Currently, after enqueue_kernel is called, enqueue_kernel is returning "-11" as its error code.
The CLK_XXX error codes (enqueue_kernel's return values) listed in the spec are not enumerated anywhere in the docs or header files, so I don't know which code I'm getting. How can I get my kernel to return meaningful errors?
Also, the spec states that by enabling the "-g" flag during clBuildProgram, enqueue_kernel will return more verbose codes. However, when I add "-g" to my list of flags, I get a compilation error saying "-g" flag is not recognized. I have the latest NVidia drivers which officially support OpenCL1.2, and unofficially support OpenCL2.0 (I'm not using any unsupported functions from 2.0 that I'm aware of, only the unofficially supported ones). I'm guessing I get a compilation error with "-g" because it's not officially or unofficially supported by NVidia yet. Is there a way to get NVidia's latest drivers to spit out better errors? A different flag, perhaps?
As a side note, I can get enqueue_kernel working for some child kernels, and not others...so it's not a matter of enqueue_kernel simply being unsupported on my drivers/hardware, hence the need to understand the error codes I'm getting.
c++ opencl
add a comment |
I've got an OpenCL program that utilizes the enqueue_kernel function inside my parent kernel.
Currently, after enqueue_kernel is called, enqueue_kernel is returning "-11" as its error code.
The CLK_XXX error codes (enqueue_kernel's return values) listed in the spec are not enumerated anywhere in the docs or header files, so I don't know which code I'm getting. How can I get my kernel to return meaningful errors?
Also, the spec states that by enabling the "-g" flag during clBuildProgram, enqueue_kernel will return more verbose codes. However, when I add "-g" to my list of flags, I get a compilation error saying "-g" flag is not recognized. I have the latest NVidia drivers which officially support OpenCL1.2, and unofficially support OpenCL2.0 (I'm not using any unsupported functions from 2.0 that I'm aware of, only the unofficially supported ones). I'm guessing I get a compilation error with "-g" because it's not officially or unofficially supported by NVidia yet. Is there a way to get NVidia's latest drivers to spit out better errors? A different flag, perhaps?
As a side note, I can get enqueue_kernel working for some child kernels, and not others...so it's not a matter of enqueue_kernel simply being unsupported on my drivers/hardware, hence the need to understand the error codes I'm getting.
c++ opencl
I've got an OpenCL program that utilizes the enqueue_kernel function inside my parent kernel.
Currently, after enqueue_kernel is called, enqueue_kernel is returning "-11" as its error code.
The CLK_XXX error codes (enqueue_kernel's return values) listed in the spec are not enumerated anywhere in the docs or header files, so I don't know which code I'm getting. How can I get my kernel to return meaningful errors?
Also, the spec states that by enabling the "-g" flag during clBuildProgram, enqueue_kernel will return more verbose codes. However, when I add "-g" to my list of flags, I get a compilation error saying "-g" flag is not recognized. I have the latest NVidia drivers which officially support OpenCL1.2, and unofficially support OpenCL2.0 (I'm not using any unsupported functions from 2.0 that I'm aware of, only the unofficially supported ones). I'm guessing I get a compilation error with "-g" because it's not officially or unofficially supported by NVidia yet. Is there a way to get NVidia's latest drivers to spit out better errors? A different flag, perhaps?
As a side note, I can get enqueue_kernel working for some child kernels, and not others...so it's not a matter of enqueue_kernel simply being unsupported on my drivers/hardware, hence the need to understand the error codes I'm getting.
c++ opencl
c++ opencl
edited Jan 3 at 2:05
Tyson
asked Jan 3 at 2:00
TysonTyson
4841315
4841315
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
-11 is CL_BUILD_PROGRAM_FAILURE
. It's in the cl.h
header, and also see https://streamhpc.com/blog/2013-04-28/opencl-error-codes/
That code means your program has an error. Use clGetProgramBuildInfo
with the flag CL_PROGRAM_BUILD_LOG
to get the build log and learn the error.
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
1
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54015445%2fgetting-proper-opencl-enqueue-kernel-error-codes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
-11 is CL_BUILD_PROGRAM_FAILURE
. It's in the cl.h
header, and also see https://streamhpc.com/blog/2013-04-28/opencl-error-codes/
That code means your program has an error. Use clGetProgramBuildInfo
with the flag CL_PROGRAM_BUILD_LOG
to get the build log and learn the error.
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
1
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
add a comment |
-11 is CL_BUILD_PROGRAM_FAILURE
. It's in the cl.h
header, and also see https://streamhpc.com/blog/2013-04-28/opencl-error-codes/
That code means your program has an error. Use clGetProgramBuildInfo
with the flag CL_PROGRAM_BUILD_LOG
to get the build log and learn the error.
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
1
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
add a comment |
-11 is CL_BUILD_PROGRAM_FAILURE
. It's in the cl.h
header, and also see https://streamhpc.com/blog/2013-04-28/opencl-error-codes/
That code means your program has an error. Use clGetProgramBuildInfo
with the flag CL_PROGRAM_BUILD_LOG
to get the build log and learn the error.
-11 is CL_BUILD_PROGRAM_FAILURE
. It's in the cl.h
header, and also see https://streamhpc.com/blog/2013-04-28/opencl-error-codes/
That code means your program has an error. Use clGetProgramBuildInfo
with the flag CL_PROGRAM_BUILD_LOG
to get the build log and learn the error.
answered Jan 3 at 13:26
DithermasterDithermaster
5,5441818
5,5441818
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
1
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
add a comment |
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
1
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
No, the error is happening when calling enqueue_kernel inside my kernel, not when building the program. It's a runtime code not a compile code.
– Tyson
Jan 3 at 18:04
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
OpenCL error codes don't have different meaning depending on the command, so it's still CL_BUILD_PROGRAM_FAILURE. It should not be returned from clEnqueueNDRangeKernel. Seems like a driver bug or a bug in your program.
– Dithermaster
Jan 4 at 0:22
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
It's not coming from clEnqueueNDRangeKernel. It's coming from enqueue_kernel, a completely different command, with it's own set of error codes.
– Tyson
Jan 4 at 2:36
1
1
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
Indeed, sorry for my pre-coffee confusion. I've never used that feature. Perhaps the CLK_* error codes reuse the same number range. They seem to be defined here: raw.githubusercontent.com/KhronosGroup/SPIR/spirv-1.0/lib/… (-11 is not listed)
– Dithermaster
Jan 4 at 23:25
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54015445%2fgetting-proper-opencl-enqueue-kernel-error-codes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
edaRqSVITlWqwrT9jW