ImportError: Cannot Allocate Memory in Static TLS Block

Hello,
I am encountering the following error message when attempting to run my code:

ImportError: /home/orin_nano1/.local/lib/python3.8/site-packages/torch/lib/…/…/torch.libs/libgomp-804f19d4.so.1.0.0: cannot allocate memory in static TLS block

To resolve this, I have tried several solutions, including setting the LD_PRELOAD environment variable with different paths:

export LD_PRELOAD=/home/orin_nano1/.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1
export LD_PRELOAD=.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgomp.so.1

However, none of these attempts have resolved the issue.

Could anyone provide guidance or suggest other potential fixes for this error?

Thank you in advance for your help!

Hi,

Please try the comment below instead:

Thanks.

Hi,
Thank you for the suggestion. I just want to confirm that the process I’m following is correct:
In the terminal, I type:nano ~/.bashrc
At the end of the file, I add: export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1
Then I save the file by pressing Ctrl + O, hitting Enter, and exiting with Ctrl + X.
I run: source ~/.bashrc
Finally, I try to run the code again.
I follow the same steps for these variations:
export LD_PRELOAD=/home/orin_nano1/.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1
export LD_PRELOAD=.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgomp.so.1

However, for the following cases:

export LD_PRELOAD=.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgomp.so.1

I receive this error:
ERROR: ld.so: object '/home/orin_nano1/.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

For all cases, it didn’t work.
Let me know if there’s anything I’m missing or if you have any further suggestions.

Hi,

Sorry for the late update.
Let’s track the following on the new topic directly:

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.