GPU Coder Matlab to Jetson Nano - Build error : C++ compiler

hello,
i’m trying to deploy from Matlab a neural networkfor detecting object on my Jetson Nano system, using the tool GPU Coder.
However, I have a problem when I try to generate the C++ code :

Error executing command “touch -c /home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU/.;make -f mytrainedNetworkFinalGPU_rtw.mk -j4 all MATLAB_WORKSPACE=”/home/eudes/TrainedNetwork/MATLAB_ws/R2022a" -C /home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU". Details:

STDERR: /bin/sh: 1: nvcc: not found
make: *** [MWAvgPoolingLayer.o] Error 127
make: *** Waiting for unfinished jobs…
/bin/sh: 1: nvcc: not found
/bin/sh: 1: nvcc: not found
make: *** [MWCNNLayer.o] Error 127
make: *** [MWConcatenationLayer.o] Error 127

STDOUT: make: Entering directory ‘/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU’
nvcc -rdc=true -Xcudafe “–diag_suppress=unsigned_compare_with_zero” -c -Xcompiler -MMD,-MP -O2 -arch sm_35 -DMW_CUDA_ARCH=350 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DMW_DL_DATA_PATH="/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119" -DMW_SCHED_OTHER=1 -D__linux__ -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DSTACK_SIZE=200000 -DMODEL=mytrainedNetworkFinalGPU -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119 -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/supportpackages/nvidia/include -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/supportpackages/nvidia/sources/utils -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/toolbox/coder/rtiostream/src/utils -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/extern/include -o MWAvgPoolingLayer.o /home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU/MWAvgPoolingLayer.cpp
nvcc -rdc=true -Xcudafe “–diag_suppress=unsigned_compare_with_zero” -c -Xcompiler -MMD,-MP -O2 -arch sm_35 -DMW_CUDA_ARCH=350 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DMW_DL_DATA_PATH="/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119" -DMW_SCHED_OTHER=1 -D__linux__ -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DSTACK_SIZE=200000 -DMODEL=mytrainedNetworkFinalGPU -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119 -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/supportpackages/nvidia/include -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/supportpackages/nvidia/sources/utils -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/toolbox/coder/rtiostream/src/utils -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/extern/include -o MWCNNLayer.o /home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU/MWCNNLayer.cpp
nvcc -rdc=true -Xcudafe “–diag_suppress=unsigned_compare_with_zero” -c -Xcompiler -MMD,-MP -O2 -arch sm_35 -DMW_CUDA_ARCH=350 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DMW_DL_DATA_PATH="/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119" -DMW_SCHED_OTHER=1 -D__linux__ -DARM_PROJECT -D_USE_TARGET_UDP_ -D_RUNONTARGETHARDWARE_BUILD_ -DSTACK_SIZE=200000 -DMODEL=mytrainedNetworkFinalGPU -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119 -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/supportpackages/nvidia/include -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/ProgramData/MATLAB/SupportPackages/R2022a/toolbox/target/supportpackages/nvidia/sources/utils -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/toolbox/coder/rtiostream/src/utils -I/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Program_Files/MATLAB/R2022a/extern/include -o MWConcatenationLayer.o /home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU/MWConcatenationLayer.cpp
mytrainedNetworkFinalGPU_rtw.mk:385: recipe for target ‘MWAvgPoolingLayer.o’ failed
mytrainedNetworkFinalGPU_rtw.mk:389: recipe for target ‘MWCNNLayer.o’ failed
mytrainedNetworkFinalGPU_rtw.mk:393: recipe for target ‘MWConcatenationLayer.o’ failed
make: Leaving directory ‘/home/eudes/TrainedNetwork/MATLAB_ws/R2022a/C/Users/lforz/OneDrive/Documents/trainednetwork119/codegen/lib/mytrainedNetworkFinalGPU’

??? Build error: C++ compiler produced errors. See the Build Log for further details.
More information
Code generation failed: [View Error Report](matlab: open(‘C:\Users\lforz\OneDrive\Documents\trainednetwork119\codegen\lib\mytrainedNetworkFinalGPU\html\report.mldatx’);)

My username is eudes and my build directory in the JETSON Nano is /home/eudes/TrainedNetwork. The error seems to come from nvcc.

I am new to this field and would appreciate your help.

Thank you

Ludovic

Hi @ludof32, is this procedure running on your Jetson? If you run nvcc --version from a terminal, does it find nvcc? If not, can you check /usr/local/cuda/bin to make sure that nvcc is there?

You may need to add this to your user’s ~/.bashrc and then restart your terminal:

$ export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64\
                         {LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Then see if it can find nvcc.

1 Like

Thank you !! The problem is fixed !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.