1

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:

Image

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:

Image

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".

Image

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.

talonmies
  • 70,661
  • 34
  • 192
  • 269
Hans Rudel
  • 3,433
  • 5
  • 39
  • 62
  • 1
    Are you building your device code with the `-G` (or `-G0`) option? The debugger requires symbols to resolve names in device code. – Robert Crovella Jul 12 '13 at 14:03
  • Im not sure, ive just followed what was listed on the cudafy.net site + what i had seen on one or two videos. I havent explicitly stated anything. Do i need to specify this in Code? Thanks for your help +1. – Hans Rudel Jul 12 '13 at 15:41
  • 1
    I'm definitely not an expert on cudafy. Is there any way you can look at the visual studio output window at the bottom when you are compiling your app, to see if you can see any command lines that contain `nvcc` in them? If so, that will be instructive to learn how it is compiling, and what flags are being specified. Certainly for an ordinary C++ project I could tell you how to make sure the -G switch is specified. it's ordinarily as simple as building the debug version (instead of release version) of the project. But this is something that may not be carried over to a C# project. – Robert Crovella Jul 12 '13 at 17:56
  • I'll check it out when i get back home and see if there is something shown. Thanks for your help so far though, i really appreciate it. – Hans Rudel Jul 12 '13 at 19:36
  • Not too sure about the "Skipped loading symbols" at the bottom. There is one nvcc, i'll highlight it in bold. – Hans Rudel Jul 13 '13 at 17:51
  • 1
    It does not look like you are building with symbols, which is why the debugger is not able to help you with variables. The `nvcc` command is compiling a temporary .cu file that is created by cudafy into ptx code, but there is no generation of symbols (`-G`). This [discussion](http://cudafy.codeplex.com/discussions/403375) seems to suggest how to manually specify options to the nvcc compiler. You may be able to add the -G option that way. Sorry, I'm really not that useful with cudafy. – Robert Crovella Jul 13 '13 at 18:59
  • No you have been extremely helpful thus far, thank you so much! There is a cudafy forum so i will update my question on there and hopefully, assuming i cant figure it out before hand, someone can help me sort the final issue. – Hans Rudel Jul 14 '13 at 00:29

2 Answers2

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.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
0

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.

Hameer Abbasi
  • 1,292
  • 1
  • 12
  • 34