-
Notifications
You must be signed in to change notification settings - Fork 838
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
StructureMatcher.get_rms_dist illegal instruction on release pymatgen==2020.6.8. #1868
Comments
If you installed pymatgen via conda, pls try to do pip install --upgrade pymatgen. This error is usually a symptom that something is wrong with the compilation of the C extensions and happens quite frequently on Linux based systems. |
I have not installed pymatgen through conda. I have simply pip installed it. This is also making my pipelines fail on gitlab so it's not just my laptap. I just ran the above script in a virtual environment and it still fails. I set the venv up like in the following:
So I don't see that it should be something with my setup. Since you closed the issue I was hoping you could help me figure out what is wrong. As I wrote: It worked in the previous release. |
Sorry I forgot that I also had to install ASE in the venv to make the script work. The magic incantation to set up the environment is:
|
Does it fail for all scripts, or is it just the specific code you showed that is an issue? As far as I know, nothing has changed since v2020.4 that would cause this. There were some issues with sympy... |
I'm sorry I don't know whether anything has broken since I am essentially only using the StructureMatcher functionality in my scripts. Could it be that something went wrong in the building of the wheels (I am no expert on this)? Just to make absolute sure that everything works in the previous release I checked this in a venv:
Can the issue be reproduced on your pc? |
I do not have such an error on my Mac. It would help if you can run other scripts to check if this is something wrong in the core of pymatgen or whether it is just in StructureMatcher. Otherwise, I have no way of debugging this. |
Ok so I have found that the function "find_points_in_spheres" is causing the crash. I have made a minimal example here which crashed on my computer:
This function is being called when the structurematcher tries to Niggli reduce the input structures. Has something changed in this function? |
I hope this helps, otherwise let me know. |
We're also encountering this issue in our CI, see the aiidateam/aiida-core#4111 My suspicion is that this is caused by the wheel being built against a CPU instruction set that is not fully supported on the machines where it crashes. @mortengjerding what's the output of Looking at the wheel itself ( $ grep -inR AVX2 .
Binary file ./pymatgen/optimization/neighbors.cpython-38-x86_64-linux-gnu.so matches If that's the case, the immediate workaround would be installing it without the wheel, i.e. pip install --no-binary pymatgen pymatgen |
Ah thank you. Indeed, that is likely the issue. The strange thing is, I never upload wheels for Linux precisely because of this reason. @mkhorton Do you know what happened with the previous release? Usually I just upload the Windows and Mac wheels and for Linux, I just assume that it can be compiled from the tar.gz easily. Linux is very fussy about compilers etc. |
@greschd That would also be my understanding. The output of cpuinfo indicates that my processor supports avx2 instructions:
|
@mortengjerding Can you try pip install --no-binary pymatgen and see if that causes the problem to disappear? We will remove the Linux wheels in future releases. |
Yeah, it could well be a different incompatibility in which instructions are supported..
Note that you have to pass |
I have just tried and can confirm that installing with |
Thanks for the debug. We will handle the rest from our end. |
@shyuep maybe you could remove the Linux wheels for the current release? Not sure what your policy on removing already-published wheels is, but in this case it's likely to fix more issues than it causes. |
I already did. Removing wheels is fine. For Linux users, they will default to the tar.gz anyway. |
Fantastic, thanks! |
Yes, this was on me -- I was trying to improve our cross-platform support with the latest release for pip users. Wheels should have been compliant with manylinux2010 (see PEP 571) and seemed to work. However, evidently this is not the case, so thanks for the report @mortengjerding and @greschd and my apologies for the inconvenience. Back to the drawing board on this! |
Ok. @mkhorton Let's not distribute wheels for Linux in future. The benefit of wheels on Linux platforms is marginal, since there are seldom compilation issues on those platforms. Wheels are useful mainly for Windows and Macs where the compilers may sometimes not be available. |
Describe the bug
On the most recent release of pymatgen (2020.6.8) I am now getting "Illegal instruction" when running the
pymatgen.structure_matcher.StructureMatcher.get_rms_dist
. This did not happen on the previous release (2020.4.29).To Reproduce
The following script
results in "Illegal instruction (core dumped)".
Expected behavior
The result of the get_rms_dist should be zero.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: