Nsight Eclipse Version 10 - compiling and build issues

Hi,
I have an issue related to compiler.
I integrated my project without any cuds-related system calls, and it compiles and run perfectly fine on NVIDIA DRIVE platform.
When I added to one of my functions, the regular Cuda functions(cudaMalloc, cudaMemcpy,see below), I got errors.

  1. What header file should I include ? I tried different options, nothing helped.
  2. I configured Nsight environment properly. Seems like nvcc compiler is not used.
    Where can I change it ? I attach cmake files for review.

cudaMalloc((void **)(&pSrc), sizeof(Npp8u) * wh);
cudaMemcpy(&pSrc, pInp, sizeof(Npp8u) * 1 * h
w, cudaMemcpyHostToDevice);

CMakeFiles/PD.dir/MEHL/mehl.cpp.o: In function mehl::MagnaEmbeddedHelper::sobel(unsigned char*, unsigned short*, int, int, unsigned int, unsigned int)': /home/magna/NVIDIA/PD/src/PD/MEHL/mehl.cpp:489: undefined reference to cudaMalloc’
/home/magna/NVIDIA/PD/src/PD/MEHL/mehl.cpp:490: undefined reference to cudaMemcpy' CMakeFiles/PD.dir/MEHL/mehl.cpp.o:(.debug_addr+0x7b0): undefined reference to cudaMemcpy’
CMakeFiles/PD.dir/MEHL/mehl.cpp.o:(.debug_addr+0x25e8): undefined reference to `cudaMalloc’
CMakeLists.txt (1.76 KB)
CMakeLists.txt (2.82 KB)

Dear yaroslav.taran,
Did you check creating CUDA project using /usr/local/cuda/bin/nsight on host?

If I understand it properly, under project properties ->Build -> Target Systems, under Local System,
In toolkit window I have the following path: /usr/local/cuda-10.1/bin/
CPU Architecture: Native.

In the folder bin there is no nsight file or folder.

Under Settings -> Tool Settings I have:
Command: nvcc
All options: -G -g -O0

NVCC Linker, Command: nvcc
All options: -cudart static --relocatable-device-code=false -gencode arch=compute_35,code=compute_35 -gencode arch=compute_35,code=sm_35

Still I don’t understand why it Cuda related functions don’t compile…

The project samples-nsight/samples compiles properly and builds properly the executable for all the examples.
Why my project doesn’t compile when I add Cuda functions ?

I found that in Paths and Symbols, the list of symbols is empty… Can it be an issue?
I see that in samples-nsight project, this list has lots of symbols.

In the following document it was said nothing about Paths and Symbols

https://developer.nvidia.com/drive/learn/tutorial-NsightEclipse

Dear yaroslav.taran,
I have created CUDA project(File -> new- > cuda c/c++ project) and selected CUDA 10.1 toolkit. I have added .cu file with add() CUDA kernel, checkAdd() function to test add() kernel in it and main.cpp calls checkAdd() function. I could run without any build issues. All the necessary paths and libs were taken care default. Could you follow the same.

If in case, you are using any CUDA API calls inside .cpp instead of .cu file, please add relevant header files like cuda_runtime_api.h, cuda.h

I added cuda_runtime_api.h, cuda.h and compiler still doesn’t recognize the Cuda functions.
I changed files from cpp to .cu, and it stopped to find main() from Start.

Still have an issue.

Dear yaroslav.taran,
Did you create CUDA C++ project?
Please share steps to reproduce this on my side and identify root cause. When I create CUDA project, with default settings it self the experience was smooth

Could you please clarify your example ?
There are no such a function add() or checkAdd() ?
What are they ?

Why don’t you check my system call Cuda functions that don’t work for me in your example ?

cudaMalloc((void **)(&pSrc), sizeof(Npp8u) * wh);
cudaMemcpy(&pSrc, pInp, sizeof(Npp8u) * 1 * h
w, cudaMemcpyHostToDevice);

Appreciate your help,

Slava

Any updates ?
I try to run FilterSobelHoriz function from NPP library.
What should I include in properties of my project in order to do that ?
NPP library ? Header files ?

Slava

Yes. Please check that

What to check ?
It is unclear from the answer.

Dear yaroslav.taran,
Please add right path of lib files and header files in project