apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.77k stars 6.79k forks source link

Illegal instruction (core dumped) when running mxnet on Intel NUC #17613

Closed gachiemchiep closed 4 years ago

gachiemchiep commented 4 years ago

Description

Illegal instruction (core dumped) when running mxnet on Intel NUC

Error Message

Illegal instruction (core dumped)

What have you tried to solve it?

  1. try with mxnet version 1.5.1 and 1.5.0
  2. Also try mxnet on anaconda channel

Environment

With mxnet

(base) jil@jil-NUC1:~$ curl --retry 10 -s https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | python
----------Python Info----------
Version      : 3.6.9
Compiler     : GCC 7.3.0
Build        : ('default', 'Jul 30 2019 19:07:31')
Arch         : ('64bit', '')
------------Pip Info-----------
Version      : 20.0.2
Directory    : /home/jil/opt/miniconda2/lib/python3.6/site-packages/pip
----------MXNet Info-----------
Illegal instruction (core dumped)

Without mxnet

(base) jil@jil-NUC1:~$ curl --retry 10 -s https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | python
----------Python Info----------
Version      : 3.6.9
Compiler     : GCC 7.3.0
Build        : ('default', 'Jul 30 2019 19:07:31')
Arch         : ('64bit', '')
------------Pip Info-----------
Version      : 20.0.2
Directory    : /home/jil/opt/miniconda2/lib/python3.6/site-packages/pip
----------MXNet Info-----------
An error occured trying to import mxnet.
This is very likely due to missing missing or incompatible library files.
Traceback (most recent call last):
  File "<stdin>", line 119, in check_mxnet
AttributeError: module 'mxnet' has no attribute '__version__'

----------System Info----------
Platform     : Linux-5.3.0-28-generic-x86_64-with-debian-buster-sid
system       : Linux
node         : jil-NUC1
release      : 5.3.0-28-generic
version      : #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020
----------Hardware Info----------
machine      : x86_64
processor    : x86_64
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               122
Model name:          Intel(R) Pentium(R) Silver J5005 CPU @ 1.50GHz
Stepping:            1
CPU MHz:             2665.239
CPU max MHz:         2800.0000
CPU min MHz:         800.0000
BogoMIPS:            2995.20
Virtualization:      VT-x
L1d cache:           24K
L1i cache:           32K
L2 cache:            4096K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 pti cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts umip rdpid md_clear arch_capabilities
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0492 sec, LOAD: 1.1357 sec.
Timing for GluonNLP GitHub: https://github.com/dmlc/gluon-nlp, DNS: 0.0009 sec, LOAD: 0.6649 sec.
Timing for GluonNLP: http://gluon-nlp.mxnet.io, DNS: 0.0540 sec, LOAD: 0.4060 sec.
Timing for D2L: http://d2l.ai, DNS: 0.8167 sec, LOAD: 0.1636 sec.
Timing for D2L (zh-cn): http://zh.d2l.ai, DNS: 0.0497 sec, LOAD: 0.1626 sec.
Timing for FashionMNIST: https://repo.mxnet.io/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1074 sec, LOAD: 0.3472 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.1168 sec, LOAD: 1.3224 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0408 sec, LOAD: 0.3128 sec.

Please help .

TaoLv commented 4 years ago

The binaries you used needs AVX2 instruction. See discussion in https://github.com/apache/incubator-mxnet/issues/11911.

gachiemchiep commented 4 years ago

Hello @TaoLv
Thanks man. The discussion did help me understand the problem. I will try to compile mxnet to check whether my problem could be solved.

leezu commented 4 years ago

The static build scripts have been updated to avoid AVX instructions. Try running the CMAKE_STATICBUILD=1 tools/staticbuild/build.sh cpu as per the instructions in https://github.com/apache/incubator-mxnet/tree/master/tools/staticbuild

Alternatively you can directly compile on the NUC and the compiler will refrain from using AVX if the processor doesn't support it.

gachiemchiep commented 4 years ago

Hello, @leezu . Is the staticbuild tool support cross-compiling for the NUC?

gachiemchiep commented 4 years ago

Hi @TaoLv , @leezu
Thank you for your support. Re-compiling mxnet on the NUC fix my problem