OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1720 Discussions

Unable to Launch Debugger in VS2015 running OpenCL Samples


I've downloaded and successfully run the code samples from the Intel OpenCL website under "Release" configuration.

(for example, Sobel, CapsBasic, and others).

So, I'm confident that my SDK/drivers setup is mostly working.

However, I'm not able to launch these examples in "debug" mode (to set breakpoints, step through code).  When I run with debug, I am told that a dependant dll is missing.  Here is the full output from a debug/win32 session when I click "Local Windows Debugger":

'CapsBasic.exe' (Win32): Loaded 'C:\_CVWork\OpenCL\intel_ocl_caps_basic_win\CapsBasic\Win32\Debug\CapsBasic.exe'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\OpenCL.dll'. Cannot find or open the PDB file.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Symbols loaded.
'CapsBasic.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Symbols loaded.
The program '[11500] CapsBasic.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'.

To clarify, I do have the API debug options set in the Code-Builder->Open CL Debugger->Options... window ("Enable OpenCL kernel debugging for CPU device" box is checked, as is "Enable remote OpenCL kernel debugging for GPU device").

Appreciate any insight on how to get breakpoints / debug runs working with the sample code using VS2015.


0 Kudos
3 Replies

To enable debugging you need to add "-g -s <path to OpenCL kernel>" as described here:

For example:

clBuildProgram(ocl->program, 1, &ocl->device, "-g -s \"C:/Users/me/Desktop/OCLtest/debugtest/debugtest/\"", NULL, NULL);

A nice feature of the Code Builder integration in Visual Studio is that you can start a new project with everything set up for debugging -- so the above will be auto-generated for you.

0 Kudos

Hi Jeff,

I have followed your steps of creating the new solution in Debug mode.

Even after that I am not able to hit breakpoint in debug mode.

I have attached my host code file for your reference.

wrt to adding the path to the clbuildprogram, in some examples it says the extension should  be in txt and in your case the extension is .cl

Can you please help me in this.

I am using 

- Microsoft Visual Studio 2015

- Intel Code Builder version

(Somehow I feel their is a issue in this version for hitting breakpoint in kernel, as I have tried all possible solutions)

0 Kudos

After changing your clBuildProgram path (line 586 in OpenCLProject3.cpp) to where the kernel is found on my system

err = clBuildProgram(ocl->program, 1, &ocl->device, " -g -s \"C:\\path\\to\\kernel\\files\\\"", NULL, NULL);

your source worked for me with this change:  (line 783 in OpenCLProject3.cpp)


cl_device_type deviceType = CL_DEVICE_TYPE_GPU;


cl_device_type deviceType = CL_DEVICE_TYPE_CPU;


More info on debug setup can be found at  From there:


Debugging is available only for CPU device. If the code should run on Intel Graphics, debug on CPU device during development phase, then change the target device.


Does this change let you stop at a breakpoint and step through your kernel code?

0 Kudos