18 Replies Latest reply on Jun 11, 2010 2:19 AM by bpurnomo

    ATI stream profiler declines to profile

    david_aiken

      hi..

      I'm trying to profile a 32-bit debug build of an OpenCL Visual Studio 2008 solution on Windows 7 64-bit. I can manually build and run the solution from within Visual Studio and have write permission to the directories, but when i try to run the executable using the profiler from within the OpenCL Session Panel i see the following error:

      ATI Stream Profiler
      The program failed to profile. Try to compile the active project manually and make sure you have a write access permission to the project's directory.

      Any ideas?


      thanks

        • ATI stream profiler declines to profile
          bpurnomo

          Hi David,

             Do you have the working directory set in the project's property pages?  If so, what is it set to?

          Also can you check in your project's directory: does a ProfilerOutput directory get created?  Are there any files in that directory?

            • ATI stream profiler declines to profile
              david_aiken

               

              Originally posted by: bpurnomo Hi David,

               

                 Do you have the working directory set in the project's property pages?  If so, what is it set to?



              No, it is not set. There are builds for multiple targets and they all pull the same OpenCL kernel source files from the solution directory.

               

              Also can you check in your project's directory: does a ProfilerOutput directory get created?  Are there any files in that directory?


              No directory is created.

                • ATI stream profiler declines to profile
                  bpurnomo

                  Would it be possible to get an access to your project?  That would be easier for us to debug otherwise we'd need to try several guesses to pin point the problem.

                   

                    • ATI stream profiler declines to profile
                      david_aiken

                      Regrettably not as the project is rather large with dependencies on proprietary builds.

                      Is there a log somewhere which indicates the source of the problem? There is a command window which opens up temporarily with a line of text in it, but it disappears too quickly to see anything.

                        • ATI stream profiler declines to profile
                          bpurnomo

                          There is no log generated by the tool. However, your error message points to either:

                          (1) the profiler is not able to run your OpenCL's app successfully and/or

                          (2) it fails to generate the output csv file (this will reside in ProfilerOutput's directory inside your project's directory) possibly due to file access permission.  It is strange that you are not able to find the ProfilerOutput directory (perhaps we are looking at the wrong path) since if it is not able to generate the ProfilerOutput directory, it will show a different error message.

                          I'm guessing the problem is due to (1) rather than (2).  There could be several reasons for this problem.

                          To help us narrow down the problem, can you answer the following few questions?

                          1. To make sure that the problem is not specific to your installation or machine settings, are you able to run the profiler successfully using any of the ATI Stream SDK samples?
                          2. Does your solution file include multiple projects? Can you find the ProfilerOutput under the project's directory (not the solution's directory)?  Please confirm that you have write access permission in the project's directory (try creating some files in the directory).
                          3. Are you using the OpenCL C++ bindings?
                          4. Can you try the following: Explicitly set the Working Directory field in the project's property pages to the full path of the solution directory (where the OpenCL source kernel files reside) and run the profiler again.
                          5. Are you using user defined macros in the OutputDirectory or the OutputFile field in the project's property pages?  If not, can you post what are they set to?
                            • ATI stream profiler declines to profile
                              david_aiken

                               

                              To make sure that the problem is not specific to your installation or machine settings, are you able to run the profiler successfully using any of the ATI Stream SDK samples?


                              I tried profiling the Template project, contained in the ATI Stream SDK 2.0 OpenCLSamples solution, using Debug/Win32 configuration and the same failure dialog box appears. It does build/run from within Visual Studio. I didn't try the other samples.. please let me know if you think one of them might provide more info.

                               

                              Does your solution file include multiple projects?


                              Yes. The OpenCL project is set as the startup project and does build/run from within Visual Studio.

                               

                              Can you find the ProfilerOutput under the project's directory (not the solution's directory)?


                              No. It is under the solution directory only.

                               

                              Please confirm that you have write access permission in the project's directory (try creating some files in the directory).


                              The solution does build and i assume that the profiler uses the same account as Visual Studio so the permissions would seem to be ok. Just In Case i created a text file in the TargetDir from within Visual Studio without any problems. I do notice that a ProfilerOutput subdirectory containing .CounterFile.txt is created below the solution directory.

                               

                              • Are you using the OpenCL C++ bindings?


                              No.

                               

                              Can you try the following: Explicitly set the Working Directory field in the project's property pages to the full path of the solution directory (where the OpenCL source kernel files reside) and run the profiler again.


                              I set the Debugging Working Directory to $(TargetDir) in the project properties. On running it generates the .il and .isa files in that directory (formerly they were created in the solution directory) and runs properly from within Visual Studio. It still gives the same error when i try to profile it, though. Just to be sure i also set the Working Directory to an explicit directory path (rather than a macro) - same problem.

                               

                              Are you using user defined macros in the OutputDirectory or the OutputFile field in the project's property pages?  If not, can you post what are they set to?


                              OutputDirectory: bin

                              OutputFile: $(OutDir)\AMD\32bit\$(ProjectName)AMD32.exe

                               

                              hmm.. another thought comes to me. I am also running an NVidia GTX 275 on the same box (which is targetted by some of the other builds in my solution). Perhaps the profiler is not finding the Sapphire 5850 GPU.

                               

                                • ATI stream profiler declines to profile
                                  david_aiken

                                  I managed to catch the clprofile.exe cmd window output:

                                  Click to start application: 2: The system cannot find the file specified.

                                  • ATI stream profiler declines to profile
                                    bpurnomo

                                     

                                    Originally posted by: david_aiken
                                    To make sure that the problem is not specific to your installation or machine settings, are you able to run the profiler successfully using any of the ATI Stream SDK samples?


                                     

                                    I tried profiling the Template project, contained in the ATI Stream SDK 2.0 OpenCLSamples solution, using Debug/Win32 configuration and the same failure dialog box appears. It does build/run from within Visual Studio. I didn't try the other samples.. please let me know if you think one of them might provide more info.

                                     

                                     

                                    Originally posted by: david_aiken I managed to catch the clprofile.exe cmd window output:

                                    Click to start application: 2: The system cannot find the file specified.

                                    The aboves suggest that there is a problem with the OpenCL SDK installation or the ATI driver in your box.

                                    Some more questions that I have:

                                    1. Can you tell us the directory that you installed OpenCL SDK 2.0 to? Basically what is the environment variable $ATISTREAMSDKROOT set to?
                                    2. Please list all the files under $ATISTREAMSDKROOT\bin\x86 and $ATISTREAMSDKROOT\lib\x86.
                                    3. Did you install ATI Catalyst 9.12 Hotfix?
                                    4. Did you perform any custom modification (moving/renaming files, etc) to the installation of the SDK and driver? 
                                    5. What are the timestamps of the following three files in C:\Windows\System32? aticalrt.dll, aticalcl.dll aticaldd.dll
                                    6. You mentioned there is a Nvidia GTX 275 installed in the same box?  Is there an OpenCL.dll file in the C:\Windows\System32?  Try moving this nvidia file out of the directory.
                                      • ATI stream profiler declines to profile
                                        david_aiken

                                         

                                        Can you tell us the directory that you installed OpenCL SDK 2.0 to? Basically what is the environment variable $ATISTREAMSDKROOT set to?


                                        ATISTREAMSDKROOT=C:\Program Files (x86)\ATI Stream\

                                        The profiler is under the Tools subdirectory.

                                         

                                        Please list all the files under $ATISTREAMSDKROOT\bin\x86 and $ATISTREAMSDKROOT\lib\x86.


                                         Volume in drive C is Windows7
                                         Volume Serial Number is 1582-6880

                                         Directory of C:\Program Files (x86)\ATI Stream

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        01/01/2010  11:57 PM    <DIR>          bin
                                        01/01/2010  11:57 PM    <DIR>          docs
                                        01/01/2010  11:57 PM    <DIR>          include
                                        01/01/2010  11:57 PM    <DIR>          lib
                                        01/01/2010  12:40 AM    <DIR>          Tools
                                                       0 File(s)              0 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\bin

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        01/01/2010  11:57 PM    <DIR>          x86
                                        01/01/2010  11:57 PM    <DIR>          x86_64
                                                       0 File(s)              0 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\bin\x86

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:24 PM           968,704 as.exe
                                        12/10/2009  04:24 PM         6,996,992 atiocl.dll
                                        12/10/2009  04:24 PM         2,867,712 clc.exe
                                        12/10/2009  04:24 PM           785,408 ld.exe
                                        12/10/2009  04:24 PM         5,833,216 llc.exe
                                        12/10/2009  04:24 PM            49,664 OpenCL.dll
                                                       6 File(s)     17,501,696 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\bin\x86_64

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:23 PM         5,860,316 as.exe
                                        12/10/2009  04:23 PM        10,203,648 atiocl64.dll
                                        12/10/2009  04:23 PM         3,792,384 clc.exe
                                        12/10/2009  04:23 PM         5,498,007 ld.exe
                                        12/10/2009  04:23 PM         8,712,704 llc.exe
                                        12/10/2009  04:23 PM            50,176 OpenCL.dll
                                                       6 File(s)     34,117,235 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\docs

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:23 PM            45,056 ATI_Stream_SDK_FAQ.pdf
                                        12/10/2009  04:23 PM            59,375 ATI_Stream_SDK_Getting_Started_Guide_v2.0.pdf
                                        12/10/2009  04:23 PM                92 StreamDoc.url
                                                       3 File(s)        104,523 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\include

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:23 PM            55,205 cal.h
                                        12/10/2009  04:23 PM            13,423 calcl.h
                                        12/10/2009  04:23 PM            14,187 cal_ext.h
                                        12/10/2009  04:23 PM             8,157 cal_ext_counter.h
                                        12/10/2009  04:23 PM             7,025 cal_ext_d3d10.h
                                        12/10/2009  04:23 PM             8,602 cal_ext_d3d9.h
                                        01/01/2010  11:57 PM    <DIR>          CL
                                                       6 File(s)        106,599 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\include\CL

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:23 PM            43,518 cl.h
                                        12/10/2009  04:23 PM           227,683 cl.hpp
                                        12/10/2009  04:23 PM             2,791 cl_d3d10.h
                                        12/10/2009  04:23 PM             6,084 cl_gl.h
                                        12/10/2009  04:23 PM            33,745 cl_platform.h
                                                       5 File(s)        313,821 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\lib

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:24 PM             4,464 aticalcl.lib
                                        12/10/2009  04:23 PM             4,298 aticalcl64.lib
                                        12/10/2009  04:24 PM             9,822 aticalrt.lib
                                        12/10/2009  04:23 PM             9,268 aticalrt64.lib
                                        01/01/2010  11:57 PM    <DIR>          x86
                                        01/01/2010  11:57 PM    <DIR>          x86_64
                                                       4 File(s)         27,852 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\lib\x86

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:24 PM             2,738 amdrt_x86.o
                                        12/10/2009  04:24 PM         9,554,348 builtins_amdil_opt.bc
                                        12/10/2009  04:24 PM         5,654,812 builtins_x86-32.bc
                                        12/10/2009  04:24 PM            18,870 OpenCL.lib
                                                       4 File(s)     15,230,768 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\lib\x86_64

                                        01/01/2010  11:57 PM    <DIR>          .
                                        01/01/2010  11:57 PM    <DIR>          ..
                                        12/10/2009  04:23 PM         9,554,348 builtins_amdil_opt.bc
                                        12/10/2009  04:23 PM         5,570,188 builtins_x86-64.bc
                                        12/10/2009  04:23 PM            17,504 OpenCL.lib
                                                       3 File(s)     15,142,040 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\Tools

                                        01/01/2010  12:40 AM    <DIR>          .
                                        01/01/2010  12:40 AM    <DIR>          ..
                                        01/01/2010  12:40 AM    <DIR>          ATI Stream Profiler 1.0
                                                       0 File(s)              0 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\Tools\ATI Stream Profiler 1.0

                                        01/01/2010  12:40 AM    <DIR>          .
                                        01/01/2010  12:40 AM    <DIR>          ..
                                        12/10/2009  05:43 PM             7,720 ATIStreamProfiler.html
                                        12/10/2009  05:45 PM            42,489 ATIStreamProfilerHelp.chm
                                        12/10/2009  05:45 PM            62,976 CLProfiler.dll
                                        01/01/2010  12:40 AM    <DIR>          x86
                                                       3 File(s)        113,185 bytes

                                         Directory of C:\Program Files (x86)\ATI Stream\Tools\ATI Stream Profiler 1.0\x86

                                        01/01/2010  12:40 AM    <DIR>          .
                                        01/01/2010  12:40 AM    <DIR>          ..
                                        12/10/2009  05:43 PM           283,648 clprofile.exe
                                        12/10/2009  05:44 PM           186,880 CLServer.dll
                                        12/10/2009  05:42 PM             4,096 detoured.dll
                                        12/10/2009  05:43 PM         1,904,128 GPUPerfAPICL.dll
                                                       4 File(s)      2,378,752 bytes

                                             Total Files Listed:
                                                      44 File(s)     85,036,471 bytes
                                                      38 Dir(s)  49,580,572,672 bytes free

                                         

                                        Did you install ATI Catalyst 9.12 Hotfix?


                                        I recall that i had to in order to get OpenCL to work. The driver date from the Windows control panel driver properties window is 12/14/2009 and the version is 8.682.2.0.

                                         

                                        Did you perform any custom modification (moving/renaming files, etc) to the installation of the SDK and driver?


                                        No, not to my knowledge. BTW the NVidia driver is also running, but it is not associated with the displays.

                                         

                                        What are the timestamps of the following three files in C:\Windows\System32? aticalrt.dll, aticalcl.dll aticaldd.dll


                                        These files are not present in the system directory. The following are in c:\Windows\System32\:

                                        12/14/2009  02:50 PM            39,936 aticalcl64.dll
                                        12/14/2009  02:49 PM         4,739,584 aticaldd64.dll
                                        12/14/2009  02:50 PM            43,008 aticalrt64.dll

                                        and the following in c:\Windows\SysWOW64\:

                                        12/14/2009  02:49 PM            53,248 aticalcl.dll
                                        12/14/2009  02:48 PM         3,629,056 aticaldd.dll
                                        12/14/2009  02:50 PM            53,248 aticalrt.dll

                                         

                                        You mentioned there is a Nvidia GTX 275 installed in the same box?  Is there an OpenCL.dll file in the C:\Windows\System32?  Try moving this nvidia file out of the directory.


                                        Yes.. they place 64- and 32-bit versions of OpenCL.dll into the windows System32 and SysWOW64 subdirectories, respectively. When the NVidia 32-bit project runs, the debugger pulls OpenCL.dll from C:\Windows\SysWOW64\.

                                        When both opencl.dll files are moved under the temp directory, the NVidia projects pick up the AMD OpenCL.dll under the ATI Stream\bin subdirectories and do not run. The AMD projects continue to run, but the profiler still shows the same error dialog.

                                          • ATI stream profiler declines to profile
                                            bpurnomo

                                            Your files look alright.

                                            It is odd that the profiler can't generate the csv file (but it was able to generate IL and ISA files).

                                            Can you try the following from the command prompt:

                                            1. Goto C:\Program Files (x86)\ATI Stream\Tools\ATI Stream Profiler 1.0\x86\
                                            2. Type: clprofile.exe -o "C:\Session1.csv" -w "The full path of the working directory of your project" "The full path to the exe file of your project".  For example: clprofile.exe -o "C:\Session1.csv" -w "C:\myproject\bin" "C:\myproject\AMD\32bit\myprojectAMD32.exe"

                                            Does it generate a C:\Session1.csv file?  Can you please post the messages printed to the console?

                                             

                                              • ATI stream profiler declines to profile
                                                david_aiken

                                                I found the problem that was preventing the profiler from starting. The procmon tool from the System Internals suite shows that clprofile.exe is trying to open "C:\Perforce\fluids_v2\bin\AMD\32bit\fluids_OpenCL.exe". Unfortunately the Linker Output File property is set to "$(OutDir)\AMD\32bit\$(ProjectName)AMD32.exe". The profiler may be assuming that the executable name always matches the project name.

                                                If the Linker Output File is changed to "$(OutDir)\AMD\32bit\$(ProjectName).exe" then the profiler runs.

                                                Thanks for your help in tracking this down. IMHO it will save time if future versions of the profiler log fatal errors. Open-sourcing the profiler would be Even Better since it would allow me to keep my executable name :>.

                                                Can you tell me if the profiling results are valid on other operating systems? I'm not sure how much influence driver differences might have on performance.

                                                  • ATI stream profiler declines to profile
                                                    bpurnomo

                                                    I'm glad that you solved the issue with the profiler.

                                                    It is quite odd because the profiler doesn't make any assumption regarding the project name.  I am not able to reproduce this problem on my end either: I tried adding additional charaters to the Output File property for my sample, and the profiler is able to pick it up.

                                                    Adding better error reporting is in the profiler's roadmap.

                                                    I think the profiling results might be quite valid on other operating systems (if you use the same machine and driver version).  There is no guarantee though as the driver implementation might diverges.

                                                  • ATI stream profiler declines to profile
                                                    dwootton

                                                    I'm having a similar problem where when I try to start the profiler from within visual studio I get the same message. However, if I start the profiler manually as you describe, then it works and I get the csv file. I have a solution with multiple projects. I've tried setting the working directory under the debug tab of the configuration for the project containing the executable and the project containing the oOpenCL source. Is there another setting needed?

                                                      • ATI stream profiler declines to profile
                                                        bpurnomo

                                                        Can you try to create a solution file with a single project (VS can create this file automatically if you just open the .vsproj file and then save the project)?  Try profiling with this solution file instead.

                                                        We are currently investigating a problem when using the profiler with a solution file with multiple projects.

                                                        Can you also tell us your machine settings? OS, Visual Studio version, and graphics card?  Are you using a European version of the OS or Visual Studio? Please also post the OutputFile's field from your project's property pages.

                                                          • ATI stream profiler declines to profile
                                                            dwootton

                                                            bpurnomo:

                                                            I copied my source into a single project and rebuilt there. The profiler works there, although my column headings when viewing the profile data are Method, ExecutionOrder, GlobalWorkSize, GroupWorkSize, KernelTime, LocalMem, MemTransferSize, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17. Numbers are reported for each column that look like they are reasonable.

                                                            I'm running Windows 7 Home Premium October 2009 release

                                                            I have Visual Studio 2008 version 9.0.30729.1 + KB972221 update and KB971091 and KB973674 hotfixes. Windows and Visual Studio are both US versions

                                                            The 'OutputFile' in the project I copied was '$(OutDir)\$(ProjectName).exe'. When I copied this into the 'OutPutFile' for the main project in my multi-project configuration, the multi-project version seems to work correctly. The value in my OutputFile for the non-working case was 'Debug\qtphotoedit.exe'

                                                             

                                                              • ATI stream profiler declines to profile
                                                                bpurnomo

                                                                Thank you for working with me. 

                                                                I have been able to reproduce this problem in-house and fixed the issue in the system.  This bug should be fixed in the future release of the tool.

                                                                 

                                                                  • ATI stream profiler declines to profile
                                                                    drstrip

                                                                    Budi -

                                                                    in your last post on this topic back in January you said this problem would be fixed in the next release. Is that out and what is the version number? I'm having the same problem right now. The profiler has worked on other projects and is creating the ProfilerOutput directory in the Project directory, but otherwise failing to run on this project.

                                                                    Vista Enterprise, VS2008

                                                                      • ATI stream profiler declines to profile
                                                                        bpurnomo

                                                                        Yes.  This problem has been fixed since version 1.1 (Feb 2010).  Try the latest release (v1.3) and if you still encounter the problem, please let me know what is in the Linker Output File field of your project property.  Also make sure that the project can run successfully without the profiler.