Jetson Nano. Error with Command: APP_EIM=1 TARGET_JETSON_NANO=1 CC=clang CXX=clang++ make -j

Question/Issue:
I want to build this Project in a Jetson Nano.

But I have a problem when I try to build a specific model targeting the Jetson Nano GPU with TensorRT with the command

APP_EIM=1 TARGET_JETSON_NANO=1 CC=clang CXX=clang++ make -j

Does anyone know the problem? Is there any way to solve it?
Thanks in Advance.

Project ID:
649146

Context/Use case:
I would like to learn more about Edge Impulse and I started with this learning project following each step as described.

Steps Taken:
Following the instructions of this learning project, on the step:

To build a specific model targeting the Jetson Nano GPU with TensorRT, using Clang:

APP_EIM=1 TARGET_JETSON_NANO=1 CC=clang CXX=clang++ make -j

Actual Outcome:
I get this error:

/usr/bin/ld: cannot find -lcudart
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:251: recipe for target ā€˜runner’ failed
make: *** [runner] Error 1

Reproducibility:

  • [X] Always

Environment:

  • Platform: NVIDIA Jetson Nano Developer Kit rev B01
  • Build Environment Details: JetPack 4.6.1
  • OS Version: Jetson Linux R32.7.1 / NVIDIA L4T 32.7.1 / Ubuntu 18.04
2 Likes

Hi @angelo.cioffari.btc

It looks like you are perhaps missing CUDA, can you paste the output from:
nvcc --version

If it is missing or incorrectly installed try running:

sudo apt install --reinstall nvidia-cuda-runtime

Thanks

Eoin

fyi @rjames

1 Like

Hello @Eoin!

Thank you for your reply. I finally got some time to continue learning more about Edge Impulse with the Jetson Nano…

when I run this:
nvcc --version

got this message:

bash: nvcc: command not found

and when I try to run this:
sudo apt install --reinstall nvidia-cuda-runtime

got this message:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package nvidia-cuda-runtime

I think this is a Jetpack issue, right? The error usr/bin/ld: cannot find -lcudart seems to indicate that the linker (ld) cannot find libcudart.so during the compilation, probably because the library path is not configured correctly for the compiler (clang).

Not sure if this is the problem or how to resolve it… :thinking:

Thanks again.
Angelo

1 Like

Hi @angelo.cioffari.btc,

What JetPack version are you using?

Can you verify whether you have cuda libraries installed?
find /usr/lib/ -type f -name 'lib*cuda*.so*'

Can you print your library path?
echo $LD_LIBRARY_PATH

Can you check whether the cuda library path is dynamic linker runtime cache?
ldconfig -p | grep cuda

// Raul

2 Likes

Hello @rjames! Thank you for your reply.

I’m using JetPack 4.6.1.

find /usr/lib/ -type f -name 'lib*cuda*.so*'

Shows:

/usr/lib/aarch64-linux-gnu/libicudata.so.60.2
/usr/lib/aarch64-linux-gnu/libnvsample_cudaprocess.so
/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideocuda.so
/usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1.1

echo $LD_LIBRARY_PATH
Shows nothing. :hushed:
is empty, no results.

ldconfig -p | grep cuda

Shows:

libnvsample_cudaprocess.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libnvsample_cudaprocess.so
libnvrtc.so.10.2 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvrtc.so.10.2
libnvrtc.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvrtc.so
libnvrtc-builtins.so.10.2 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvrtc-builtins.so.10.2
libnvrtc-builtins.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvrtc-builtins.so
libnvperf_target.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvperf_target.so
libnvperf_host.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvperf_host.so
libnvgraph.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvgraph.so.10
libnvgraph.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvgraph.so
libnvblas.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvblas.so.10
libnvblas.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvblas.so
libnvToolsExt.so.1 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvToolsExt.so.1
libnvToolsExt.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnvToolsExt.so
libnpps.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnpps.so.10
libnpps.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnpps.so
libnppitc.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppitc.so.10
libnppitc.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppitc.so
libnppisu.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppisu.so.10
libnppisu.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppisu.so
libnppist.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppist.so.10
libnppist.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppist.so
libnppim.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppim.so.10
libnppim.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppim.so
libnppig.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppig.so.10
libnppig.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppig.so
libnppif.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppif.so.10
libnppif.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppif.so
libnppidei.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppidei.so.10
libnppidei.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppidei.so
libnppicom.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppicom.so.10
libnppicom.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppicom.so
libnppicc.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppicc.so.10
libnppicc.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppicc.so
libnppial.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppial.so.10
libnppial.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppial.so
libnppc.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppc.so.10
libnppc.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libnppc.so
libicudata.so.60 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libicudata.so.60
libicudata.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libicudata.so
libcusparse.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcusparse.so.10
libcusparse.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcusparse.so
libcusolver.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcusolver.so.10
libcusolver.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcusolver.so
libcurand.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcurand.so.10
libcurand.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcurand.so
libcupti.so.10.2 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcupti.so.10.2
libcupti.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcupti.so
libcuinj64.so.10.2 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcuinj64.so.10.2
libcuinj64.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcuinj64.so
libcufftw.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcufftw.so.10
libcufftw.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcufftw.so
libcufft.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcufft.so.10
libcufft.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcufft.so
libcudart.so.10.2 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcudart.so.10.2
libcudart.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcudart.so
libcuda.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1
libcuda.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libcuda.so
libcuda.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/tegra/libcuda.so
libcublasLt.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcublasLt.so.10
libcublasLt.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcublasLt.so
libcublas.so.10 (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcublas.so.10
libcublas.so (libc6,AArch64) => /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcublas.so

What do you think? can you see something strange? :thinking:

Thanks and Regards,
Angelo

1 Like

@angelo.cioffari.btc,

If you cloned edge-impulse-inferencing-linux repo, can you run tflite/linux-jetson-nano/download.sh. This will get you the necesarry libraries (including libcudart.so) in the right path. For JetPack 4.6.x these are found in the tflite/linux-jetson-nano/trt8/. Then you can try building again.

// Raul

1 Like

@rjames

hmmm, ok. a question…

I cloned

example-standalone-inferencing-linux

as the tutorial project indicates. in this way…

git clone https://github.com/edgeimpulse/example-standalone-inferencing-linux
cd example-standalone-inferencing-linux && git submodule update --init —recursive

I don’t cloned

edge-impulse-inferencing-linux

is this the same thing? :thinking:

thank you!
angelo

1 Like

@rjames

I copy here the whole message. maybe is easy to understand in this way :slight_smile:

acr@jetsonnano:~/example-standalone-inferencing-linux$ APP_EIM=1 TARGET_JETSON_NANO=1 CC=clang CXX=clang++ make -j
TENSORRT_VERSION is 8
clang++ -Wall -g -Wno-strict-aliasing -I. -Isource -Imodel-parameters -Itflite-model -Ithird_party/ -Iutils/ -Os -DNDEBUG -DEI_CLASSIFIER_ENABLE_DETECTION_POSTPROCESS_OP=1 -g -Wno-asm-operand-widths -DEI_CLASSIFIER_USE_FULL_TFLITE=1 -Itensorflow-lite/ -DDISABLEFLOAT16 -Ithird_party/ -std=c++17 -c source/eim.cpp -o source/eim.o
In file included from source/eim.cpp:9:
In file included from ./edge-impulse-sdk/classifier/ei_run_classifier.h:38:
In file included from ./edge-impulse-sdk/classifier/ei_model_types.h:40:
In file included from ./edge-impulse-sdk/classifier/ei_classifier_types.h:40:
./model-parameters/model_metadata.h:108:2: warning: ā€˜EI_CLASSFIER_OBJECT_DETECTION_COUNT’ is used for the guaranteed minimum number of objects
detected. To get all objects during inference use ā€˜bounding_boxes_count’ from the ā€˜ei_impulse_result_t’ struct instead. [-W#warnings]
#warning ā€˜EI_CLASSFIER_OBJECT_DETECTION_COUNT’ is used for the guaranteed minimum number of objects detected. To get all objects during …
^
source/eim.cpp:308:111: error: no member named ā€˜type’ in ā€˜ei_postprocessing_block_t’
auto res = get_threshold_postprocessing(&type_str, &threshold_name_str, pp_block.config, pp_block.type, &threshold);
~~~~~~~~ ^
source/eim.cpp:665:91: error: no member named ā€˜type’ in ā€˜ei_postprocessing_block_t’
set_threshold_postprocessing(pp_block.block_id, pp_block.config, pp_block.type, set_threshold[ā€œmin_scoreā€].GetFloat());
~~~~~~~~ ^
source/eim.cpp:668:91: error: no member named ā€˜type’ in ā€˜ei_postprocessing_block_t’
set_threshold_postprocessing(pp_block.block_id, pp_block.config, pp_block.type, set_threshold[ā€œmin_anomaly_scoreā€].GetFloat());
~~~~~~~~ ^
source/eim.cpp:785:33: warning: result of comparison of constant -1 with expression of type ā€˜char’ is always true
[-Wtautological-constant-out-of-range-compare]
while ((c = getchar()) && c != EOF) {
~ ^ ~~~
2 warnings and 3 errors generated.
Makefile:265: recipe for target ā€˜source/eim.o’ failed
make: *** [source/eim.o] Error 1

maybe it helps…
thank you again!
angelo

Hi @angelo.cioffari.btc

Not sure if I’m missing something here but it looks like you are still having build issues stemming from missing LD_LIBRARY_PATH library build path, @rjames mentioned the step to download the libs above, I dont see that the download script was run. Are you still missing the libcudart.so ?

If so please run:

cd tflite/linux-jetson-nano
./download.sh

Once that’s done, please re-run the checks @rjames listed in his steps again and share the output so:

just to confirm everything is in place.

Thanks @rjames for the help here,

Best

Eoin