Debug kernels

Debug kernels

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

http://spectralbattle.wordpress.com/
17 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

Of course, thanks,1 - I compile the specific kernel with -g -s XXXXX_THE_PATH_XXXXX2 - I open the .cl file with VS 2008 (It is not part of the project)3 - I put a break point4 - I execute...But it never stop on the break point !Thanks

http://spectralbattle.wordpress.com/

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..

http://spectralbattle.wordpress.com/

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?

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

http://spectralbattle.wordpress.com/

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 ?

http://spectralbattle.wordpress.com/

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

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

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...

http://spectralbattle.wordpress.com/

Similar problem here,1- Kernel is written in a separate file2-In VS2008 Tools > Intel OpenCL Kernel Debugger the check box "Enable OpenCL Kernel Debuggin" is checked3- Before starting host application I put breakpoint in the kernel source code file4- 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

Similar problem here,1- Kernel is written in a separate file2-In VS2008 Tools > Intel OpenCL Kernel Debugger the check box "Enable OpenCL Kernel Debuggin" is checked3- Before starting host application I put breakpoint in the kernel source code file4- 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

Hi _phoenix_,

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

Hi,1) Is there a way to download SDK 1.4 to check if the crash in my application occur only with SDK 1.52) 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

http://spectralbattle.wordpress.com/

Hello Polar01,

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

Thanks,
Yuri

Thanks,I don't want it to be public !! It is more than 20 Mb too !!!

http://spectralbattle.wordpress.com/

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.

Leave a Comment

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