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

Problems with Intel OpenCL SDK (printf not working, kernel debugging does not work)

jinzuu
Beginner
1,178 Views
Hi everyone,
I am currently developing an application which should use OpenCL, so I am evaluating all possible OpenCL SDKs currently available.
Now with the Intel SDK I have some serious issues which render the toolkit useless for me:
First of all I am not able to debug OpenCL kernels.
The kernels resides in an kernels.cl file on the disk and I am using VS2008. I compile the .cl file with the "-g" and the "-s " option.
But when I try to set a breakpoint in the kernel code VS shows it as unresolved and the program never stops.
Perhaps it has something to do with another "smaller" issue: When I enable "Intel OpenCL debugging" and the start the program it freezes in the clCreateContext-Function. So I have to enable the debugging after that function. Perhaps this is the problem why it does not halt on breakpoints? If so, why does it freeze von the clCreateContext call?
Another thing is that printf is not working. I am able to output simple text. But when I want to use arguments (e.g. "%d") then there are some segmentation faults which I cannot trace back to my program and the program loops endlessy somewhere.
I hope that there are some interesting ideas on how to fix these issues, because I am getting tired of not-working-OpenCL-Tools (almost every tool on the market)
Thanks in advance for you time and help
0 Kudos
9 Replies
Yuri_K_Intel
Employee
1,178 Views
Hello,

Regarding kernel debugging issues.
1. Could you please specify which package do you use - x86 or x64 and when did you download it? The x86 package was updated recently (November 8th) to incorporate a fix for kernel debugger. Please update it if you downloaded it earlier.
2. You definitely should set enable "Intel OpenCL debugging" before the debugging session.
3. In case of x64 package the following workaround should be used: enable "Intel OpenCL debugging" then quit the Visual Studio and open it again.

If you still unable to debug OpenCL kernel, could you please attach a small reproducer application and exact steps you perform.

Thanks,
Yuri
0 Kudos
Eli_Bendersky__Intel
1,178 Views
Hi jinzuu,

Please attach a reproducer for the printf problem as well - the simplest kernel where you observe the problem.

Thanks
0 Kudos
jinzuu
Beginner
1,178 Views
Hi Guys,
thank you for your answers. I was attached to another project in the meantime and I kinda lost focus on this issue.
I would like to address the debugger problem first, so I created a small project which just initializes the Intel-OpenCL-Platform, gets the devices and creates a context.
When I enable the OpenCL-Debugger and call the clCreateContext-Function, the application just hangs in there and never returns.
I am using the OpenCL-SDK 1.5 (32-bit).
System: Windows 7 Enterprise (64-bit), Intel Core i7-2600, Visual Studio 2008 (32-bit).
Hope this helps.
0 Kudos
Yuri_K_Intel
Employee
1,178 Views
Hi jinzuu,

I couldn't reproduce the issue so far with the attached application. Could you please check/confirm the following.
1) You start the debugging session with F5, and not Ctrl+F5 (Start Without Debugging).
2) You are able to reach clCreateContext function call line (either by stepping through the code or just putting a breakpoint at it).
3) There are two processes (icldbgsrv.exe and IntelOclError.exe) in the Processes window. Please, restart the Visual Studio if there is only IntelOclError.exe. You might have accidentally closed the icldbgsrv.exe console window because it pops up after several hours or so.
4) You press F10 at the clCreateContext function call line and you don't get any message box regarding the kernel debugger port number change. Please, try to change port number anyway. The working firewall might also cause the issue.

Thanks,
Yuri
0 Kudos
jinzuu
Beginner
1,178 Views
Hello Yuri,
I checked all points that you mentioned:
1) Yes I start the debug process with F5 (Start with Debugging)
2) Yes I am able to step to the line where clCreateContext is called
3) In task manager I can only see the icldbgsrv.exe process. The IntelOclError.exe is not running (I also haven't found any simliar executable in the installation folder of Intel's SDK)
4) Yes, I "Step over" the clCreateContext call. Then the application gets focus back and nothing happens. Also I don't get any error message. Changing the port or disabling the firewall didn't help
Thanks
0 Kudos
jhoeren
Beginner
1,178 Views

Hello everyone, same problem here, i.e. the debugger doesn't stop at any breakpoint. I am running Windows 7 64bit, Visual Studio 2010 Premium, OpenCL SDK 2012. I am following all the guidelines like compiling with -g and -s, enabling the OCL debugger, running with F5, .... but nothing helps. I've also tried to change the debugger port and also temporarily disabled the firewall - nothing. The only thing I recognized is that there's no IntelOclError.exe process running on my machine. I'd be very glad if someone could help me getting the debugger working. Thanks a lot in advance.

0 Kudos
youping_y_
Beginner
1,178 Views

    Just try solution here, find "ProfilerConfig.exe" and check the "Use Intel OpenCL Profiling Mode", apply and close.

the sdk set using GPU for default, obviously they failed to mention this in the document. ;)

0 Kudos
sirisha__nukala
Beginner
1,178 Views

hello !

I am new to the Opencl, till context API call everything was ok but when I am trying to call and create program object it's neither showing me the error nor success........output I am not getting ..........whether program object has created successfully or not.....May be I think it's runtime error but how to get rid from this????

please help me out in this...

 

0 Kudos
Michael_C_Intel1
Moderator
1,178 Views

Hi NukalaS,

The error presened in the screen shot is opaque.

In a windows environment, for debugging with Microsoft Visual Studio there are facilities for stepping through a program to identify source code progress and inspect variables.

OpenCL api calls have facilities to track error codes... An example:

cl_context clCreateContext(...) 

The last argument allows for developers to readback an error status that can be reconciled with headers:

cl_int *errcode_ret
 

From stdout of the program alone it's not possible to determine where issues in sources are.  It's also possible your error is related to some other runtimes that it links.

If the source is new please put it in a new thread, if it's related to an existing thread, please specify which source it is in the thread. Please ensure source can be shared (is not proprietary) and contains minimal capability required for issue reproduction. Please follow this guide here:

https://software.intel.com/en-us/articles/ocl-issue-reporting-guide

-MichaelC

0 Kudos
Reply