Search code examples
c++eclipsecudansight

Setting Nsight to run with existing Makefile project


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.


Solution

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