-
Notifications
You must be signed in to change notification settings - Fork 223
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
[BUG]: Encounter segmentation faults in running the toy example on RHEL machines #561
Comments
This is very likely due to loading an incompatible shared library on your system. Usually there is some The workaround is to force a modern libc to get loaded first. |
Can you try the solutions posted in #347? In particular you can try to do: LD_PRELOAD=/path/to/modern/libstdc++.so.6 python my_script.py where for lib in $(find $CONDA_PREFIX -iname "*.so"); do echo $lib; ldd $lib | grep libstdc++; done; Also, if possible, is there any way you can create something I can reproduce your error in? Otherwise I am in the dark about the cause of this. Maybe like a docker container with RHEL that you are able to reproduce the error inside, and therefore I can run? |
Here's a working docker file based on RHEL. So it's at least not a universal RHEL issue, probably some old library somewhere that Python is picking up. The following dockerfile (based on RHEL 8) seems to work fine: FROM redhat/ubi8-minimal:8.9-1108.1706795067
RUN microdnf install -y python3.11 python3.11-pip
RUN python3.11 -m pip install pysr==0.17.1
# Install Julia pre-requisites:
RUN python3.11 -c 'import pysr'
# PySR run:
CMD ["python3.11", "-c", "import pysr; pysr.PySRRegressor().fit([[1]], [1])"] Build with docker build -t pysr -f Dockerfile . and test with docker run --rm -it pysr |
Thank you very much, Miles. I have checked the version of GLIBCXX for the conda environment, and it seems to be 3.4.30. I think the version is new enough to support most applications. As for your docker scheme, I will try it if possible. Since I will use pysr on our clusters, the deployment based on docker may be troublesome. |
I am facing the same error. PySr used to work perfectly fine, but since I upgraded PySR to newest version 2 days ago, |
Hm, very strange. It might be worth cross-posting this issue to https://github.com/JuliaPy/PythonCall.jl/issues. @cjdoris do you know why this might be happening with JuliaCall but not PyJulia (previous package used by PySR)? |
It seems like this might be the issue to track: JuliaPy/PythonCall.jl#464 |
172407 segmentation fault (core dumped) python #470 This one sounds relavent too. |
It sounds like it might be a Julia bug: JuliaLang/julia#53643 which is being patched as we speak 🎉 |
I agree. That may be the most possible cause, since the error message contains no information directly related to pysr. |
Are we just waiting for Julia's next release and hopefully the issue will be resolved? |
A temporary workaround would be to downgrade Julia to 1.10.0. You can do this by modifying {
"julia": "=1.10.0", and then reinstalling. Can you check if that solves it? If it does I can make a special branch that people can |
This trick seems to work! I got no errors now. |
I skip those broken Julia versions here: #565, fixing this issue. This is not actually a bug in Julia, but rather in libgomp – 1.10.1 and 1.10.2 are compiled against that broken libgomp. The issue should be fixed (verify it installs any Julia except 1.10.1 and 1.10.2). If not please let me know. |
segmentation faults
Hi, I installed pysr with "conda create -n sr -c conda forge pysr", and then I was trying to run a script of the following toy example
import numpy as np
from pysr import *
X = 2 * np.random.randn(100, 5)
y = 2 * np.cos(X[:, 3]) + X[:, 0] ** 2 - 2
model = PySRRegressor(binary_operators=["+", "-", "*", "/"])
model.fit(X, y)
print(model)
When I ran the script for the first time, the juliapkg installed the dependences as well. However, no matter how many times I ran the script, the running always encountered the segmentation faults. The installation and running were implemented on other RHEL machines too, but the running still failed.
Version
0.17.1
Operating System
Linux
Package Manager
Conda
Interface
Script (i.e.,
python my_script.py
)Relevant log output
Extra Info
No response
The text was updated successfully, but these errors were encountered: