davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.53k stars 3.37k forks source link

raspberry pi cross build performance #2098

Closed andres7293 closed 4 years ago

andres7293 commented 4 years ago

Hi everyone.

I have different performance in example dnn_face_recognition_ex.cpp using a raspberry pi local compiler and my own cross compiler.

I cross compile the source using:

INCLUDE=-I/opt/rpi/sysroot/include 
LDFLAGS=-L/opt/rpi/sysroot/lib
arm-linux-gnueabihf-g++ -std=c++11 -O3 -DDLIB_NO_GUI_SUPPORT -DDLIB_JPEG_SUPPORT -DDLIB_USE_BLAS -DDLIB_USE_LAPACK -I.. ${INCLUDE} ${LDFLAGS} ../dlib/all/source.cpp -lpthread -ljpeg -lopenblas -lgfortran dnn_face_recognition_ex.cpp -o dnn_face_recognition_ex_con_blas.out

Am I missing some compiler flags?

Thanks

davisking commented 4 years ago

You didn't say how you build without the cross compiler.

andres7293 commented 4 years ago

True, let me explain a little bit. For dev purposes I am using raspbian. I also built OpenBLAS locally in raspberry pi, and installed in usr directory. This is the command to build locally:

g++ -std=c++11 -O3 -DDLIB_NO_GUI_SUPPORT -DDLIB_JPEG_SUPPORT -DDLIB_USE_BLAS -DDLIB_USE_LAPACK -I.. ../dlib/all/source.cpp -lpthread -ljpeg -lopenblas -lgfortran dnn_face_recognition_ex.cpp -o dnn_face_recognition_ex_con_blas.out

For production I have a raspberry pi hardware running LFS. I also cross build OpenBLAS. Is in LFS running machine where the performance is slower. I suspect is a compiler related issue.

davisking commented 4 years ago

Yeah, not sure. Must be something with the cross compiler if you really are using the same switches with both compilers.

dlib-issue-bot commented 4 years ago

Warning: this issue has been inactive for 35 days and will be automatically closed on 2020-07-25 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot commented 4 years ago

Warning: this issue has been inactive for 42 days and will be automatically closed on 2020-07-25 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot commented 4 years ago

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.