-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
import numpy crashes at xgetbv instruction in npy_cpu_supports on a VM #15342
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
Comments
While trying to learn more about this problem, I found a bug report at another project where there was a crash at xgetbv on a machine that had avx support disabled. The fix there was to check that the CPUID.1:ECX.OSXSAVE bit is set first. I wasn't sure if something like that might be applicable for numpy too. |
I got the same error on a Google Cloud VM.
So it appears that this thing does have avx and avx2 support in general, but not the In my case the crash points to the specific version and line: It seems that the According to "Intel(R) Advanced Vector Extensions Programming Reference", Ref. # 319433-011
|
@mattip, @seiko2plus does the new/proposed cpu detection code solve this issue? And @qfan is there a simple fix you can suggest to our current cpu detection functionality? |
I do not know any x86 assembly. But the "Intel(R) Advanced Vector Extensions Programming Reference" PDF (you can google it, but intel does not provide a direct link) has a 17-line pseudo-code for checking this, near the "note" I quoted in previous comment. |
@ryandesign, yes that's right, |
I applied your pull request to numpy/master and it does work on that Westmere CPU. Great Job!
I'm going to lose access to this VM tomorrow, though. So I probably won't be able to test this again if you make any change later. |
It does on my macOS Sierra VM, thank you.
|
1.19.0 fixes this. Thanks. |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I run the MacPorts automated build system and we have been experiencing an issue for awhile where
import numpy
causes Python to crash. I don't know if this happens for any users running macOS directly on their Macs but it does happen on one of our build machines—the one running macOS Sierra 10.12. The other build machines (which run earlier and later macOS versions) don't experience the problem. All the build machines are virtual machines running under VMware ESXi 6 on 2009-model Xserves.I believe this is similar to or the same as #13059 but in case it's not I didn't want to mix up my information in that issue. In that issue, @eric-wieser speculated that
HAVE_XGETBV
is being set incorrectly. As my lldb trace below shows, we are crashing at thexgetbv
instruction.@seberg asked in #13059 if the problem was the VM claiming to support AVX when it does not. I have used the sample program posted by @ulido in #10330 to check whether the machine claims to have avx support (using
__builtin_cpu_supports("avx")
). In my case here in this macOS 10.12 VM, the sample program says "AVX not supported!"Reproducing code example:
Error message:
I am sorry, I am not familiar with gdb, but here's what happens under lldb:
Numpy/Python version information:
Python 3.7.6
Numpy 1.18.1
macOS 10.12.6 Build version 16G2136
Xcode 9.2 Build version 9C40b
Apple LLVM version 9.0.0 (clang-900.0.39.2)
The text was updated successfully, but these errors were encountered: