IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> OpenCL Visual Profiler, Bug in profiling own code
makoto
post Sep 30 2009, 10:22 AM
Post #1



*

Group: Members
Posts: 2
Joined: 30-September 09
Member No.: 195,055
Org.: University Of Mannheim



Hi there,

yesterday I downloaded the OpenCL Visual Profiler to profil my own open cl kernel. The problem is that the profiler
always ends in an "Empty header line found in CSV files" or an "Error in reading the result" error message.

I've tried the profiler on the sdk examples and everything went just fine.
But after switching back to my kernel the problem remains the same.

The created csv files are empty and ... yeah nothings happens.

My code simple copies a defined post of an image to another one
in another image... even If strip down the kernel to only do a simple log computation
it ends in the above error message.

Just to clarify once more:
I don't use oclUitls or shrUtis... I do all the initialization of the code myself.
And the kernel works well under Linux and Snow Leopard

makoto
Go to the top of the page
 
+Quote Post
cgorac
post Sep 30 2009, 11:43 AM
Post #2



**

Group: Members
Posts: 12
Joined: 9-December 07
Member No.: 82,390



Duh - was going to ask exactly the same question... Same symptoms: I'm able to profile SDK samples, but when I run my program in the profiler, "Error in reading profiler output." is reported, and the CSV files generated by profiler are empty. The program is about image processing, and is doing its job properly (the resulting image is always generated, which means the kernel is run for sure). I had profiling turned on in my command queue, as I was printing the kernel execution time, but I turned it off now, still the same error is reported. The only unusual thing about the program is that it is linked with Qt library, albeit with QtCore subsystem only, as I'm using it to embed the kernel source code within the program executable.

This post has been edited by cgorac: Oct 1 2009, 07:59 PM
Go to the top of the page
 
+Quote Post
belgarath02
post Oct 16 2009, 07:48 AM
Post #3



*

Group: Members
Posts: 1
Joined: 16-October 09
Member No.: 197,177
Club SLI Member: No



Hi,

I've got the same problem, I tried to look in the demo makefile or in the source code, but I didn't found anything special. So I'm also interested by the answer. And by the way, is there another way to profile OpenCL code ?

Matthieu

(I'm running under lunix ferdora 10, geForce 8600 GTS)
Go to the top of the page
 
+Quote Post
jan.heckman
post Oct 26 2009, 03:39 PM
Post #4



*

Group: Members
Posts: 9
Joined: 24-November 08
Member No.: 127,342



Struggled with the same problem. Thought I beat it, I get profiler output on a non-SDK project.
Project is a visual c++ routine loading a program with two kernels and executing them on, I hardly dare say, on a not supercool Geforce 8500 GT.
When I then use the same VC++ program to load another, but rather similar openCL program, it refuses to do the job, claiming error in reading profiler output, empty .csv's as noticed by others as well.
There is no difference whether I read the .cl files or the .ptx files which I generated from the .cl files. In both cases one program works, the other does not. The output in the output window of the profiler is the same as when the program runs alone, i.e. it runs without errors of any kind. Further, the execution in the profiler takes about 10 seconds (both programs), much less than the 30 second exec time limit.
To make matters more interesting, the opencl program that profiles correctly is mine, or at least a very much reworked version of oclNbodyKernel.cl; the one that won't profile is a slightly simplified but virtually original oclNbodyKernel. There's only one commandqueue used, and only one program is loaded at a time.
I have no inkling where to look futrher pinch.gif . I assume no profiling info is generated, so I am interested to know what factors, in addition to setting CL_QUEUE_PROFILING_ENABLE in the commandqueue, determine this, or any suggestions you guys might make.
Jan

AMD athlon 64 X2 4200+, win7 64 build 7201, driver version 191.07, VS2008, visual profiler 1.02. The VC++ program does not use oclutil etc.
Go to the top of the page
 
+Quote Post
cgorac
post Oct 26 2009, 05:40 PM
Post #5



**

Group: Members
Posts: 12
Joined: 9-December 07
Member No.: 82,390



So - can you post both "working" and "non-working" versions of your code, or at least the diff, so that maybe someone could try on different hardware and/or try to get some further clue on this issue?
Go to the top of the page
 
+Quote Post
jan.heckman
post Oct 27 2009, 08:38 AM
Post #6



*

Group: Members
Posts: 9
Joined: 24-November 08
Member No.: 127,342



QUOTE (cgorac @ Oct 26 2009, 06:40 PM) *
So - can you post both "working" and "non-working" versions of your code, or at least the diff, so that maybe someone could try on different hardware and/or try to get some further clue on this issue?


Hi,
Thanks for the interest.
Try an svn from http://nbodysim.googlecode.com/svn/branches/triangsimp.
Is VC++ including projectfile and oclpj file.
Hope you 're not allergic to MS..
Jan

PS I owe you guys some explanation:
top line of the common.h file defines RUNRINGTEST. That will load ringtest.cl and profiling should be ok.
Comment this line out and NbodyKernel.cl will be loaded instead, and profiling - at least in my case/setup - fails.
Question is of course, why?
Difference between the two programs is that they are called by different, but very similar functions in host-program.cpp (top of the file), ringtest has two kernels rather than 1.
In this setup the profiler-action is the same in both cases, just add a session with the recompiled executable.
The projectfile uses an environment variable OPENCL pointing at the common directory, e.g.
OPENCL=C:\Users\Jan\AppData\Local\NVIDIA Corporation\NVIDIA GPU Computing SDK\OpenCL\common
Hope this will allow you to recreate my problem.

Have added a little extra, i.e. measuring GPU time through clGetEventProfilingInfo(). This shows that profiling is available.
Also, I noticed that specifying an event in the command to be profiled (such as clEnqueueNDRangeKernel(), last param <> NULL) will cause the profiler to fail. See code, use GET_GPU_TIME in common.h. To get any result from the profiler, comment this line out.

This post has been edited by jan.heckman: Oct 27 2009, 08:59 PM
Go to the top of the page
 
+Quote Post
cgorac
post Nov 6 2009, 06:59 PM
Post #7



**

Group: Members
Posts: 12
Joined: 9-December 07
Member No.: 82,390



Jan,

Thanks for posting link to your code (and sorry for not replying before, but that was because the forum was down). I'm not allergic to MS, but unfortunately I do not have a Windows installation available. So I tried to make changes in your code to have it build under Linux, but it is just too much of the work... I've installed today the 3.0 SDK beta, in the hope that this issue with the profiler may be fixed, but unfortunately it is still there - the profiler is handling all of SDK samples I tried without any problem, but it keeps reporting "Error in reading profiler output" on my code. I tried to check what's going on with strace, but early on the first run of any kind of program (my program, or any of SDK samples I tried), strace is segfaulting. I tried with number of changes in my code, including removing setting event parameters to clEnqueueNDRangeKernel(), but again to no avail. So - anyone (especially NVIDIA guys): is there any kind of suggestion on how to further debug why it may happen that OpenCL profiler is not writing anything to corresponding CSV files during the profiled program execution?
Go to the top of the page
 
+Quote Post

Fast ReplyReply to this topicStart new topic

 



Copyright 2008 NVIDIA Corporation.  Terms of Use | Legal Info | Privacy Policy Time is now: 24th November 2009 - 12:47 AM
Unites States Argentina Brazil Chile China Colombia France Germany India Italy Japan Korea Mexico Poland Russia Spain Taiwan United Kingdom Venezuela