Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: cannot build on i5 CPU with gcc 7.3.0 #18945

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

Closed
themaddoctor opened this issue May 8, 2021 · 7 comments · Fixed by #18970
Closed

BUG: cannot build on i5 CPU with gcc 7.3.0 #18945

themaddoctor opened this issue May 8, 2021 · 7 comments · Fixed by #18970
Labels
32 - Installation Problems installing or compiling NumPy

Comments

@themaddoctor
Copy link

Cannot build on my processor. Have a nice day.

/tmp/ccdUWuax.s:115235: Error: no such instruction: `kmovb %eax,%k1'
/tmp/ccdUWuax.s:115236: Error: no such instruction: `vpmovm2q %k1,%zmm4'
/tmp/ccdUWuax.s:115340: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115349: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115351: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115353: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115355: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115357: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115359: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115361: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115363: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115365: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115367: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115369: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115599: Error: no such instruction: `kmovb %eax,%k1'
/tmp/ccdUWuax.s:115600: Error: no such instruction: `vpmovm2q %k1,%zmm4'
/tmp/ccdUWuax.s:115709: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115718: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115720: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115722: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115724: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115726: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115728: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115730: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115732: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115734: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115736: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115738: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:115968: Error: no such instruction: `kmovb %eax,%k1'
/tmp/ccdUWuax.s:115969: Error: no such instruction: `vpmovm2q %k1,%zmm4'
/tmp/ccdUWuax.s:116078: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116087: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116089: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116091: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116093: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116095: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116097: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116099: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116101: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116103: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116105: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116107: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116337: Error: no such instruction: `kmovb %eax,%k1'
/tmp/ccdUWuax.s:116338: Error: no such instruction: `vpmovm2q %k1,%zmm4'
/tmp/ccdUWuax.s:116442: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116451: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116453: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116455: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116457: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116459: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116461: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116463: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116465: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116467: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116469: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116471: Error: operand size mismatch for `vmovdqa64'
/tmp/ccdUWuax.s:116700: Error: no such instruction: `kmovb %eax,%k1'
/tmp/ccdUWuax.s:116701: Error: no such instruction: `vpmovm2q %k1,%zmm4'
error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.linux-x86_64-3.7/numpy/core/src/_simd -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Ibuild/src.linux-x86_64-3.7/numpy/distutils/include -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/usr/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/common -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.avx512_skx.c -o build/temp.linux-x86_64-3.7/build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.avx512_skx.o -MMD -MF build/temp.linux-x86_64-3.7/build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.avx512_skx.o.d -Werror -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq" failed with exit status 1

########### EXT COMPILER OPTIMIZATION ###########
Platform      :
  Architecture: x64
  Compiler    : gcc

CPU baseline  :
  Requested   : 'min'
  Enabled     : SSE SSE2 SSE3
  Flags       : -msse -msse2 -msse3
  Extra checks: none

CPU dispatch  :
  Requested   : 'max -xop -fma4'
  Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX
  Generated   :
              :
  SSE41       : SSE SSE2 SSE3 SSSE3
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1
  Extra checks: none
  Detect      : SSE SSE2 SSE3 SSSE3 SSE41
              : numpy/core/src/umath/_umath_tests.dispatch.c
              :
  SSE42       : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2
  Extra checks: none
  Detect      : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42
              : build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.c
              :
  AVX2        : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mavx2
  Extra checks: none
  Detect      : AVX F16C AVX2
              : numpy/core/src/umath/_umath_tests.dispatch.c
              :
  (FMA3 AVX2) : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2
  Extra checks: none
  Detect      : AVX F16C FMA3 AVX2
              : build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.c
              :
  AVX512F     : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f
  Extra checks: AVX512F_REDUCE
  Detect      : AVX512F
              : build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.c
              :
  AVX512_SKX  : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD
  Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq
  Extra checks: none
  Detect      : AVX512_SKX
              : build/src.linux-x86_64-3.7/numpy/core/src/_simd/_simd.dispatch.c
CCompilerOpt._cache_write[796] : write cache to path -> /mnt/quadrupole/sources/math/numpy-1.20.2/build/temp.linux-x86_64-3.7/ccompiler_opt_cache_ext.py

########### CLIB COMPILER OPTIMIZATION ###########
Platform      :
  Architecture: x64
  Compiler    : gcc

CPU baseline  :
  Requested   : 'min'
  Enabled     : SSE SSE2 SSE3
  Flags       : -msse -msse2 -msse3
  Extra checks: none

CPU dispatch  :
  Requested   : 'max -xop -fma4'
  Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX
  Generated   : none
CCompilerOpt._cache_write[796] : write cache to path -> /mnt/quadrupole/sources/math/numpy-1.20.2/build/temp.linux-x86_64-3.7/ccompiler_opt_cache_clib.py

Reproducing code example:

import numpy as np
<< your code here >>

Error message:

NumPy/Python version information:

@charris
Copy link
Member

charris commented May 8, 2021

What processor? What compiler? What OS?

@themaddoctor
Copy link
Author

i7
gcc 7.3
linux (generic)

@themaddoctor
Copy link
Author

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
stepping        : 9
microcode       : 0x15
cpu MHz         : 3400.117
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips        : 6800.23
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

@charris
Copy link
Member

charris commented May 8, 2021

Hmm, I run an i5-4670K which is very similar, except that it has AVX2 that seems to be missing from yours. @seiko2plus Thoughts?

@rkern
Copy link
Member

rkern commented May 8, 2021

I wonder if the age of gcc is more the culprit here, as in #14787

@mattip mattip changed the title cannot build on older processors BUG: cannot build on i7 with gcc 7.3.0 May 8, 2021
@rgommers rgommers added the 32 - Installation Problems installing or compiling NumPy label May 8, 2021
@rgommers rgommers changed the title BUG: cannot build on i7 with gcc 7.3.0 BUG: cannot build on i5 CPU with gcc 7.3.0 May 8, 2021
@seiko2plus
Copy link
Member

seiko2plus commented May 8, 2021

@themaddoctor, I'm not sure what kinda a setup you have but according to your build error, you have a mismatched combination of old assembler and modern compiler. In other words, your compiler supports AVX512 but your assembler is not. probably you're running gcc7.3 on outdated Linux distribution(old version of GNU Binutils).

It is not clear to me your intention behind building NumPy from the source, but you have several options here:

  • upgrade your gnu binutils
  • use the default compiler that comes with your distro
  • just disable AVX512

If you're going to use this build only for your local machine then maybe you just need to disable AVX512 since your CPU doesn't support it anyway.

Try to use one of the following options to disable AVX512 according to your need:

cd /path/to/numpy
# 1- Disable dynamic dispatching AVX512 in runtime
# good option if you have any intention to ship this build to run on different users or platforms rather than yours.
python setup.py build --cpu-dispatch="max -avx512_knl -avx512_knm -avx512_skx -avx512_clx -avx512_cnl -avx512_icl"  install

# 2- same as the above but via PIP
pip install -v --no-use-pep517 --global-option=build \
   --global-option="--cpu-dispatch=max -avx512_knl -avx512_knm -avx512_skx -avx512_clx -avx512_cnl -avx512_icl" ./

# 3- Disable all dynamic dispatching for all CPU features and enables only CPU features that supported by your local/host CPU  via static dispatching (baseline)
# best option for you if you're not planning to ship this build to other users

python setup.py build --cpu-baseline="native" --cpu-dispatch="none"  install

# 4- same as the above but via PIP
pip install -v --no-use-pep517 --global-option=build --global-option="--cpu-baseline=native" \
   --global-option="--cpu-dispatch=none" ./

From our side, we will release a new patch to test AVX instructions against the assembler during the build-time to avoid such issues as this.

@themaddoctor
Copy link
Author

Thanks. I'll try option 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
32 - Installation Problems installing or compiling NumPy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants