Singularity/crYOLO をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
コンテナ技術[[Singularity]]で動くcrYOLOを作ってみた.
対象の計算機はCentOS7でA2000が搭載されてます
#code(nonumber){{
[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@centos7 ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 525.105.1...
GCC version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-4...
[root@centos7 ~]# nvidia-smi -L
GPU 0: NVIDIA RTX A2000 (UUID: GPU-23cc3ee7-31d3-a068-2f6...
[root@centos7 ~]# ls -l /usr/local/cuda
ls: cannot access /usr/local/cuda: No such file or direct...
[root@centos7 ~]#
}}
そこにSingularityをインストールします. 現在「Singularity...
ここでは「apptainer」を入れます
#code(nonumber){{
[root@centos7 ~]# yum install epel-release
[root@centos7 ~]# yum install apptainer apptainer-suid
}}
***crYOLOが入ったsig(Singularity image file)を作る [#z4bf...
[[https://pypi.org/project/cryolo/>+https://pypi.org/proj...
「&color(magenta){python:3.8.16-bullseye};」を使うことに...
「sandbox」モードで用意して、crYOLO実行環境を作ります
#code(nonumber){{
[root@centos7 ~]# singularity build --sandbox crYOLO dock...
[root@centos7 ~]# singularity shell --writable crYOLO
Apptainer>
「conda create -n cryolo -c conda-forge -c anaconda pyqt=...
(bullseye側の調整)
Apptainer> chown root / /var /var/log
Apptainer> apt update
Apptainer> apt install libgtk-3-0 libnotify4 libxxf86vm1 ...
Apptainer> curl -O http://archive.ubuntu.com/ubuntu/pool/...
Apptainer> apt-get install -f ./libjpeg-turbo8_2.0.3-0ubu...
Apptainer> rm -rf libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
(pipでコンテンツ作成)
Apptainer> /usr/local/bin/python -m pip install --upgrade...
Apptainer> pip install PyQt5
Apptainer> pip install numpy==1.18.5
Apptainer> pip install libtiff
Apptainer> pip install https://extras.wxpython.org/wxPyt...
Apptainer> pip install 'setuptools<66'
Apptainer> pip install nvidia-pyindex
Apptainer> pip install 'cryolo[c11]'
Apptainer> exit
[root@centos7 ~]#
}}
&size(10){napari-boxmanagerは[[https://pypi.org/project/n...
&size(10){同じに入れたら扱けました};
これで実行環境が完成.
次にこれをsifに変換します
#code(nonumber){{
[root@centos7 ~]# singularity build crYOLO.sif crYOLO ...
INFO: Starting build...
INFO: Creating SIF file...
INFO: Build complete: crYOLO.sif
[root@centos7 ~]# ls -lh crYOLO.sif
-rwxr-xr-x. 1 root root 4.0G Mar 26 03:47 crYOLO.sif
[root@centos7 ~]# mv crYOLO.sif /home/crYOLO.sif
}}
***つかってみる [#bd8630c6]
構築したユーザとは別のユーザで使ってみます
#code(nonumber){{
[saber@centos7 ~]$ singularity shell --nv --bind /Public:...
...
Apptainer> nvidia-smi -L
GPU 0: NVIDIA RTX A2000 (UUID: GPU-23cc3ee7-31d3-a068-2f6...
Apptainer> cryolo_gui.py <-- GUIモードも起動できます
Apptainer> cryolo_gui.py config config_cryolo_.json 220 -...
Apptainer> cryolo_predict.py -c config_cryolo_.json -w /P...
}}
&color(red){*};「cryolo_boxmanager_legacy.py」は動かない...
***SingularityのDefinition Fileにしてみてsifを作る [#gbbb...
Dockerfileのような仕様書を作れば簡単にsifが作れるそうな
っで
crYOLO.defを作ってみた
#code(nonumber){{
[illya@centos7 ~]$ vi crYOLO.def
BootStrap: docker
From: python:3.8.12-bullseye
%post
chown root / /var /var/log
apt update -y
apt install -y libgtk-3-0 libnotify4 libxxf86vm1 libsd...
curl -O http://archive.ubuntu.com/ubuntu/pool/main/lib...
apt-get install -f ./libjpeg-turbo8_2.0.3-0ubuntu1_amd...
rm -f ./libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
pip install PyQt5
pip install numpy==1.16
pip install libtiff
curl -O https://extras.wxpython.org/wxPython4/extras/l...
pip install ./wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
rm -f ./wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
pip install nvidia-pyindex
pip install nvidia-tensorflow[horovod]
pip install 'cryolo[c11]'
[illya@centos7 ~]$ sudo singularity build crYOLO.sif crYO...
}}
終了行:
コンテナ技術[[Singularity]]で動くcrYOLOを作ってみた.
対象の計算機はCentOS7でA2000が搭載されてます
#code(nonumber){{
[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@centos7 ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 525.105.1...
GCC version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-4...
[root@centos7 ~]# nvidia-smi -L
GPU 0: NVIDIA RTX A2000 (UUID: GPU-23cc3ee7-31d3-a068-2f6...
[root@centos7 ~]# ls -l /usr/local/cuda
ls: cannot access /usr/local/cuda: No such file or direct...
[root@centos7 ~]#
}}
そこにSingularityをインストールします. 現在「Singularity...
ここでは「apptainer」を入れます
#code(nonumber){{
[root@centos7 ~]# yum install epel-release
[root@centos7 ~]# yum install apptainer apptainer-suid
}}
***crYOLOが入ったsig(Singularity image file)を作る [#z4bf...
[[https://pypi.org/project/cryolo/>+https://pypi.org/proj...
「&color(magenta){python:3.8.16-bullseye};」を使うことに...
「sandbox」モードで用意して、crYOLO実行環境を作ります
#code(nonumber){{
[root@centos7 ~]# singularity build --sandbox crYOLO dock...
[root@centos7 ~]# singularity shell --writable crYOLO
Apptainer>
「conda create -n cryolo -c conda-forge -c anaconda pyqt=...
(bullseye側の調整)
Apptainer> chown root / /var /var/log
Apptainer> apt update
Apptainer> apt install libgtk-3-0 libnotify4 libxxf86vm1 ...
Apptainer> curl -O http://archive.ubuntu.com/ubuntu/pool/...
Apptainer> apt-get install -f ./libjpeg-turbo8_2.0.3-0ubu...
Apptainer> rm -rf libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
(pipでコンテンツ作成)
Apptainer> /usr/local/bin/python -m pip install --upgrade...
Apptainer> pip install PyQt5
Apptainer> pip install numpy==1.18.5
Apptainer> pip install libtiff
Apptainer> pip install https://extras.wxpython.org/wxPyt...
Apptainer> pip install 'setuptools<66'
Apptainer> pip install nvidia-pyindex
Apptainer> pip install 'cryolo[c11]'
Apptainer> exit
[root@centos7 ~]#
}}
&size(10){napari-boxmanagerは[[https://pypi.org/project/n...
&size(10){同じに入れたら扱けました};
これで実行環境が完成.
次にこれをsifに変換します
#code(nonumber){{
[root@centos7 ~]# singularity build crYOLO.sif crYOLO ...
INFO: Starting build...
INFO: Creating SIF file...
INFO: Build complete: crYOLO.sif
[root@centos7 ~]# ls -lh crYOLO.sif
-rwxr-xr-x. 1 root root 4.0G Mar 26 03:47 crYOLO.sif
[root@centos7 ~]# mv crYOLO.sif /home/crYOLO.sif
}}
***つかってみる [#bd8630c6]
構築したユーザとは別のユーザで使ってみます
#code(nonumber){{
[saber@centos7 ~]$ singularity shell --nv --bind /Public:...
...
Apptainer> nvidia-smi -L
GPU 0: NVIDIA RTX A2000 (UUID: GPU-23cc3ee7-31d3-a068-2f6...
Apptainer> cryolo_gui.py <-- GUIモードも起動できます
Apptainer> cryolo_gui.py config config_cryolo_.json 220 -...
Apptainer> cryolo_predict.py -c config_cryolo_.json -w /P...
}}
&color(red){*};「cryolo_boxmanager_legacy.py」は動かない...
***SingularityのDefinition Fileにしてみてsifを作る [#gbbb...
Dockerfileのような仕様書を作れば簡単にsifが作れるそうな
っで
crYOLO.defを作ってみた
#code(nonumber){{
[illya@centos7 ~]$ vi crYOLO.def
BootStrap: docker
From: python:3.8.12-bullseye
%post
chown root / /var /var/log
apt update -y
apt install -y libgtk-3-0 libnotify4 libxxf86vm1 libsd...
curl -O http://archive.ubuntu.com/ubuntu/pool/main/lib...
apt-get install -f ./libjpeg-turbo8_2.0.3-0ubuntu1_amd...
rm -f ./libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
pip install PyQt5
pip install numpy==1.16
pip install libtiff
curl -O https://extras.wxpython.org/wxPython4/extras/l...
pip install ./wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
rm -f ./wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
pip install nvidia-pyindex
pip install nvidia-tensorflow[horovod]
pip install 'cryolo[c11]'
[illya@centos7 ~]$ sudo singularity build crYOLO.sif crYO...
}}
ページ名:
1