[Bug target/85100] __builtin_cpu_supports avx does not verify OS supports it
njs at pobox dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 28 01:53:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85100
Nathaniel J. Smith <njs at pobox dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |njs at pobox dot com
--- Comment #1 from Nathaniel J. Smith <njs at pobox dot com> ---
For context here: NumPy currently uses __builtin_cpu_supports("avx") to decide
whether it can use AVX-accelerated numerical kernels. We've been getting
regular bug reports from users where this __builtin_cpu_supports("avx")
returned true, but then NumPy crashes with a SIGILL when it tries to use AVX.
(It seems to be related to some kind of relatively common virtualization
configurations.)
Examples:
https://github.com/numpy/numpy/issues/10787
https://github.com/numpy/numpy/issues/9532
https://github.com/numpy/numpy/issues/10330
https://github.com/numpy/numpy/issues/9534
Now that Julian finally figured it out, I guess we'll work around it by calling
xgetbv ourselves:
https://github.com/numpy/numpy/pull/10814
but it really seems like it would be better if __builtin_cpu_supports would
check this itself.
More information about the Gcc-bugs
mailing list