3

I usually use emacs or Kate but I decided to try out "modern" IDEs for running my codes. I have an already working CUDA/C++ makefile project which I want to run on nsight but I don't see how to fulfill my needs.

How can I tell nsight eclipse 5.0.0 to run my project by using an existing makefile? sorry if my question sounds silly to you, but I'm totally new to IDEs.

user123892
  • 1,243
  • 3
  • 21
  • 38
  • I'm guessing you mean nsight Eclipse Edition (i.e. Linux? -- since the question is tagged with eclipse) or do you mean nsight Visual Studio Edition (i.e. windows)? – Robert Crovella Oct 31 '13 at 14:35
  • Good point Robert, my answer below assumed Visual Studio Edition... – Totem Oct 31 '13 at 14:54
  • thank you for your prompt reply, and sorry for my late one. Yes, indeed I'm on linux so I'd the answer for eclipse edition..next time I'll point it out – user123892 Nov 04 '13 at 09:18

2 Answers2

7

With Nsight EE you have several options:

Create a new project and copy the sources

You can use your shell or any file manager to copy source files to the project location. Make sure you manually refresh the project after you copied the files.

Creating a project in the same folder as your source files

In this post I will be using nbody CUDA Sample (note that Nsight also has a more native option to import CUDA samples, I will ignore that option here):

  1. Ran cuda-install-samples-6.0.sh to make a writable copy of samples in ~/dev/cuda/NVIDIA_CUDA-6.0_Samples
  2. In Nsight EE, go to File->New->CUDA C/C++ Project
  3. On the first wizard page:

    • Type in your project name (can be pretty much any string)
    • Uncheck "Use default location" and select your root folder (~/dev/cuda/NVIDIA_CUDA-6.0_Samples/5_Simulations/nbody in my case)
    • In the Project Type tree select Makefile Project/*Empty Project*
    • Select CUDA Toolkit 5.5 in the Toolchains list.
  4. Complete the wizard

You will see newly created project with all your files in the Project Explorer view. Pressing Build will run make all in your project location - you can customize this (among other things) in the project properties.

Note: Nsight will add several files to the root folder of your project.

Note: Some source editing features in Nsight may not work as reliably with Makefile projects as they do with the projects were Nsight maintains makefiles itself. Nsight does not know all compiler arguments passed from the custom makefile so it may not know all include paths or macro values.

Eugene
  • 9,242
  • 2
  • 30
  • 29
1

You can set up a 'dummy' project (what I mean by this is just create an empty Visual Studio project), and in the Nsight user properties page (you can read about it here http://docs.nvidia.com/nsight-visual-studio-edition/3.2/Nsight_Visual_Studio_Edition_User_Guide.htm#Launch_CUDA_Debugger.htm), just set the "Launch external program" to the (makefile) produced EXE path , and also don't forget to set the working directory. That should do it.

Let me know if that helps. Cheers.

Totem
  • 236
  • 1
  • 6
  • Thank you for your reply, but actually I'm on linux, so I'm working on Eclipse.. my mistake I did not make it clear. – user123892 Nov 04 '13 at 09:50
  • I use Visual Studio 2012 with Nsight 4.2. Sadly the the Nsight version seems to ignore my remote debug configuration and tries to start the projectname.exe inside the original project folder. The visual studio debugger starts my external application correctly. Do i have to configure some additional stuff that the Nsight runs in remote debugging mode? – cguenther Jan 12 '15 at 14:31
  • I see now that the Nsight launch actions are set seperatly at Project->Nsigght User Properties. This fixed it for me. – cguenther Jan 12 '15 at 14:40