cannot allocate memory in static TLS block

Symptom

The error message "ImportError: xxxxx cannot allocate memory in static TLS block" is displayed.

Possible Cause

A conflict error is reported when different components reference .so files.

Solution

  1. Add the following content to the first line of the running demo or sample code:
    from paddle.base import libpaddle
  2. Try again. If the fault persists, append the full paths of the affected .so files to the LD_PRELOAD environment variable. Note that there may be multiple such paths. In the following example, xxxx indicates a .so file path.
    export LD_PRELOAD=xxxx:$LD_PRELOAD