oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.2k stars 104 forks source link

NumPy fails with baseline optimization AVX512F #419

Closed laserjim closed 2 weeks ago

laserjim commented 2 weeks ago

Creating an issue for posterity, somehow I got myself into a situation where after installing numpy and trying to run a program that used it, I got the following error:

RuntimeError: NumPy was built with baseline optimizations:
(SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX) but your machine doesn't support:
(AVX512F).
laserjim commented 2 weeks ago

Posting for posterity. What resolved the issue for me was to do a pip uninstall purge the cache and then do a pip install with some cflags as below:

graalpy -m pip uninstall numpy
graalpy -m pip cache purge
CFLAGS="-march=native -O2 -mno-avx512f" graalpy -m pip install numpy==1.23.5 --no-cache-dir --no-binary :all:

This might be overly nuclear (I'm not sure that all those flags are necessary nor which ones specifically resolved my issue), but it worked for me ;).