Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-threading not working on raspberry #95

Open
fnoop opened this issue Jul 18, 2018 · 5 comments
Open

Multi-threading not working on raspberry #95

fnoop opened this issue Jul 18, 2018 · 5 comments
Labels
Milestone

Comments

@fnoop
Copy link
Member

fnoop commented Jul 18, 2018

track_targets performs better when compiled to use a single thread for marker detection:
MParams.maxThreads = 1;
When compiled for multiple or maximum threads: MParams.maxThreads = -1;, performance decreases (about 20ms to 25-30ms per frame).

cmake sets c++ flags to: -- C++ flags (Release): -fomit-frame-pointer -O2 -ffast-math -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -DNDEBUG -Wall

seems to be missing threading flags: -std=c++0x thread.cxx -o thread -pthread

Also check it's building release and not debug

@fnoop
Copy link
Member Author

fnoop commented Jul 18, 2018

@fnoop
Copy link
Member Author

fnoop commented Jul 18, 2018

Actually looks like aruco is compiling with debug flags:
-- C++ flags (Debug): -g3 -O0 -DDEBUG -D_DEBUG -W -Wextra -Wno-return-type -Wall

@fnoop
Copy link
Member Author

fnoop commented Jul 18, 2018

Added '-DCMAKE_BUILD_TYPE=Release -DENABLE_OPENMP=ON' compile options to turn off debug flags.

cmake/compilerOptions.cmake sets wrong flags for raspberry:

  if(${CMAKE_SYSTEM_PROCESSOR} MATCHES armv7l) # In ARM_COrtex8 with neon, enalble vectorized operations
        set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize ")
    endif()

@fnoop
Copy link
Member Author

fnoop commented Jul 18, 2018

changing compile options to:

    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES armv7l) # In ARM_COrtex8 with neon, enalble vectorized operations
        # set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize ")
        set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -march=armv8-a+crc -mfpu=neon-vfpv4 -mtune=cortex-a53 -ftree-vectorize -mfloat-abi=hard -O3 ")
    endif()

@fnoop
Copy link
Member Author

fnoop commented Jul 19, 2018

@fnoop fnoop added the Aruco label Aug 6, 2018
@fnoop fnoop added this to the 1.0 milestone Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant