kyamagu / faiss-wheels

Unofficial faiss wheel builder
MIT License
291 stars 38 forks source link

Segfault in macOS in the presence of other OpenMP dependent packages #73

Open kyamagu opened 1 year ago

kyamagu commented 1 year ago

Describe the bug faiss may crash when there is another imported package that depends on libomp.

To Reproduce Import a package that depends on OpenMP on macOS, then import faiss-cpu package. Use faiss as usual.

Expected behavior Should not segfault.

Desktop (please complete the following information):

Additional context https://github.com/facebookresearch/faiss/issues/2463 https://github.com/benfred/implicit/issues/613#issuecomment-1242566564 https://github.com/dmlc/xgboost/issues/7039#issuecomment-860932242 https://bugs.llvm.org/show_bug.cgi?id=50579

kyamagu commented 1 year ago

https://github.com/pytorch/pytorch/issues/44282

kyamagu commented 9 months ago

A dangerous workaround is to set the following environment variable.

export KMP_DUPLICATE_LIB_OK=TRUE