42

I am working on OpenCL. Does anyone know of a good debugger for OpenCL so that I can step into the OpenCL code and trace?

svick
  • 236,525
  • 50
  • 385
  • 514
Rakesh K
  • 8,237
  • 18
  • 51
  • 64

8 Answers8

18

You may also want to look into CodeXL:

https://gpuopen.com/compute-product/codexl/

CodeXL was originally developed by AMD, but was later released as an open-source project.

reirab
  • 1,535
  • 14
  • 32
lateralpunk
  • 221
  • 2
  • 2
15

Perhaps Gremedy's OpenCL debugger would be helpful? http://www.gremedy.com/gDEBuggerCL.php

James
  • 219
  • 1
  • 2
  • Now it is available in AMD website updated version 6.2 available for both Windows & Linux http://developer.amd.com/tools/gDEBugger/Pages/default.aspx – kiranputtur Aug 24 '12 at 02:38
  • @ocluser That's no longer current. AMD has abandoned gDEBugger, which is superseded by [CodeXL](http://developer.amd.com/tools/heterogeneous-computing/codexl/). [Gremedy's](http://www.gremedy.com/gDEBuggerCL.php) is the latest version of gDEBugger (Dec 11 2012). – kynan Aug 29 '13 at 13:15
9

your best bet is Intel Debugger for CPU, announced at Intel OpenCL SDK 1.5:

Intel OpenCL SDK you can step-by-step debug in visual studio.

Visual Studio debugger plug-in

sramij
  • 4,775
  • 5
  • 33
  • 55
6

Maybe you can try to use GDB on x86 CPU under Linux OS, see AMD's tutorial: http://developer.amd.com/gpu/ATIStreamSDK/assets/Debugging_OpenCL_with_GDB_on_x86_CPUs.pdf

elmattic
  • 12,046
  • 5
  • 43
  • 79
6

I generally recommend using GPUVerify from Imperial College London and Oclgrind from the University of Bristol, especially when you are stuck debugging your OpenCL programs (but better even before that).

dividiti
  • 61
  • 1
  • 2
  • Heh! I came here to mention oclgrind, but you beat me to it :-) But it doesnt support warps for now I think? Does GPUVerify provide step-by-step debugging of opencl kernels? – Hugh Perkins Jun 05 '16 at 17:00
6

Only AMD gDEBugger supports OpenCL step by step running and other tasty features http://developer.amd.com/tools/gDEBugger/Pages/default.aspx

NVidia Parallel NSight and other NVidia products will not support OpenCL debugging due to marketing decisions.

uelkfr
  • 61
  • 1
  • 1
  • 1
    AMD has abandoned gDEBugger, which is superseded by [CodeXL](http://developer.amd.com/tools/heterogeneous-computing/codexl/). [Gremedy's](http://www.gremedy.com/gDEBuggerCL.php) is the latest version of gDEBugger (Dec 11 2012). – kynan Aug 29 '13 at 13:16
3

NVIDIA's Parallel Nsight debugger (formerly known as Nexus) supports OpenCL (GPU).

From the website:

Parallel Nsight supports CUDA C, OpenCL, DirectCompute, Direct3D, and OpenGL.

Quonux
  • 2,975
  • 1
  • 24
  • 32
Tom
  • 20,852
  • 4
  • 42
  • 54
  • 1
    No, it does not. – Miro Krsjak Dec 15 '18 at 07:21
  • @MiroKrsjak Parallel Nsight was renamed to Nsight Visual Studio Edition and does support OpenCL (c.f. https://www.developer.nvidia.com/nsight-visual-studio-edition). The other Nsight tools do not. – Tom Dec 16 '18 at 09:13
3

I have not used it, but CLBuilder looks promising

Main features of CLBuilder

  1. Write OpenCL kernels with color syntaxing
  2. Compile the kernel to check errors without the need to launch and debug your own app.
  3. Easily create and select Build settings.
  4. Define kernel input values and check results.
  5. Profile the kernel execution time in order to improve performances.
  6. Create different Work Item Sizes Set (Global and Local) to check performances.
  7. Execute the kernel with printf on CPU and easily debug the code.
  8. Display input and output values on a chart.
  9. Consult execution log in order to see what CLBuilder is doing (log each OpenCL C function).
  10. Check Local and Constant arguments and resources used by the kernel.
  11. Generate C code to execute the kernel, CLBuilder will also compile this generated source code and execute it.
  12. Easily check all OpenCL properties including platform information.
dbr
  • 165,801
  • 69
  • 278
  • 343