CMake + Eclipse NSight

Hi,
I’ve started working with TX1 and I’m able to create a CMake project which makes use of VisionWorks and CUDA.
Currently, I’m using QtCreator as IDE because CMake projects are managed greatly, but it is the time for me to move on to my Ubuntu host in order to make use of all awesome nVidia tools made available through Eclipse NSight (e.g. GPU debugging, profiling).

I tried different solutions in order to import a CMake project into Eclipse NSight with poor results (but enough to see the power of the tools!).

The operations I did was:

  • Generating an Eclipse project in a folder “build” at the same level of “src” using “Eclipse CDT - Unix Makefiles” as CMake generator;

And then the different solution I tried was:

  • File > Import > General > Existing Projects into Workspace: it loads the project but it is a “simple” project and not a CUDA one; I was not able to convert it to a CUDA project in order to have access to all related options;
  • File > Import > C/C++ > Existing Code as Makefile Project: it generates new makefiles ignoring ones generated through CMake;

I tried also:

  • File > New > CUDA C/C++ Project
  • With “use default location” checked and project name equal to the folder name of CMake generated project;
    but using “MakeFile project > Empty project” or even other Project Types overwrites CMake generated makefiles (and suggest me to import the project in order to not loose project settings…but how?!) corrupting the CMake project structure.

Does someone know how to work with a CMake project with Eclipse NSight?

Thank you

I have an example in my github.
Clone git@github.com:rickyzhang82/cs344.git
run sh script. In nsight, import the created folder nsight-build.

Hi rickyzhang,
thank you for your reply. I had already found the solution but I did not update the forum (sorry).

However I came back to QtCreator because I was not able to correctly configure Eclipse with the cross toolchain (it was not usable due to c++11 syntax not resolved even with __cplusplus=201103L and -std=c++11 flag in discovery tool, indexing not working, …).

Thank you for posting the solution.

a big problem comes nsight:
https://devtalk.nvidia.com/default/topic/1003576/jetson-tx1/-bin-sh-c-xxxxxxxxx-permission-denied/post/5126356/#5126356

I could not access the git repository and don’t find the answer in the thread. Can you tell me how to generate the NSight projects from CMake? Thanks. :)

Using

git clone https://github.com/rickyzhang82/cs344.git

worked for me

After I generated the Makefile, I followed these steps: https://nanxiao.me/en/import-existing-cuda-project-into-nsight/

It works just fine!