Giter Club home page Giter Club logo

Comments (15)

mzahana avatar mzahana commented on August 15, 2024 4

I was able to compile fast_neon package by using the test/aarch64-compilation branch.

from rpg_svo_pro_open.

mzahana avatar mzahana commented on August 15, 2024 2

@FPSychotic This is not related to fast_neon, but try to replace the content of rpg_svo_pro_open/svo_cmake/cmake/Modules/SvoSetup.cmake by the following

SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfo
#SET(CMAKE_BUILD_TYPE Debug) # Release, RelWithDebInfo
SET(CMAKE_VERBOSE_MAKEFILE OFF)

# user build settings
SET(USE_LOOP_CLOSING TRUE)
SET(USE_GLOBAL_MAP TRUE)

# Set definitions
IF(USE_LOOP_CLOSING)
  ADD_DEFINITIONS(-DSVO_LOOP_CLOSING)
ENDIF()

IF(USE_GLOBAL_MAP)
  ADD_DEFINITIONS(-DSVO_GLOBAL_MAP)
ENDIF()

ADD_DEFINITIONS(-DSVO_USE_ROS)
ADD_DEFINITIONS(-DSVO_USE_OPENGV)
ADD_DEFINITIONS(-DSVO_DEPTHFILTER_IN_REPROJECTOR)

#############################################################################
# Set build flags, set ARM_ARCHITECTURE environment variable on Odroid
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Werror -D_LINUX -D_REENTRANT -march=native -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -Wno-unused-but-set-parameter -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-unused-function")

# IF(DEFINED ENV{ARM_ARCHITECTURE})
#   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
#   ADD_DEFINITIONS(-DHAVE_FAST_NEON)
# ELSE()
#   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse2 -msse3 -mssse3 -mno-avx")
# ENDIF()

set(ENV{ARM_ARCHITECTURE} aarch64)

IF(DEFINED ENV{ARM_ARCHITECTURE})
	IF("$ENV{ARM_ARCHITECTURE}" STREQUAL "aarch64")
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native")
		ADD_DEFINITIONS(-DHAVE_FAST_NEON)
	ELSEIF("$ENV{ARM_ARCHITECTURE}" STREQUAL "armv8")
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native")
		ADD_DEFINITIONS(-DHAVE_FAST_NEON)
	ELSE()
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mfpu=neon -march=armv7-a")
	ENDIF()	
ELSE()
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mmmx -msse -msse -msse2 -msse3 -mssse3 -fomit-frame-pointer")
ENDIF()


SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -fsee -fomit-frame-pointer -fno-signed-zeros -fno-math-errno -funroll-loops -ffast-math -fno-finite-math-only")

from rpg_svo_pro_open.

yanyan-li avatar yanyan-li commented on August 15, 2024 1

I was able to compile fast_neon package by using the test/aarch64-compilation branch.

Thanks for the advice. It works on my chips. Taking the proposed fast_neon folder to take place of the original one if you want to try it on ARM64 chips.

from rpg_svo_pro_open.

AlexisTM avatar AlexisTM commented on August 15, 2024

Hi @HilbertXu, I believe those flags are there from the old days of the Odroid XU4 SVO was used on.

If I'm not incorrect, the jetson boards have an arm64v8 architecture, According to this answer, the arm64v8 architecture makes NEON mandatory, thus the -mfpu=neon doesn't have to be maintained on the compiler's side as it has to be present.

So the solution should be to replace armv7 by the correct arm64v8 architecture (check for the correct name) or if building on the board, -march=native could be enough.

from rpg_svo_pro_open.

mzahana avatar mzahana commented on August 15, 2024

@HilbertXu I am facing the same issue. Have you solved it?
I am trying to compile on Jetson Xavier NX dev kit.

from rpg_svo_pro_open.

mzahana avatar mzahana commented on August 15, 2024

If I remove -mfpu=neon in here, I get the following errors

Errors << fast:make /root/catkin_ws/logs/fast/build.make.000.log               
c++: error: unrecognized command line option '-mmmx'
c++: error: unrecognized command line option '-msse'; did you mean '-fdse'?
c++: error: unrecognized command line option '-msse'; did you mean '-fdse'?
c++: error: unrecognized command line option '-msse2'
c++: error: unrecognized command line option '-msse3'
c++: error: unrecognized command line option '-mssse3'

from rpg_svo_pro_open.

FPSychotic avatar FPSychotic commented on August 15, 2024

I was able to compile fast_neon package by using the test/aarch64-compilation branch.

could you please print you commands from the history or anything can help I use the arm4 fast neon you quoted and know compile farest but still crash with the same error

from rpg_svo_pro_open.

mzahana avatar mzahana commented on August 15, 2024

@FPSychotic
Nothing special. Just checkout the branch I mentioned and compile.

from rpg_svo_pro_open.

FPSychotic avatar FPSychotic commented on August 15, 2024

@mzahana
As I'm not skilled in linux or github what I did is download the zip of that fast_neon branch, substituted the svo with it, and compiled SVO with catkin build, it was able to compile more , but it failed with similar error. is it right what I did? I'm in noetic

Errors << vikit_common:make /home/imother/svo_ws/logs/vikit_common/build.make.000.log c++: error: unrecognized command line option ‘-mmmx’ c++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? c++: error: unrecognized command line option ‘-msse2’ c++: error: unrecognized command line option ‘-mmmx’ c++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? c++: error: unrecognized command line option ‘-msse3’ c++: error: unrecognized command line option ‘-msse2’ c++: error: unrecognized command line option ‘-msse3’ c++: error: unrecognized command line option ‘-mssse3’ c++: error: unrecognized command line option ‘-mmmx’ c++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? c++: error: unrecognized command line option ‘-msse2’ c++: error: unrecognized command line option ‘-mno-avx’; did you mean ‘-Wno-abi’? c++: error: unrecognized command line option ‘-mssse3’ c++: error: unrecognized command line option ‘-mmmx’ c++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? c++: error: unrecognized command line option ‘-mno-avx’; did you mean ‘-Wno-abi’? c++: error: unrecognized command line option ‘-msse3’ c++: error: unrecognized command line option ‘-msse2’ c++: error: unrecognized command line option ‘-mmmx’ c++: error: unrecognized command line option ‘-msse3’ c++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? c++: error: unrecognized command line option ‘-mssse3’ c++: error: unrecognized command line option ‘-msse2’ c++: error: unrecognized command line option ‘-mssse3’ c++: error: unrecognized command line option ‘-msse3’ c++: error: unrecognized command line option ‘-mno-avx’; did you mean ‘-Wno-abi’? c++: error: unrecognized command line option ‘-mssse3’ make[2]: *** [CMakeFiles/vikit_common.dir/build.make:104: CMakeFiles/vikit_common.dir/src/performance_monitor.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... c++: error: unrecognized command line option ‘-mno-avx’; did you mean ‘-Wno-abi’? make[2]: *** [CMakeFiles/vikit_common.dir/build.make:90: CMakeFiles/vikit_common.dir/src/math_utils.cpp.o] Error 1 c++: error: unrecognized command line option ‘-mno-avx’; did you mean ‘-Wno-abi’? c++: error: unrecognized command line option ‘-mmmx’ c++: error: unrecognized command line option ‘-msse’; did you mean ‘-fdse’? c++: error: unrecognized command line option ‘-msse2’ c++: error: unrecognized command line option ‘-msse3’ c++: error: unrecognized command line option ‘-mssse3’ c++: error: unrecognized command line option ‘-mno-avx’; did you mean ‘-Wno-abi’? make[2]: *** [CMakeFiles/vikit_common.dir/build.make:76: CMakeFiles/vikit_common.dir/src/homography.cpp.o] Error 1

from rpg_svo_pro_open.

itaouil avatar itaouil commented on August 15, 2024

@mzahana did you manage to run it on the Jetson Xavier already? I would be interested to know what is the CPU load and the frequency of the estimation if you already run it :).

from rpg_svo_pro_open.

mzahana avatar mzahana commented on August 15, 2024

@itaouil I am currently building a Docker image for it to run on Xavier NX, check jetson_svo_docker repo. It still requires testing.

from rpg_svo_pro_open.

FPSychotic avatar FPSychotic commented on August 15, 2024

from rpg_svo_pro_open.

itaouil avatar itaouil commented on August 15, 2024

@mzahana thanks for sharing repo link.

@FPSychotic let us know. I am very interested :).

from rpg_svo_pro_open.

fratopa avatar fratopa commented on August 15, 2024

@FPSychotic This is not related to fast_neon, but try to replace the content of rpg_svo_pro_open/svo_cmake/cmake/Modules/SvoSetup.cmake by the following

SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfo
#SET(CMAKE_BUILD_TYPE Debug) # Release, RelWithDebInfo
SET(CMAKE_VERBOSE_MAKEFILE OFF)

# user build settings
SET(USE_LOOP_CLOSING TRUE)
SET(USE_GLOBAL_MAP TRUE)

# Set definitions
IF(USE_LOOP_CLOSING)
  ADD_DEFINITIONS(-DSVO_LOOP_CLOSING)
ENDIF()

IF(USE_GLOBAL_MAP)
  ADD_DEFINITIONS(-DSVO_GLOBAL_MAP)
ENDIF()

ADD_DEFINITIONS(-DSVO_USE_ROS)
ADD_DEFINITIONS(-DSVO_USE_OPENGV)
ADD_DEFINITIONS(-DSVO_DEPTHFILTER_IN_REPROJECTOR)

#############################################################################
# Set build flags, set ARM_ARCHITECTURE environment variable on Odroid
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Werror -D_LINUX -D_REENTRANT -march=native -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -Wno-unused-but-set-parameter -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-unused-function")

# IF(DEFINED ENV{ARM_ARCHITECTURE})
#   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
#   ADD_DEFINITIONS(-DHAVE_FAST_NEON)
# ELSE()
#   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse2 -msse3 -mssse3 -mno-avx")
# ENDIF()

set(ENV{ARM_ARCHITECTURE} aarch64)

IF(DEFINED ENV{ARM_ARCHITECTURE})
	IF("$ENV{ARM_ARCHITECTURE}" STREQUAL "aarch64")
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native")
		ADD_DEFINITIONS(-DHAVE_FAST_NEON)
	ELSEIF("$ENV{ARM_ARCHITECTURE}" STREQUAL "armv8")
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native")
		ADD_DEFINITIONS(-DHAVE_FAST_NEON)
	ELSE()
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mfpu=neon -march=armv7-a")
	ENDIF()	
ELSE()
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mmmx -msse -msse -msse2 -msse3 -mssse3 -fomit-frame-pointer")
ENDIF()


SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -fsee -fomit-frame-pointer -fno-signed-zeros -fno-math-errno -funroll-loops -ffast-math -fno-finite-math-only")

thanks, solved the vikit_common problem

from rpg_svo_pro_open.

leonpano2006 avatar leonpano2006 commented on August 15, 2024

Hi @HilbertXu, I believe those flags are there from the old days of the Odroid XU4 SVO was used on.

If I'm not incorrect, the jetson boards have an arm64v8 architecture, According to this answer, the arm64v8 architecture makes NEON mandatory, thus the -mfpu=neon doesn't have to be maintained on the compiler's side as it has to be present.

So the solution should be to replace armv7 by the correct arm64v8 architecture (check for the correct name) or if building on the board, -march=native could be enough.

-march=native doesn't work as expected on xavier nx/agx
It still give generic for many things like -mtune -mcpu .....

Have to manually specify optimization

from rpg_svo_pro_open.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.