Breakpoints not working in VS2012

Breakpoints not working in VS2012

  ↵

I have added the appropriate flags to my clBuildProgram call, and enabled OpenCL Kernel Debugging in the appropriate dialog, and added my .cl file to the 'OpenCL Files' folder of the project (specifically, the one project of my solution which makes OpenCL calls - this project is a static library which is used by other projects of my solution).

 

 

Despite this, attempting to add breakpoints to my ".cl" file results the hollow red breakpoint circle, rather than a solid one - hovering over this results in a pop-up reading "The breakpoint will not currently be hit. No symbols have been loaded for this document".

 

 

I am using CMake for my project, which results in a slightly odd looking Visual Studio solution. This is shown in one of the attached screenshots.

 

 

Have I missed a step, or should this work?

 

I am using VS2012 in Windows 7 64-bit.

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

may be a bug!

Hi Max,

Which version of the SDK you are using?

Please try to follow the steps below.
1. Make sure that you have only 1 instance of Visual Studio open.
2. Check that OpenCL debugger is enabled in the "Tools->Intel SDK for OpenCL - Debugger" dialog.
3. Check the work-items value in the same dialog with respect to kernel execution. This is important in case the kernel runs with some offset and with the default work-items value (0,0,0) the debugger will not stop at the kernel breakpoint.
4. Make sure that you are working with Intel OpenCL platform and you select CPU device.
5. Add necessary build parameters to clBuildProgram like so:
clBuildProgram(g_program, 0, NULL, "-g -s c:\\work\\ToneMapping\\ToneMapping.cl", NULL, NULL);
6. Make sure that the kernel source file you open in Visual Studio is the same file/text you pass to clCreateProgramWithSource function.
7. Put a breakpoint at host code right before (or at) clCreateContext function call. Put another breakpoint at kernel function code. Make sure that you put the breakpoint at the same kernel function that will be called/enqueued later.
8. Run the debugging session (F5). The debugger stops near clCreateContext. At this point the kernel breakpoint should be shown as not active (The breakpoint will not currently be hit...).
9. Step over the clCreateContext function call. At this point the kernel breakpoint should become active, showing something like "At ToneMapping.cl, line 60 in process 'icldbgsrv.exe'".
10. Continue debugging (F5) - kernel breakpoint should be hit.

In case the kernel debugger still doesn't work with your project could you please try to debug one of the sample projects (Tone Mapping for example).
Please, let me know the results.

Thanks,
Yuri

  • Make sure that you have only 1 instance of Visual Studio open.

I've never had more than one instance open.

  • Check that OpenCL debugger is enabled in the "Tools->Intel SDK for OpenCL - Debugger" dialog.

I have done so. I provided this attachment to demonstrate this.

  • Check the work-items value in the same dialog with respect to kernel execution. This is important in case the kernel runs with some offset and with the default work-items value (0,0,0) the debugger will not stop at the kernel breakpoint.

I am not using offsets. I am using only one, very simple work-item. I am using (0,0,0) as the selected work-item.

  • Make sure that you are working with Intel OpenCL platform and you select CPU device.

My code prints the name of the device used: Device selected:         Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz.

  • Add necessary build parameters to clBuildProgram like so: clBuildProgram(g_program, 0, NULL, "-g -s c:\\work\\ToneMapping\\ToneMapping.cl", NULL, NULL);

Again, my attachments show that yes, I am doing this.

  • Make sure that the kernel source file you open in Visual Studio is the same file/text you pass to clCreateProgramWithSource function.

I'm sure. kernels_root\normalise.cl is the kernel file. I'm quite confident that my debugging flags are correctly formed.

  • Put a breakpoint at host code right before (or at) clCreateContext function call. Put another breakpoint at kernel function code. Make sure that you put the breakpoint at the same kernel function that will be called/enqueued later.
  • Run the debugging session (F5). The debugger stops near clCreateContext. At this point the kernel breakpoint should be shown as not active (The breakpoint will not currently be hit...).
  • Step over the clCreateContext function call. At this point the kernel breakpoint should become active, showing something like "At ToneMapping.cl, line 60 in process 'icldbgsrv.exe'".
  • Continue debugging (F5) - kernel breakpoint should be hit.

It does not become active after clCreateContext. Attachment to this post shows this.

  • In case the kernel debugger still doesn't work with your project could you please try to debug one of the sample projects (Tone Mapping for example).

I will try this and post the results later.

Don't know if it helps, but I have VS2013 installed as well (though I am not using it (it lacks Boost support currently)).

As I mentioned before, the OpenCL code is not in the project which executes, but in a (non-executable) 'common' project (in the same Visual Studio solution) which is accessed by the project being debugged.

Attachments: 

AttachmentSize
Downloadimage/png rightAfterCreateContext.png9.88 KB

Oops, forgot to answer your first question.

  • Which version of the SDK you are using?

The installer file I used is named intel_sdk_for_ocl_applications_2013_r2_x64_setup.exe

My Kernel Builder says it is version 3.0.0.1.

I downloaded the Tone Mapping sample.

Breakpoints don't work there, either. (The program seems to run fine other than that.)

As the program starts up, it prints out the selected OpenCL device: it selected the Intel CPU (rather than my nVidia graphics card).

I modified the project to include Intel's debug flags, and converted to an Intel OpenCL project, and checked that Intel OpenCL debugging was enabled. (I am assuming that the project doesn't use offsets, i.e. that work-item (0,0,0) will exist.)

Annotated screenshots attached.

Attachments: 

OK, thanks.

In one of your screenshots I see the device version contains 'Build 117'. So, I assume that you have installed the latest 14.1 CPU runtime, right? But SDK installer you mentioned (2013 r2) is rather old and there might be incompatibility issues between the SDK and runtime.
Is it possible to uprgrade (uninstall/install) to the latest (2014) SDK version as well?

BTW, I see (https://software.intel.com/en-us/forums/topic/515672) that there was some issue with the SDK download link recently, so probably you have got the old package.

Thanks,
Yuri

Thanks - that was indeed the issue.

I uninstalled the (old-version) SDK, and downloaded and installed intel_sdk_for_ocl_applications_2014_x64_setup.msi . OpenCL debugging is now working correctly.

(Kernel Builder now reports version as 1.2.0.117.)

A warning about the incompatible packages would have been nice, though.

Also, in Visual Studio, going to Help > About Visual Studio shows "OpenCL Debug Engine" as being version 1. It showed this value before I moved to the new version, too.

Leave a Comment

Please sign in to add a comment. Not a member? Join today