Intel® Distribution for Python*
Support and discussions for achieving faster Python* applications and core computational packages.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

illegal instruction on intel python2 when importing caffe

Ellák_S_
Beginner
509 Views

Hi,

I am trying to use caffe with intel python2.7 v2017.3, but executing "import caffe" results in crashing the interpreter with "Illegal instruction". (The same error was seen on v2017.2.)

My cpu is i5-3570 (which has sse4_2), os is debian-8 jessie. The /proc/cpuinfo file is attached.

Thank you for looking into this!

0 Kudos
6 Replies
Christophe_H_Intel2
509 Views

Hi Ellak,

Thanks for reporting this.

I believe this may be linked to an issue in Pandas.  Can you reproduce the error by running the following command?

python -c 'import pandas'

Chris

Ellák_S_
Beginner
509 Views

Hi Chris,

thank you response. Pandas is imported fine (and works fine), for the moment I only got into problems with caffe. With bash:

/opt/intel/intelpython2/bin/python -c 'import caffe; print "ok"' ; echo $?
Illegal instruction
132

/opt/intel/intelpython2/bin/python -c 'import pandas; print "ok"' ; echo $?
ok

0


Cheers,
-Ellak

Christophe_H_Intel2
509 Views

Hi Ellak,

Can you try importing pytables?

$ python -c 'import tables'

Thanks for your patience,

Chris

Ellák_S_
Beginner
509 Views

Hi Chris,

importing tables works fine (as well as numpy, scipy, h5py, theano).

In /opt/intel/intelpython2/bin there are some caffe related binaries, those crash as well:

$ /opt/intel/intelpython2/bin/caffe ; echo $?
Illegal instruction
132

Same for /opt/intel/intelpython2/bin/classification . 

Everything runs fine on the newer i5-7500 (including python -c 'import caffe', the caffe binary etc), but not on the i5-3570.  Is there a chance some exclusive architecture specific optimization was invoked when compiling caffe, which works with new cpus like i5-7500, but not with somewhat older ones like i5-3570 ?

Cheers,
-Ellak

Christophe_H_Intel2
509 Views

Hi Ellak,

Thanks for troubleshooting.  The optimizations done to Intel Caffe rely on the presence of AVX2. I'm working on a Caffe build that will work on all architectures that Intel Python supports so people will not encounter the illegal instruction error if they don't have AVX2, but AVX2 is still necessary to take advantage of the performance enhancements provided by Intel Caffe. 

Chris

Ellák_S_
Beginner
509 Views

Hi Chris,

I checked, and indeed the i5-3570 does not have avx2. I would greatly appreciate if you could provide a compiled caffe binary which works without avx2. I understand this means performace dip, but at least it would run on the avx2-less cpus.

Thank you in advance!

-Ellak

Reply