11 Replies Latest reply on Sep 12, 2012 11:14 AM by binying

    app hang when use printf in kernel

    mikewolf_gkd

          I wrote a simple opencl program, but when I use printf debug kernel code, app hang, but comment on printf code, app get correct result.

      my os: win7, amd app sdk 2.7, my display card: redwood.

          I rember before, not this issue in sdk 2.3, bug?

       

      who can help me test it?

      source code in :http://files.cnblogs.com/mikewolf2002/gclTutorial4.zip

       

       

      http://images.cnblogs.com/cnblogs_com/mikewolf2002/201209/201209071947275287.png

          • Re: app hang when use printf in kernel
            binying

            1>  main.cpp

            1>main.cpp(31): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

            1>main.cpp(35): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

            1>  gclTimer.cpp

            1>  gclFile.cpp

            1>gclFile.cpp(14): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

            1>          c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen'

            1>gclFile.cpp(31): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

            1>          c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen'

            1>  Generating Code...

            1>RC : fatal error RC1110: could not open debug\gclTutorial4_manifest.rc

            1> 

            1>

            1>Build FAILED.

            1>

            1>Time Elapsed 00:00:03.03

            ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

              • Re: app hang when use printf in kernel
                binying

                Note that you didn't include a solution file in the source code...

                • Re: app hang when use printf in kernel
                  mikewolf_gkd

                  you can build a empty windows console solution, add all head file and cpp file to it

                    • Re: app hang when use printf in kernel
                      binying

                      That's what I did. Would you mind upload it again? So that everybody else can try it too. 

                        • Re: app hang when use printf in kernel
                          mikewolf_gkd

                          hi,there is a solution, including all projects, hang issue is in project 4

                            • Re: app hang when use printf in kernel
                              binying

                              I downloaded the zip file. Deleted the projects other than gclTutorial4. Since it fails compilation, I added the additioninclude/library path in order to use the opencl head file. I still get the following error. I am using A6, win7, vs2010, sdk 2.7 and the latest driver.

                               

                              --------------------------

                               

                               

                              1>------ Rebuild All started: Project: gclTutorial4, Configuration: Debug Win32 ------

                              1>Build started 9/11/2012 3:26:41 AM.

                              1>_PrepareForClean:

                              1>  Deleting file "Debug\gclTutorial4.lastbuildstate".

                              1>InitializeBuildStatus:

                              1>  Touching "Debug\gclTutorial4.unsuccessfulbuild".

                              1>ClCompile:

                              1>  main.cpp

                              1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\main.cpp(31): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

                              1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\main.cpp(35): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

                              1>  gclTimer.cpp

                              1>  gclFile.cpp

                              1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\gclfile.cpp(14): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

                              1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

                              1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\gclfile.cpp(31): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

                              1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

                              1>  Generating Code...

                              1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

                              1>

                              1>Build FAILED.

                              1>

                              1>Time Elapsed 00:00:03.73

                              ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========