OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
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.

Debug kernels

Polar01
Beginner
392 Views
Hi,
I try to use your new tool to debug some OpenCL kernels and have some problems.
1 - Some kernels are generated at run-time and there is no file related to this kernel !
2 - I launch several kernels, but specify only one file in clBuildProgram (-g -s xxxx). In this case it seems that the debugger is blocked at the first clFinish, but the kernel I would like to debug is another one, a post-processing kernel that need several other steps !
Not sure you can solve the problems today, but for the futur it will be great to be able to handle theses cases !
Thanks
0 Kudos
16 Replies
Eli_Bendersky__Intel
392 Views
Hi Polar01,

  1. Indeed, such scenario isn't currenly supported. To place breakpoints in an OCL file, you should be able to open it in Visual Studio. To be able to do that, this file must exist somewhere on disk. We will consider improving support for generated code (and code taken from strings in general), in future releases.
  2. Can you be more specific about your scenario? The debugger supports multiple OCL files and multiple kernels, as long as you compile the files you want to debug with the special flags. Where did you place the breakpoints? It would be best if you could re-create a minimal example that demonstrates your problem and send it to us. It doesn't have to contain your proprietary code - just a dummy sample that doesn't behave as you'd expect.
Polar01
Beginner
392 Views
Of course, thanks,
1 - I compile the specific kernel with -g -s XXXXX_THE_PATH_XXXXX
2 - I open the .cl file with VS 2008 (It is not part of the project)
3 - I put a break point
4 - I execute...
But it never stop on the break point !
Thanks
Polar01
Beginner
390 Views
In fact, when I activate the debugger I got an access violation !

Notes that, I have tested my application with the AMD SDK and also on a NVIDIA GPU... it works ! I think that it was working with the previous version of the Intel SDK but not the 1.5 !

Is there a way to download the old SDK to verify if it work with 1.4 ?
First-chance exception at 0x0c66206a in pureStudio.exe: 0xC0000005: Access violation reading location 0x000009e0.
First-chance exception at 0x0c66206a in pureStudio.exe: 0xC0000005: Access violation reading location 0x000009e0.
First-chance exception at 0x758bb9bc in pureStudio.exe: Microsoft C++ exception: tbb::captured_exception at memory location 0x0bac1794..
First-chance exception at 0x758bb9bc in pureStudio.exe: Microsoft C++ exception: tbb::captured_exception at memory location 0x0fc7fac4..
First-chance exception at 0x0c66206a in pureStudio.exe: 0xC0000005: Access violation reading location 0x000009e0.First-chance exception at 0x0c66206a in pureStudio.exe: 0xC0000005: Access violation reading location 0x000009e0.First-chance exception at 0x758bb9bc in pureStudio.exe: Microsoft C++ exception: tbb::captured_exception at memory location 0x0bac1794..First-chance exception at 0x758bb9bc in pureStudio.exe: Microsoft C++ exception: tbb::captured_exception at memory location 0x0fc7fac4..
Eli_Bendersky__Intel
391 Views
Could you clarify what you mean by "when I activate the debugger"?

If you compile this kernel without the debug options (i.e. without "-g") - does it run normally and produce correct result?

If you then compile this kernel with the debug options, what happens?

Polar01
Beginner
392 Views
1) Activate the debugger = check "Enable OpenCL Kernel Debuggin" in Tools->Intel OpenCL Debugger

2/3) In fact, my kernels works fine with AMD SDK, NVidia SDK but not well with the last Intel SDK.
In fact it crash when I call of a specific kernel (this one is EMPTY), then I call clFinish, then I call another kernel and call clFinish <= it crash at the last clFinish !
If I don't call the kernel 'kernel__ToneMapping' it never crash !!!!
__kernel
__attribute__((vec_type_hint(float4)))
void kernel__ToneMapping(
__constant __read_only clFilmSettings* filmSettings,
__global __write_only uchar4* rgba,
__global __read_only clIrradianceItem* irradianceCache,
__global __read_only float* responseCurveR,
__global __read_only float* responseCurveG,
__global __read_only float* responseCurveB,
int workAmount)
{
__kernel__attribute__((vec_type_hint(float4)))void kernel__ToneMapping( __constant __read_only clFilmSettings* filmSettings, __global __write_only uchar4* rgba, __global __read_only clIrradianceItem* irradianceCache, __global __read_only float* responseCurveR, __global __read_only float* responseCurveG, __global __read_only float* responseCurveB, int workAmount){ }
I would like to download the SDK 1.4 to check if it works, but can't find a link !
Thanks
Polar01
Beginner
392 Views
Ah yes, something else. All my kernels are composed from several .CL files. The file I specify in clBuildProgram is the one that contains the 'kernel'. Of course there is no reference to the other files !
Also, I work now on a i7-2600, previously it was an old intel CPU !
I think that it is a Sandy Brige CPU, so maybe there are some options to avoid AVX instructions and to use 'basic' instructions like with previous CPU version ?
Doron_S_Intel
Employee
392 Views
If memory serves, __read_only and __write_only are image qualifiers.
The __attribute__(vec_type_hint(float4)) has an extra set of parenthesis, and already ensures no AVX code will run.
Does the kernel execute properly with Intel OpenCL SDK 1.5 with the debugger disabled and the program built without debug information?

Thanks,
Doron
Evgeny_F_Intel
Employee
392 Views
Hi,

Please make sure Win7 SP1 is installed on your machine.

Small correction to the:
The __attribute__(vec_type_hint(float4)) has an extra set of parenthesis, and already ensures no AVX code will run

Usage on the attribute doesn't apply on the instruction set being used.

Evgeny
Polar01
Beginner
392 Views
1) When I use__attribute__(vec_type_hint(float4)) I receive an error message !
error: expected '(' after '('
But when using__attribute__((vec_type_hint(float4))) it seems that it works.
2) This parameter allow to run the application is a specific context (minimum one). But for a more complex version I still have problems...
_phoenix_
Beginner
392 Views
Similar problem here,
1- Kernel is written in a separate file
2-In VS2008 Tools > Intel OpenCL Kernel Debugger the check box "Enable OpenCL Kernel Debuggin" is checked
3- Before starting host application I put breakpoint in the kernel source code file
4- Kernel is compiled in the host code withclBuildProgram using option "-g -s "
5- Finally, host application is started in debug.
It never stop on the breakpoint.
Thanks
_phoenix_
Beginner
392 Views
Similar problem here,
1- Kernel is written in a separate file
2-In VS2008 Tools > Intel OpenCL Kernel Debugger the check box "Enable OpenCL Kernel Debuggin" is checked
3- Before starting host application I put breakpoint in the kernel source code file
4- Kernel is compiled in the host code withclBuildProgram using option "-g -s "
5- Finally, host application is started in debug.
It never stop on the breakpoint.
Thanks
Eli_Bendersky__Intel
392 Views
Hi _phoenix_,

Could you reproduce it on a minimal MS VC++ project and attach it along with the kernel code?

Polar01
Beginner
392 Views
Hi,
1) Is there a way to download SDK 1.4 to check if the crash in my application occur only with SDK 1.5
2) Is there a way to send you my application in order to reproduce the crash on your side and allowing you to fix the bug ?
Thanks
Yuri_K_Intel
Employee
392 Views
Hello Polar01,

2) Use "Add Files" button on the submit message form.

Thanks,
Yuri
Polar01
Beginner
392 Views
Thanks,
I don't want it to be public !! It is more than 20 Mb too !!!
Eli_Bendersky__Intel
391 Views
Polar01,

Feel free to send it to me by email - eli.bendersky@intel.com

Please specify in the body of the email exactly how to compile and run your application, and what is the expected results vs. what you're getting (the error). Also, try to keep the example minimal.

P.S. I don't see why a zipped code sample should be as large as 20 MB. All that's needed is your source code files + Visual Studio solution and project file. The build results, PDBs and the intellisense database files are not required.
Reply