1

I'm building an application that uses OpenCV that will run on a variety of Windows computers (using Win7, Win8, Win10).

Now I have discovered that my application crashes randomly at some computers. After a lot of googling I have realized that enabling SSE3 in OpenCV can cause Illegal Instruction crashes on processors that doesn't support SSE3.

http://answers.opencv.org/question/18001/illegal-instruction-when-running-any-compiled-opencv-demo-binary-sse3-flag/

https://bugs.launchpad.net/linuxmint/+bug/1258259

So this is my question: Does anyone of you know which processor flags are "safe". I understand what they do, but I don't know how common it is for a processor to support, for instance, SSE42.

In other words: Which of these flags do you think I should disable when I compile OpenCV?

OCV_OPTION:

ENABLE_SSE
ENABLE_SSE2
ENABLE_SSE3
ENABLE_SSSE3
ENABLE_SSE41
ENABLE_SSE42
ENABLE_POPCNT
ENABLE_AVX
ENABLE_AVX2
ENABLE_FMA3
4-bit
  • 230
  • 3
  • 13
  • it depends on the target computers. You can go with SSE2 I think it is safe for you. Use `-DENABLE_SSE3=OFF & -DENABLE_SSE=ON` in cmake build – MD. Nazmul Kibria Oct 20 '16 at 09:30
  • 2
    You can probably compile with all optimization, and disable them if they are not supported. You can use [checkHardwareSupport](http://stackoverflow.com/q/32477403/5008845) to enable/disable optimization at runtime – Miki Oct 20 '16 at 09:36
  • @MD.NazmulKibria Thanks for the reply! When you say I should go with SSE2, do you mean that I should disable all other options, i.e. POPCNT=OFF, AVX=OFF, FMA3=Off and so on. – 4-bit Oct 20 '16 at 10:03
  • you can check the flags while configuring cmake, you can search and if those are enabled you can turn off. – MD. Nazmul Kibria Oct 20 '16 at 10:04

0 Answers0