Skip to content
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

M1/M2 fix is hacky #23

Closed
mgbckr opened this issue Feb 15, 2024 · 1 comment
Closed

M1/M2 fix is hacky #23

mgbckr opened this issue Feb 15, 2024 · 1 comment
Labels
fix Need to be fixed in the future

Comments

@mgbckr
Copy link
Collaborator

mgbckr commented Feb 15, 2024

To make things work on Apple M1/M2 machines, we are currently using a combination of installing tensorflow=2.10.0 by hand (see README.md) and some hack in __init.py__:

# TODO: hacky! 
# NOTE: Be aware of potential side-effects: but that may cause crashes or silently produce incorrect results.
# sources:
# - https://stackoverflow.com/questions/53014306/error-15-initializing-libiomp5-dylib-but-found-libiomp5-dylib-already-initial
# - https://stackoverflow.com/questions/55714135/how-can-i-fix-an-omp-error-15-initializing-libiomp5-dylib-but-found-libomp
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

Used to fix the following issue:

OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.

We should eventually fix this!

@mgbckr mgbckr added the fix Need to be fixed in the future label Feb 15, 2024
@mgbckr
Copy link
Collaborator Author

mgbckr commented Jan 31, 2025

Note on closing this issue: I removed the "hack" from the __init__.py in the most recent merge. Its tested on M4 and I am assuming it will also work on M1/M2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Need to be fixed in the future
Projects
None yet
Development

No branches or pull requests

2 participants