You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

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.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

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:

  1. In the terminal, I run: nano ~/.bashrc
  2. At the end of the file, I add: export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1
  3. Save with Ctrl + O, press Enter, then exit with Ctrl + X
  4. Run source ~/.bashrc
  5. 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.1
  • export 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

火山引擎 最新活动