yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.22k stars 112 forks source link

"illegal hardware instruction" in an environment with python binding 2.0.2 #123

Closed shirayu closed 1 year ago

shirayu commented 1 year ago

I got SIGILL by running the sample code of ngtpy (pybind11) with ngt 2.0.2 in PyPI.

illegal hardware instruction

It works fine with ngt 1.14.6. This may be related to #116.

Environment

$  python3 -V
Python 3.10.4

$  cat /etc/debian_version

11.5
$  grep -A1 name poetry.lock
name = "ngt"
version = "2.0.2"
--
name = "numpy"
version = "1.23.3"
--
name = "pybind11"
version = "2.10.0"

$  grep -m1 -B999 ^$ /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 79
model name      : Intel(R) Xeon(R) CPU @ 2.20GHz
stepping        : 0
microcode       : 0xffffffff
cpu MHz         : 2199.998
cache size      : 56320 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
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 mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat md_clear arch_capabilities
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa mmio_stale_data retbleed
bogomips        : 4399.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
masajiro commented 1 year ago

I have released the ngtpy to fix this problem. However, the latest one even requires AVX2 since QG and QBG requires AVX2 or AVX512. If your CPU doesn't have AVX2, please use v1.14.6 to avoid the same error. I am reconsidering how to provide PyPI distributions.

shirayu commented 1 year ago

Thank you for your quick response. It worked fine!