Jetson Orin Nano运行PyTorch时出现ImportError: cannot allocate memory in static TLS Block的问题求助
Jetson Orin Nano运行PyTorch时出现ImportError: cannot allocate memory in static TLS Block的问题求助
Reposting because I didn't solve my problem:
I'm hitting this error when trying 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
I've tried several fixes already, 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.1export LD_PRELOAD=.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgomp.so.1
I also tried reinstalling PyTorch, but none of these have worked so far.
Could anyone give me some guidance or suggest other possible fixes for this error?
Thanks in advance for your help!
I just want to double-check if the process I'm following is correct:
- In the terminal, I run:
nano ~/.bashrc - At the end of the file, I add:
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1 - Save with
Ctrl + O, pressEnter, then exit withCtrl + X - Run
source ~/.bashrc - Try running my code again
I followed the same steps for these variations too:
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
But for these two cases:
export LD_PRELOAD=.local/lib/python3.8/site-packages/torch/lib/libgomp-d22c30c5.so.1export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgomp.so.1
I get 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 I'm missing something here or if you have any other suggestions.
备注:内容来源于stack exchange,提问作者giordano basso




