This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/85100] __builtin_cpu_supports avx does not verify OS supports it
- From: "njs at pobox dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Mar 2018 01:53:13 +0000
- Subject: [Bug target/85100] __builtin_cpu_supports avx does not verify OS supports it
- Auto-submitted: auto-generated
- References: <bug-85100-4@http.gcc.gnu.org/bugzilla/>
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.