Why is my helper_cuda.h cannot be found ?

Dear community,
I am trying to run the CUDA examples on the Jetson nano, here is what I have done:

  1. /usr/local/cuda-10.0/bin/cuda-install-samples-10.0.sh

  2. add the following lines to /home/.bashrc (or nvcc cannot be found)
    export PATH=/usr/local/cuda-10.0/bin${PATH:+:{PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

  3. add path to the Makefile of the project I want to run:

    Common includes and paths for CUDA

    INCLUDES := -I/home/jetbot/Documents/CUDA_Prj/NVIDIA_CUDA-10.0_Samples/common/inc
    LIBRARIES :=

  4. $ make the project, generate ~.o
    /usr/local/cuda-10.0/bin/nvcc -ccbin g++ -I/home/jetbot/Documents/CUDA_Prj/NVIDIA_CUDA-10.0_Samples/common/inc -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o asyncAPI.o -c asyncAPI.cu
    /usr/local/cuda-10.0/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o asyncAPI asyncAPI.o
    mkdir -p …/…/bin/aarch64/linux/release
    cp asyncAPI …/…/bin/aarch64/linux/release

  5. $ nvcc ~.cu

Then I got error : helper_cuda.h cannot be found. I googled the problem, most of answers are step 3, but not working for me. Could anyone help me on the issue? Thanks for help!

1 Like

Hi,

CUDA sample can be compiled with the following commands:

/usr/local/cuda-10.0/bin/cuda-install-samples-10.0.sh  .
cd NVIDIA_CUDA-10.0_Samples/
make

You don’t need to execute step-5. To execute the predefined makefile should be enough.

For fixing the helper_cuda.h error, please update the command to:

nvcc -I/home/jetbot/Documents/CUDA_Prj/NVIDIA_CUDA-10.0_Samples/common/inc ...

Thanks.

1 Like

Hi AastaLLL,
Thanks for reply! But I didn’t get it, do you mean directly run the following ? I tried this but it fails again.

$ nvcc -I/home/jetbot/Documents/CUDA_Prj/NVIDIA_CUDA-10.0_Samples/common/inc

However, I tried

$ nvcc ~.o (instead of ~.cu)

and it seems worked,could you comment if this is the right way to do it? Thank you!

Hi,

It’s recommended to use the default Makefile.
All the dependencies and options are added and test.

Just type the make on the example folder you want.

/usr/local/cuda-10.0/bin/cuda-install-samples-10.0.sh  .
cd NVIDIA_CUDA-10.0_Samples/
make

Thanks.