Ask Your Question
0

This OpenCV build doesn't support current CPU/HW configuration

asked 2018-05-10 00:09:49 -0600

Begueradj gravatar image

On Ubuntu 16.04, I installed this Docker image.

I got this error message:

begueradj@h4ck3r~$ sudo docker run -it jjanzic/docker-python3-opencv python 
Python 3.6.4 (default, Feb 17 2018, 09:32:33) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2

******************************************************************
* FATAL ERROR:                                                   *
* This OpenCV build doesn't support current CPU/HW configuration *
*                                                                *
* Use OPENCV_DUMP_CONFIG=1 environment variable for details      *
******************************************************************

Required baseline features:
SSE - OK
SSE2 - OK
SSE3 - OK
SSSE3 - OK
SSE4.1 - OK
POPCNT - OK
SSE4.2 - OK
AVX - NOT AVAILABLE
OpenCV(3.4.1) Error: Assertion failed (Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup.) in initialize, file /opencv-3.4.1/modules/core/src/system.cpp, line 487
terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(3.4.1) /opencv-3.4.1/modules/core/src/system.cpp:487: error: (-215) Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup. in function initialize

How to fix it?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-05-10 03:03:14 -0600

rwong gravatar image

This can only be solved by:

  • (Recommended) Find a different docker image, in which the CPU architecture requirement is lowered so that it is compatible with your computer.
  • (Also recommended) Learn to build the docker image yourself, which will also teach you how to compile the C++ portion of OpenCV on your computer.
  • Contacting the author of this docker image, to see if this author is willing to lower the CPU architecture requirement (not recommended, because the author has no obligation to you.)

To help diagnose, please run this command on your linux system, and paste the output here.

cat /proc/cpuinfo

Pay attention to the line of output that says flags : and list all of the labels here.

If your computer does not support some of the newer CPU architecture extensions, different C++ compiler flags are required when the C++ portion of the OpenCV library is compiled. This is true for Python users as well, because the source code that implements most OpenCV functionality are written in C++.

The C++ portion of OpenCV is configured and built using CMake. CMake simplifies configuration by letting users change configuration with a GUI. For example, one can point-and-click on the GUI to lower the CPU architecture level.

You can see the portion of CMake outputs from the detailed build logs from the docker image.

edit flag offensive delete link more

Comments

3

You can take a look at the Dockerfile: https://github.com/janza/docker-pytho... - it uses deprecated cmake parameter: -DENABLE_AVX=ON. Recent versions of OpenCV use CPU_BASELINEoption to set minimal required optimization level. Read more here: https://github.com/opencv/opencv/wiki...

So you will have to replace it with something like -DCPU_BASELINE=SSE4_2(supported options can be found in this file: https://github.com/opencv/opencv/blob...)

mshabunin gravatar imagemshabunin ( 2018-05-10 03:26:07 -0600 )edit

very useful feedback, thank you very much @mshabunin

Begueradj gravatar imageBegueradj ( 2018-05-10 03:32:54 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-10 00:07:51 -0600

Seen: 5,409 times

Last updated: May 10 '18