Skip to content

cannot allocate memory in static TLS block #8488

@apivovarov

Description

@apivovarov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions