How to use Nsight eclipse to compile SDK example?

Nsight eclipse is a major feature of CUDA 5.0 for linux and Mac CUDA debugger.

I try to use it to compile the SDK example, but neither I create a new project and add files from example or import the make file in the example to Nsight eclipse, there are still many header file cannot be found.
Because I am not familiar to eclipse, so I can’t find where to add include directory and where to link other libraries.
Can someone tell me how to use it?

Unfortunately, we had to disable SDK samples support in a preview build. It will be trivial in the final build.

Building SDK samples with the preview build is bit tricky and very dependant on what sample you want to build.

Include directories and libraries can be added by:

  1. Right-click your project and select Properties
  2. Select General/“Paths and Symbols”

On the “Includes” tab you can add include paths on per-language basis (you may add include path to several languages at once)
“Symbols” is for defining macro values both for the editor and for the build
“Libraries” is to select libraries to link against. E.g. if you want to link against “libcudart” you enter “cudart”.

Thanks for your reply
I create a new project and copy into it then add ~/NVIDIA_CUDA_Samples/shared/inc to “Includes”
I successfully build and run the project and get passed.
But when I try to use debugger and step by step trace the code, I will always stuck at line84: err = cudaMalloc((void **)&d_A, size);
Is this a bug or my misoperation?

My system is Ubuntu 10.04 64bit with Geforce GT430.

What do you mean by “stuck”?

Please note you need 2 GPUs to use IDE debugger - with the one driving the display and another one used for debugging.

Hmm… single GPU debugging is not available on Linux Eclipse NSight?

I have installed CUDA 5 into the directory /home/user-name/cuda5. Nice, I try NSight and create new CUDA project. Nice, there are sample codes appended to a file. When I try to build and run, is not found. Where can I edit the linked library? I can’t find it in the project properties. Are they by default hidden from us?


Nope… Nsight uses cuda-gdb as a visual debugger backend and it can’t use the same GPU used to drive the screen.

Looks like you have nvcc from toolkit 4.0 in your path (toolkit 5.0 installs You need not explicitly link against cudart - nvcc handles it by itself.

You can configure libraries as follows:

  1. Open project properties

  2. Expand General->Paths and Symbols

  3. On the Libraries tab add the library, without the “lib” prefix and file extension. I.e. to link against you need to specify “mylib”.

Nsight Eclipse Edition relies on specific versions of the cuda-gdb and nvcc (it requires some specific new features and bug fixes that were only introduced in the Toolkit 5.0 versions of those tools). Using it with different toolkit versions is not recommended.

Sorry for forget this thread so long…

My stuck means, it just stop at that command and never go to next command.

But now I know the reason may because I only have single GPU.

So, single GPU debugger is only available in Visual Studio Version?

I’ve not installed the new Nsight Visual Studio Version, but single GPU debugger works at Nsight 2.2 RC.

Yes, single GPU debug is only available under Windows. Neither Nsight Eclipse Edition nor cuda-gdb available on Linux and Mac support single GPU debugging at this point.

I heard about this is because display and compute can’t be run at same card.

So, if I want to buy another card only for display and my original car for compute, may I buy an AMD card?

I ever heard this can work on windows, but I forget at which thread, but is it work at linux?

After all, OpenCL debugger is always coming soon for Nsight, but AMD provides gDebugger for OpenCL debugger.

If I must have two cards, I think this is a more suitable way.

Nsight Eclipse Edition was tested on Nvidia Optimus setups when integrated video adapter (Intel) is driving the display and Nvidia hardware is used for debugging. I expect it will work fine with AMD card driving the display.

Thanks for reply, I will try it