cudafy.net with NSight, debugger not working

让人想犯罪 __ 提交于 2019-12-11 04:56:14

问题


As the topic states, I cant get the debugger working. Below is the sequence of steps ive done.

Note: I have Cuda 5.0 installed and NSight visual studio edition 3.0 installed. Ive heard that it is possible to debug now with a single GPU. I'm assuming 5.0 is OK and I don't need the 5.5 release candidate?

1) Changed code to include the following as per the instructions on the site:

        CudafyModes.Target = eGPUType.Cuda;
        CudafyModes.DeviceId = 0;
        CudafyTranslator.Language = eLanguage.Cuda;
        CudafyModule km = CudafyTranslator.Cudafy(eArchitecture.sm_20);

        //Included this line.
        CudafyTranslator.GenerateDebug = true;

        _gpu = CudafyHost.GetDevice(eGPUType.Cuda);
        _gpu.LoadModule(km);

2) Set a break point just after this.

3) Stopped debugging once break point was hit.

4) Solution Explorer, selected "Show all files" and found the "CUDAFYSOURCETEMP.cu" file.

5) Right clicked and selected "Add to project".

6) Open NSIGHT HUD Launcher 3.0.

7) Set setting as follows:

8) Clicked ok.

9) Double clicked CUDAFYSOURCETEMP.cu and set a break point in the code.

10) Went to the NSight Monitor and click "NSight Monitor Ooption" -> CUDA and the set the following:

11) Went back to VS2010 and selected NSight-> Start Cuda Debugging.

once that's done, I hovered the cursor over variables, once the break point has been hit, but nothing shows up. Only ones which show something are blockDim, blockIdx and threadIdx.

I've also opened the CUDA WarpWatch1 window, typed in a variable yet that's giving the following error "Could not resolve name "num2".

Am i missing a step or something?

EDIT Here is the output from the Output window during compilation.

The thread 'vshost.LoadReference' (0x1f78) has exited with code 0 (0x0). 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\FrazMann\Desktop\Market Adj Entry CUDA - MK2\FrazerMann.Profiler.UserInterface\bin\x64\Debug\FrazerMann.Profiler.UserInterface.exe', Symbols loaded. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\FrazMann\Desktop\Market Adj Entry CUDA - MK2\FrazerMann.Profiler.UserInterface\bin\x64\Debug\Cudafy.NET.dll' 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data.OracleClient\v4.0_4.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll' 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly' 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll' 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.SqlXml\v4.0_4.0.0.0__b77a5c561934e089\System.Data.SqlXml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.Composition\v4.0_4.0.0.0__b77a5c561934e089\System.ComponentModel.Composition.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Build.Framework\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Framework.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll' 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices.Protocols\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.Protocols.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. FrazerMann.Profiler.UserInterface.TaskManager x threadIdx x blockIdx x blockDim Length Length x threadIdx x blockIdx x blockDim Length x threadIdx x blockIdx x blockDim GetLength x threadIdx x blockIdx x blockDim QuickSortOfValues1 x threadIdx x blockIdx x blockDim QuickSortOfValues1 QuickSortOfValues1 FrazerMann.Profiler.UserInterface.TaskManager/o__SiteContainer0 Compiler version: v5.0 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -m64 -arch=sm_20 "C:\Users\FrazMann\Desktop\Market Adj Entry CUDA - MK2\FrazerMann.Profiler.UserInterface\bin\x64\Debug\CUDAFYSOURCETEMP.cu" -o "C:\Users\FrazMann\Desktop\Market Adj Entry CUDA - MK2\FrazerMann.Profiler.UserInterface\bin\x64\Debug\CUDAFYSOURCETEMP.ptx" --ptx CUDAFYSOURCETEMP.cu tmpxft_000010d0_00000000-5_CUDAFYSOURCETEMP.cudafe1.gpu tmpxft_000010d0_00000000-10_CUDAFYSOURCETEMP.cudafe2.gpu

'FrazerMann.Profiler.UserInterface.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.


回答1:


Unless you specify the -G switch to the nvcc compiler driver, there will be no symbols, and the debugger can't do what you want (identify or show specific variable values) without symbols.

It seems like others have asked how to add the -G switch to the nvcc compilation phase within cudafy, and one approach seems to be discussed here.




回答2:


The mistake you're making is to put CudafyTranslator.GenerateDebug = true; after the CudafyTranslator.Cudafy call.

If you do this, the translator has already generated the GPU binaries without the symbols, then you tell it symbols are needed.

To fix this, simply put CudafyTranslator.GenerateDebug = true; before the CudafyTranslator.Cudafy call.



来源:https://stackoverflow.com/questions/17612664/cudafy-net-with-nsight-debugger-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!