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

Illegal Instruction: 4 #5

Open
elbamos opened this issue Jan 20, 2016 · 3 comments
Open

Illegal Instruction: 4 #5

elbamos opened this issue Jan 20, 2016 · 3 comments

Comments

@elbamos
Copy link

elbamos commented Jan 20, 2016

Mac OS X 10.11.2, with anaconda.

>>> detector = dlib.get_frontal_face_detector()
Illegal instruction: 4

That usually means a binary used an instruction not supported by the CPU. My machine doesn't have AVX (its a MacPro 2008), but your distro says its built without AVX anyway.

Current conda install:

             platform : osx-64
        conda version : 3.19.0
  conda-build version : 1.18.2
       python version : 3.4.3.final.0
     requests version : 2.9.0
     root environment : /Volumes/home500/anaconda  (writable)
  default environment : /Volumes/home500/anaconda/envs/openface
     envs directories : /Volumes/home500/anaconda/envs
        package cache : /Volumes/home500/anaconda/pkgs
         channel URLs : https://conda.anaconda.org/menpo/osx-64/
                        https://conda.anaconda.org/menpo/noarch/
                        https://repo.continuum.io/pkgs/free/osx-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/osx-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : /Users/aelberg/.condarc
    is foreign system : False

# packages in environment at /Volumes/home500/anaconda/envs/openface:
#
boost                     1.56.0                   py27_2    menpo
bzip2                     1.0.6                         0    defaults
cycler                    0.9.0                    py27_0    defaults
decorator                 4.0.6                    py27_0    defaults
dlib                      18.16                    py27_3    menpo
freetype                  2.5.5                         0    defaults
jbig                      2.1                           0    defaults
jpeg                      8d                            1    <unknown>
libpng                    1.6.17                        0    <unknown>
libtiff                   4.0.6                         1    defaults
mako                      1.0.3                     <pip>
matplotlib                1.5.1               np110py27_0    defaults
networkx                  1.10                     py27_0    defaults
numpy                     1.10.2                   py27_0    defaults
opencv                    2.4.11                   py27_1    menpo
openssl                   1.0.2e                        0    defaults
pandas                    0.17.1              np110py27_0    defaults
pillow                    3.1.0                    py27_0    defaults
pip                       7.1.2                    py27_0    defaults
pygpu                     0.2.1                     <pip>
pyparsing                 2.0.3                    py27_0    defaults
pyqt                      4.11.4                   py27_1    defaults
python                    2.7.11                        0    defaults
python-dateutil           2.4.2                    py27_0    defaults
pytz                      2015.7                   py27_0    defaults
qt                        4.8.7                         1    defaults
readline                  6.2                           2    <unknown>
scikit-image              0.11.3              np110py27_0    defaults
scikit-learn              0.17                np110py27_1    defaults
scipy                     0.16.1              np110py27_0    defaults
setuptools                19.2                     py27_0    defaults
sip                       4.16.9                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.8.4.1                       1    <unknown>
tbb                       4.3_20141023                  0    menpo
tk                        8.5.18                        0    <unknown>
wheel                     0.26.0                   py27_1    defaults
xz                        5.0.5                         0    <unknown>
zlib                      1.2.8                         0    <unknown>

Can you advise how to track this down?

@patricksnape
Copy link
Contributor

Hmm, but I do build with SSE 4.1 - which I don't think is supported on a the processor in the MacPro 2008 Edition. It should actually be relatively easy for you to build dlib yourself using this repo:

conda config --add channels http://conda.anaconda.org/menpo
conda build conda --py=27

You may need to edit the build.sh to explicitly turn SSE4 instructions off. Worst case, you can also try explicitly turning AVX off as well.

Apologies for that, this is part of the reason why distributing binaries is so complicated!

@elbamos
Copy link
Author

elbamos commented Jan 21, 2016

Should support SSE 4.1. See: https://en.wikipedia.org/wiki/List_of_Macintosh_models_grouped_by_CPU_type#Penryn

It looks like the installer checks and enables SSE4.1 if it detects a 64-bit OS, which seems correct to me.

But, either way, with SSE4 in build.sh hardcoded in or out, the same thing happens:

Fetching packages ...
dlib-18.16-py2 100% |###############################################################################################################################################| Time: 0:00:00  42.98 MB/s
Extracting packages ...
[      COMPLETE      ]|##################################################################################################################################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################################################################################################################################| 100%
===== testing package: dlib-18.16-py27_3 =====
import: 'dlib'
running run_test.py
TESTS FAILED: dlib-18.16-py27_3

Is it possible that the error is being emitted by opencv?

@patricksnape
Copy link
Contributor

That's weird. OpenCV isn't required by dlib so it definitely isn't OpenCV.

Normally illegal instructions come from building on a new OSX version and then running on an older one. However, you are using 10.11 too so that seems strange. The only other options I can think of are:

  1. Try building without any SSE/AVX instructions at all. Explicitly disable them in CMAKE.
  2. Try rebuilding boost as well.

Other than that there aren't really any other dependencies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants