cvg / pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
Apache License 2.0
1.29k stars 132 forks source link

Crash on M1 #113

Open ducha-aiki opened 11 months ago

ducha-aiki commented 11 months ago

Hi,

I have remembered why I needed all that "FindPythonPyEnv" business. Without it, after successful compilation, I got the import crash:

(pytorch) dmytromishkin@Z000845-845 ~/dev python
Python 3.9.16 (main, Mar  8 2023, 04:29:24) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pixsfm
Fatal Python error: take_gil: PyMUTEX_LOCK(gil->mutex) failed
Python runtime state: unknown

zsh: abort      python

And the solution I was using is actually described in the still open PyBind11 issues: https://github.com/pybind/pybind11/issues/3081#issuecomment-935902332

ducha-aiki commented 11 months ago

@Skydes @Tobias-Fischer

The explanation in that thread is that

Using the classic find_package(pybind11 REQUIRED) & then pybind11_add_module(XX MODULE $SRCS) lead to python being hardlinked causing the PyMutex_Lock.