Open YoshuaNava opened 10 years ago
Solution: I discovered that my CPU doesn't have SSSE3 (It has SSE1, SSE2 and SSE3), and that it was being included in the CMakeLists.txt files in rpg_vikit/vikit_common/ and fast/ libraries folders. In order to be able to compile vikit and fast, and be able to execute their code on my SSE3-CPU, I changed the compilation directives for gcc on both CMakeLists.txt files, from:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3 -mssse3")
to:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3")
Also, I discovered that the patch_score.h file in rpg_vikit/vikit_common/include/vikit has an error in the 14th line. In the following block of code:
it validates the availability of SSE2, but includes tmmintrin.h, which is a library for optimizing code with SSSE3, when it sould include pmmintrin.h, which is a library for optimizing code with SSE2. (It validates the availability of SSE2 to include SSSE3 without validating the availability of SSSE3)
I hope this helps.
References: http://en.wikipedia.org/wiki/SSSE3 http://stackoverflow.com/questions/6981327/illegal-instruction-while-compiling-with-g http://stackoverflow.com/questions/11228855/header-files-for-simd-intrinsics http://stackoverflow.com/questions/8149132/why-is-my-sse-not-faster-than-c-c-code http://superuser.com/questions/397801/installing-valgrind-on-ubuntu http://docs.oracle.com/cd/E24457_01/html/E21991/gliwk.html
Hi Yoshua, thank you very much for sharing your solution! I hope I find time this week to address this. If you want you can also send a pull request. Best, Christian
@cfo: Sorry for the delay. Over the past months I wasn't able to continue working on this topic. Yesterday I started again.
I have made a list of CMakeLists.txt files that include the "-mssse3" directive by default: rpg_svo/svo/CMakeLists.txt vikit_common/svo/CMakeLists.txt fast/CMakeLists.txt
Also, I have been working on validating the availability of the SSSE3 instruction set in the CMakeLists.txt file, inspired on the following CMake macro: https://gist.github.com/hideo55/5642892. Here is the code:
IF(DEFINED ENV{ARM_ARCHITECTURE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
ELSE()
# Begin. SSSE3 Instruction Set availability validation. Inspired on https://gist.github.com/hideo55/5642892
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO)
STRING(REGEX REPLACE "^.*(ssse3).*$" "¥¥1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE)
IF (SSSE3_TRUE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3 -mssse3")
ELSE (SSSE3_TRUE)
MESSAGE(STATUS "Could not find support for SSSE3 on this machine.")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3")
ENDIF (SSSE3_TRUE)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3")
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# End. SSSE3 Instruction Set availability validation.
ENDIF()
For now, it only detects SSSE3 in Linux, and compiles directly without SSSE3 in Windows (as I can't use "/proc/cpuinfo" in WIndows). I haven't made a pull request because: 1) I haven't been able to test it on an SSSE3-enabled machine. 2) I don't know if any other validation could be useful. Would you like me to validate other intruction sets or any other aspect of the environment?
Thank you very much. Best regards, Yoshua Nava.
Even I'm having trouble running the given dataset. Is there a specific folder where the .launch file is expected to be saved?
When I run the following command error occurs. roslaunch svo_ros test_rig3.launch
Error specifies that it can't find svo_ros or test_rig3.launch.
Dear Mr./Mrs.: I'm trying to run SVO with the provided rosbag example file, but it crashes when I play the provided example rosbag, giving me this message when I run the node with gdb:
[ INFO] [1409154736.961603786]: SVO initialized [New Thread 0x7fffcf160700 (LWP 10433)] [ INFO] [1409154736.965555116]: Found parameter: svo/cam_topic, value: /camera/image_raw
Program received signal SIGILL, Illegal instruction. 0x00007ffff6d9f608 in vk::halfSample(cv::Mat const&, cv::Mat&) () from /home/alfredoso/catkin_ws/devel/lib/libvikit_common.so (gdb) quit
I'm running everything on ROS Indigo Igloo, with XUbuntu 14.04 64bits as the operating system. My computer has an AMD Phenom II N830 CPU, and an AMD Mobility Radeon HD 4250 GPU. Apart from the inclusion of gdb on the SVO launch file, SVO default configuration remains intact.
Could it be a problem with rpg_vikit? Something related to the 64bits SO? What would you recommend me to do?
Thank you very much for your time and your attention. Yoshua Nava.