-
Notifications
You must be signed in to change notification settings - Fork 94
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
The solver hangs if I compile with threads and run it from python. #8
Comments
By now, I could figure out that there is a problem in minisam/python/minisam_wrapper/factor.cpp in PYBIND11_OVERLOAD_PURE(Eigen::VectorXd, Factor, error, variables); (line 70). However, I don't know how pybind works... |
Hi @stschubert , my feeling is I must have a bug in multi-threading and causes deadlock. Do you have the example here which will helps me debug a lot? Thanks! |
I just came across this discussion about python bindings and multi-threading, and thought that it might be related. |
I was able to reproduce the issue with the gps_factor_example.py. I can also confirm that it has to do with the GIL. Running the code through a debugger it deadlocks currently on minisam/minisam/core/FactorGraph.cpp Line 83 in eda47f9
and
pybind11::gil_scoped_release release;
// wait threads to finish
for (int i = 0; i < MINISAM_WITH_MULTI_THREADS_NUM; i++) {
linthreads[i].join();
}
Update: A better fix is provided in #10. It is cleaner and does not require a Python dependency. |
should be fixed by PR1 |
Is there anything new about the below reported issue? I'm asking since I have the same problem.
Update: Looks like the solver hangs if I compile with threads and run it from python. I removed the cmake flags above.
Originally posted by @NikolausDemmel in #7 (comment)
The text was updated successfully, but these errors were encountered: