rt-net / jnm_jupyternotebook

Jupyter Notebooks for Jetson Nano Mouse
https://rt-net.github.io/tutorials/jnmouse/jupyter-notebook/install.html
Apache License 2.0
3 stars 3 forks source link

OSError: /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block #14

Closed Tiryoh closed 2 years ago

Tiryoh commented 2 years ago

不具合の概要

import torchOSError: /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS blockが発生する

関連: https://github.com/keras-team/keras-tuner/issues/317

Screenshot from 2021-11-04 15-39-28

ただしimport numpy as npを先に宣言した場合は問題が起きない

Screenshot from 2021-11-04 15-40-04

glibcの不具合が引き起こしている可能性が高い

https://bugzilla.redhat.com/show_bug.cgi?id=1722181

実行環境

https://github.com/rt-net/jnmouse_utils/tree/master/setup-scripts#option-1

その他

/usr/local/share/jupyter/kernels/python3/kernel.jsonを以下のように編集すればimport numpy as npを先に宣言する必要はない

{
 "argv": [
  "python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python",
 "env": {"LD_PRELOAD":"/usr/lib/aarch64-linux-gnu/libgomp.so.1"}
}
Tiryoh commented 2 years ago
[ ! -e $HOME/jnmouse_utils ] && git clone https://github.com/rt-net/jnmouse_utils.git
cd $HOME/jnmouse_utils
git checkout master
git pull
sudo patch -N -p1 -r - /usr/local/share/jupyter/kernels/python3/kernel.json ./setup-scripts/src/jupyter.patch

jnmouse_jp451_v3 ( https://github.com/rt-net/jnmouse_utils/pull/9 )では予めパッチを当ててあります。 それ以前のバージョンでも上記コマンドで手動でパッチを当てることができます。