How to do CUDA programming on Jetson Nano?

Dear community,

I did some search on the topic, and I can see the nvcc in /usr/local/cuda/bin, but I am lost in the next step. Could anyone tell me what should I do to practice cuda programming on Jetson nano? Thanks for help!

Hi,

It’s recommended to start it from the CUDA sample.

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

You can execute and check the sample in NVIDIA_CUDA-10.0_Samples/

Thanks.

1 Like

The following commands are added 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}}

However, when I $ nvcc file.cu, i got :

asyncAPI.cu:29:10: fatal error: helper_cuda.h: No such file or directory
#include <helper_cuda.h>
^~~~~~~~~~~~~~~
compilation terminated.

In the makefile I do find :

Common includes and paths for CUDA

INCLUDES := -I…/…/common/inc
LIBRARIES :=

and I changed to my actual directory for INCLUDES : /home/jetbot/Documents/CUDA_Prj/NVIDIA_CUDA-10.0_Samples/common/inc and I compile again use make. But the same issue is still there, could anyone help on this problem? Thanks.

Hi,

Makefile is used only when you compile the app by make.
It won’t be refereed if you use the compiler directly. Ex, $gcc …, $nvcc …

So there are two options for you.

1. Using the Makefile. Just type make:

$ make

2. Compile it with nvcc directly. So you will need to feed the header directory into the compiler:

$ nvcc deviceQuery.cpp -o test -I/home/nvidia/NVIDIA_CUDA-10.0_Samples/common/inc/

Thanks.