Run Cuda in NetBeans 8.2

Hi,

I want to compile Cuda program in NetBeans 8.2:
My pc is runing ubuntu 16.04 with GeForce GT 730 (384 Cuda cores).

  1. I added the cuda plugin from NetBeans Site http://plugins.netbeans.org/plugin/36176.
    the NetBeans dosn’t recognize any *.cu extension.
  2. I searched for a guide what to do after and I found https://devtalk.nvidia.com/default/topic/384763/ide-for-cuda-using-netbeans-c-c-ide-with-cuda/-> that gives a list of uncleared instructions, That did not match my environment.

I am searching for one guide/tutorial that explain how to do it step by step.

I spent more then two weeks, only to set this up.
I can compile using nvcc command from terminal:

nvcc temp.cu -o temp.x
./temp.x
  • Cuda ToolKit9-0 is installed as well.
  1. Make NetBeans understand .cu source files
    Menu: Tools -> Options -> C/C++ -> Other, add cu to C++ File Type. “cu” will appear in the corresponding File Extensions

  2. Create building tool chain for CUDA
    In the same dialog, select “Build Tools” Tab, click “Add …” button below the Tool Collection. In the popped-up dialog, specify /usr/local/cuda in Base Directory, Unknown in Tool Collection Family and CUDA in Tool Collection Name. Click OK. Select the newly created CUDA tool collection, set both C and C++ compiler to be /usr/local/cuda/bin/nvcc, leaving other fields intact.

  3. Configure compiler
    Set Project Properties -> Build -> Tool Collection to CUDA. Uncheck Enable Make Dependency Checking (to suppress -MMD -MP -MF flags NetBeans generated but nvcc doesn’t recognize). Make sure Project Properties -> Build -> C++ Compiler -> Tool -> Tool is nvcc. You might wanna add /usr/local/cuda/bin/ to your PATH by edit ~/.bashrc to ensure nvcc is searchable.

  4. Configure linker
    Click Properties -> Build -> Linker -> Libraries -> Libraries -> … In the popped-up dialog, click “Add PkgConfig Library…” button, choose “cudart-8.0” (and any other CUDA library you need like cufftw-8.0 or cublas-8.0), and we can link and debug now.

The restriction is that we can only debug host code but I can find no way to debug kernel CUDA code in NetBeans. I would greatly appreciate it if you know how to do it and share your solution with us.

Sorry, I did not found a solution yet.