Debugging OpenCL with Intel SDK for visual studio dont stop at breakpoints

1.6k views Asked by At

I want to debug my OpenCL Code via Intel SDK and visual studio 2013, but the debugger don't stop at the breakpoints. I enabled OpenCL Kernel debugging and set the buildoption to -g -s and added a breakpoint in the opencl code (I also do't use any offset).

I've also tried all the voodoo mentioned elsewhere including.

  • Setting a breakpoint at (/behind) the creation of the context.*
  • Using only Visual Studio Instance the same time
  • spitting three times beyond the left shoulder before starting debugging
  • ...

but nothing worked. Any suggestions?

*This leads to the following, before reaching the breakpoint the OCL-Breakpoints are marked as non-reachable and afterwards they are shown reachable with file and line of code.

3

There are 3 answers

0
Käptn Freiversuch On BEST ANSWER

Which Device do you use for debug? Only intel CPU is allowed for debugging with intel SDK. intel graphics wont work.

Check the following: Do you use the intel compiler instead of MSVC compiler? right click the project -> convert to opencl project / use intel c++ compiler

Compiler settings: Code_builder menue -> opencl debugger -> options

check "enable opencl kernel debugging" specify a work item you want to debug (0,0,0 is fine and the frist thread if you only use a global workgrp size and no local)

tab api debugger: check enable opencl api debugger

after -g -s you must add the path to the kernel like:

options = " -g -s E:\\prog\\clproj\\Clproj\\kernel.cl";

Did you hand over the options char* to the clBuildProgram like this?

clBuildProgram(program, 0, NULL, options, NULL, NULL);

Make sure you use the intel opencl libs and not any other opencl libs.

For correct setup with Vstudio look here:

intel guide

0
Dimitar Dimitrov On

I got the same problem when trying to debug OpenCL kernels using mixed platforms (C# with C|C++). When my test project is a C# project that calls native C|C++ libraries (the OpenCL code resides there) the Intel OpenCL Debugger was disabled. I couldn't manage to make it work for mixed platforms.

The workaround was to get rid of the C# project and use only native code. For unit testing it is acceptable, but one could imagine that the OpenCL code should be integrated in a system mainly developed under C#. Up to date I couldn't find any working solution to debug OpenCL code on such systems.

1
CarpeDiemKopi On

My solution for the same problem - although I had everything mentioned in the above contributions correctly configured:

I created a new project with the "CodeBuilder Project for Windows"-template from Intel (Installed\Templates\Visual C++\OpenCL) and copied my contents into this new project.

After this the breakpoints got hit.