How to debug OpenCL on Nvidia GPUs?
Asked Answered
B

1

9

Is there any way to debug OpenCL kernels on an Nvidia GPU, i.e. set breakpoints and inspect variables? My understanding is that Nvidia's tool does not allow OpenCL debugging, and AMD's and Intel's only allow it on their own devices.

Blubberhead answered 16/8, 2013 at 3:57 Comment(2)
I have not found a solution for this issue however we often Debug using CodeXL on AMD platforms to make sure our code is working and then do final modifications and optimizations which are specific to the Nvidia platforms without debugging support. This has worked fairly well but obviously requires buying an AMD card that is similar to your Nvidia card.Its not an ideal solution but tends to work well for us.Hogweed
Upvote for CodeXL tool, excellent tool from AMD, besides that you are out of luck on NVIDIA, you can probably use printf command(khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/…) as dirty way of looking at locals, I would suggest you move to AMD GPU's where tools & support is much betterBonbon
G
1

gDEBugger might help you somewhat (never used it though), but other than that there isn't any tool that I know of that can set breakpoints or inspect variables inside a kernel. Perhaps try to save intermediate outputs from your kernel if it is a long kernel. Sorry I can't give you a magic solution, debugging OpenCL is just hard.

Garibaldi answered 16/8, 2013 at 9:38 Comment(5)
This post mentions that a previous version of gDEBugger supported Nvidia cards, but that work was dropped. Is this version, and the drivers that support it, still available?Rothrock
Seems I should have checked the status of gDEBugger from Graphic Remedy before posting. The last version they released is from 2010 (still available for download) and AMD's version has now been superseded by CodeXL. I don't know if the old version of gDEBugger works, but I'll try it out and report back.Garibaldi
You may need to find an earlier version, because they apparently dropped some Nvidia support before the latest version.Rothrock
I tried gDEBugger 5.8.1, and it only seems to support breakpoints on OpenCL library functions anyways, not kernels.Rothrock
Just tried it myself and I see it doesn't succeed in pausing an application at the next OpenCL call either, so it can't show me any information about buffers, etc. Conclusion - nothing available for Nvidia users to debug OpenCL code.Garibaldi

© 2022 - 2024 — McMap. All rights reserved.