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

cannot allocate memory in static TLS block #8488

Closed
apivovarov opened this issue Nov 25, 2022 · 1 comment
Closed

cannot allocate memory in static TLS block #8488

apivovarov opened this issue Nov 25, 2022 · 1 comment

Comments

@apivovarov
Copy link

apivovarov commented Nov 25, 2022

Platform: arm64, Ubuntu 20.04

Tensorflow-aarch64 2.9.2
xgboost 1.7.1

pip3 install -U tensorflow-aarch64==2.9.2
pip3 install -U xgboost

I got error "cannot allocate memory in static TLS block" in case I import tensorflow 2.9.2 before xgboost

Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> import xgboost
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/xgboost/__init__.py", line 7, in <module>
    from . import collective, dask, rabit
  File "/usr/local/lib/python3.8/dist-packages/xgboost/collective.py", line 12, in <module>
    from .core import _LIB, _check_call, c_str, py_str, from_pystr_to_cstr
  File "/usr/local/lib/python3.8/dist-packages/xgboost/core.py", line 264, in <module>
    _LIB = _load_lib()
  File "/usr/local/lib/python3.8/dist-packages/xgboost/core.py", line 216, in _load_lib
    raise XGBoostError(
xgboost.core.XGBoostError: 
XGBoost Library (libxgboost.so) could not be loaded.
Likely causes:
  * OpenMP runtime is not installed
    - vcomp140.dll or libgomp-1.dll for Windows
    - libomp.dylib for Mac OSX
    - libgomp.so for Linux and other UNIX-like OSes
    Mac OSX users: Run `brew install libomp` to install OpenMP runtime.

  * You are running 32-bit Python on a 64-bit OS

Error message(s): ['/usr/local/lib/python3.8/dist-packages/xgboost/lib/../../xgboost.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block']

If I import xgboost first - then both tensorflow and xgboost work fine

>>> import xgboost
>>> xgboost.__version__
'1.7.1'
>>> import tensorflow as tf
>>> tf.__version__
'2.9.2'
>>> 

libgomp was found in below locations:

# find /usr -name "libgomp*"
/usr/share/doc/libgomp1
/usr/lib/aarch64-linux-gnu/libgomp.so.1
/usr/lib/aarch64-linux-gnu/libgomp.so.1.0.0
/usr/lib/gcc/aarch64-linux-gnu/9/libgomp.spec
/usr/lib/gcc/aarch64-linux-gnu/9/libgomp.a
/usr/lib/gcc/aarch64-linux-gnu/9/libgomp.so
/usr/local/lib/python3.8/dist-packages/xgboost.libs/libgomp-d22c30c5.so.1.0.0
/usr/local/lib/python3.8/dist-packages/scikit_learn.libs/libgomp-d22c30c5.so.1.0.0

For some reason xgboost.libs/libgomp-d22c30c5.so.1.0.0 is only 30 bytes

-rwxr-xr-x 1 root staff 30 Nov 25 20:11 /usr/local/lib/python3.8/dist-packages/xgboost.libs/libgomp-d22c30c5.so.1.0.0
-rwxr-xr-x 1 root staff 274664 Nov 23 00:46 /usr/local/lib/python3.8/dist-packages/scikit_learn.libs/libgomp-d22c30c5.so.1.0.0
@trivialfis
Copy link
Member

Hi, this is an issue with libgomp #7110 (comment) Closing as duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants