Reposting this question because I didn’t solve my problem:
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
Additionally, I attempted to resolve the issue by reinstalling PyTorch, but none of these solutions have worked.
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!
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.
Let me know if there’s anything I’m missing or if you have any further suggestions.