Darknet: ARCH for Jetson Nano (MakeFile)

Created on 14 May 2019  路  18Comments  路  Source: AlexeyAB/darknet

@AlexeyAB can you please tell the ARCH parameter to be passed in MakeFile for Jetson Nano

Solved

Most helpful comment

@i-chaochen
Hi,can you tell me what you do in ./bashrc??

Thanks

sorry to the late reply. It's just simply setting the path of installed cuda.

something like this following

export CUDA_HOME="/usr/local/cuda"
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
export PATH="$PATH:$CUDA_HOME/bin"

and then running source ~/.basrhc

All 18 comments

@Tangotrax You can use Compute capability 5.3 -> compute_53

Thanks @alexanderfrey.

@AlexeyAB Is it good to go with what @alexanderfrey said

I have one Jetson Nano, as Alexander said , changing compute capability to 5.3 is enough .

@AlexeyAB

I have uncommented the Makefile as the following:
GPU=1 CUDNN=1 OPENCV=1 LIBSO=1 ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]

But I don't know why my tiny-yolov3 is soooooo slow. The inference time is longer than 5000ms...Any idea why it so slow? It has huge difference in terms of inference time between TX2(around 30ms) and Nano....which I don't think it's normal.

do

make clean
make

Also show output of:

nvcc --version
nvidia-smi

What cuDNN version do you use?

do

make clean
make

Also show output of:

nvcc --version
nvidia-smi

What cuDNN version do you use?

Thanks for reply! Currently I don't have Nano in my hand but I will try it tomorrow.

I installed its latest JetPack 4.2 SDK, and it said it supports NVIDIA CUDA Toolkit 10.0, and libraries such as cuDNN 7.3 and TensorRT 5.

Also show nvidia-smi output during yolov3-tiny detection on video

Also show nvidia-smi output during yolov3-tiny detection on video

Since jetson nano does not have nvidia-smi, I tried jtop to monitor my gpu usage.

You're correct, it seems my gpu has never been used during the interference. Any idea why and how to resolve it? @AlexeyAB
As I said, my Makefile is the following.

GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
AVX=0
OPENMP=0
LIBSO=1
ZED_CAMERA=0

ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]

Show output of command

make clean
make

Show output of command

make clean
make

I cannnot compile by directly make, it shows

g++ -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV pkg-config --cflags opencv -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC -c ./src/image_opencv.cpp -o obj/image_opencv.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
In file included from ./src/image_opencv.cpp:17:0:
/usr/include/opencv2/opencv.hpp:56:10: fatal error: opencv2/calib3d.hpp: No such file or directory
#include "opencv2/calib3d.hpp"
^~~~~
compilation terminated.
Makefile:149: recipe for target 'obj/image_opencv.o' failed
make: * [obj/image_opencv.o] Error 1

But I can compile it if I tried
cmake .
make

Do you think is the reason I tried cmake and make instead of make?

If you use Cmake then it doesn't matter what did you set in the Makefile

GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
AVX=0
OPENMP=0
LIBSO=1
ZED_CAMERA=0
  • Or try to use original Makefile from this repo with GPU=1 CUDNN=1 OPENCV=0 and do make
  • Or enable CUDA compilation in Cmake and do cmake . & make

I compiled opencv4 from the source, it might change the pkg_config. I am writing a new one.

would it be largely different in terms of time if I don't use opencv?

If you use Cmake then it doesn't matter what did you set in the Makefile

GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
AVX=0
OPENMP=0
LIBSO=1
ZED_CAMERA=0
  • Or try to use original Makefile from this repo with GPU=1 CUDNN=1 OPENCV=0 and do make
  • Or enable CUDA compilation in Cmake and do cmake . & make

I changed the opencv=0, and make. Got the following error, is jetson nano use different nvcc?

nvcc -gencode arch=compute_53,code=[sm_53,compute_53] -Iinclude/ -I3rdparty/stb/include -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
/bin/sh: 1: nvcc: not found
Makefile:152: recipe for target 'obj/convolutional_kernels.o' failed
make: * [obj/convolutional_kernels.o] Error 127

I tried 62, and it also failed.

nvcc -gencode arch=compute_62,code=[sm_62,compute_62] -Iinclude/ -I3rdparty/stb/include -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
/bin/sh: 1: nvcc: not found
Makefile:152: recipe for target 'obj/convolutional_kernels.o' failed
make: * [obj/convolutional_kernels.o] Error 127

You just don't have CUDA installed.

You just don't have CUDA installed.

I don't think so.

As I mentioned early, I installed JetPack 4.2, which included cuda10.0 , and I do find it in my /usr/local/cuda-10.0/

Maybe Jetson nano uses different cuda sdk?

Ha, thanks for help.

I changed ./bashrc with cuda and now is working perfectly now.

Thanks!

@i-chaochen
Hi,can you tell me what you do in ./bashrc??

Thanks

@i-chaochen
Hi,can you tell me what you do in ./bashrc??

Thanks

sorry to the late reply. It's just simply setting the path of installed cuda.

something like this following

export CUDA_HOME="/usr/local/cuda"
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
export PATH="$PATH:$CUDA_HOME/bin"

and then running source ~/.basrhc

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mididou picture Mididou  路  3Comments

off99555 picture off99555  路  3Comments

louisondumont picture louisondumont  路  3Comments

Yumin-Sun-00 picture Yumin-Sun-00  路  3Comments

Jacky3213 picture Jacky3213  路  3Comments