本家様 https://github.com/bionanopatterning/Ais
Fast and user-friendly annotation and segmentation of cryo-electron tomography data using convolutional neural networks
(deepL先生訳)
畳み込みニューラルネットワークを用いたクライオ電子断層撮影データの高速でユーザーフレンドリーなアノテーションとセグメンテーション
実行環境確認.
[root@rockylinux ~]# cat /etc/redhat-release
Rocky Linux release 8.8 (Green Obsidian)
[root@rockylinux ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 535.161.07 Sat Feb 17 22:55:48 UTC 2024
GCC version: gcc version 8.5.0 20210514 (Red Hat 8.5.0-18) (GCC)
[root@rockylinux ~]# ls -l /usr/local/cuda
ls: cannot access '/usr/local/cuda': No such file or directory
[root@rockylinux ~]#
Aisはpythonアプリです.
ここでは各自のホームディレクトリに各種pythonアプリの実行環境を用意するのではなく、rootで一元管理させるために「pyenv/conda」を使ってます.
pyenvでOS提供のpython,anaconda環境から離れ、そのpyenv上にconda環境を独自に敷いてます
git clone https://github.com/yyuu/pyenv.git /apps/pyenv
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
pyenv install --list
pyenv install anaconda3-2024.02-1
source /apps/pyenv/versions/anaconda3-2024.02-1/etc/profile.d/conda.sh
(あるいは)
pyenv install miniforge3-23.11.0-0
source /apps/pyenv/versions/miniforge3-23.11.0-0/etc/profile.d/conda.sh
もし既に環境があればそれを利用します
source /apps/pyenv/versions/anaconda3-2024.02-1/etc/profile.d/conda.sh
(あるいは)
source /apps/pyenv/versions/miniforge3-23.11.0-0/etc/profile.d/conda.sh
そうした上でアプリ構築.
本家様の記載にあるように
conda create --name ais
conda activate ais
conda install python==3.9
conda install pip
pip install ais-cryoet
で作れなくはないが、GPUが機能してくれないです.
別途 tensorflow-gpu 、nvidia-cudnn-cu11など入れる必要がありました.
なので下記で作ってみました.
[root@rockylinux ~]# conda env remove --name ais
[root@rockylinux ~]# conda create -n ais python=3.9 pip cudatoolkit=11 tensorflow=2.8=cuda* cudnn=8 -c conda-forge
[root@rockylinux ~]# conda activate ais
(ais) [root@rockylinux ~]# pip install ais-cryoet
(ais) [root@rockylinux ~]# python
Python 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:45:29)
[GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import tensorflow as tf
>>>
>>> tf.test.is_gpu_available()
WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2024-04-16 20:28:53.785728: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-04-16 20:28:53.796433: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-04-16 20:28:53.809461: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-04-16 20:28:53.809604: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-04-16 20:28:53.890853: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-04-16 20:28:53.890997: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-04-16 20:28:53.891095: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2024-04-16 20:28:53.891177: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 4286 MB memory: -> device: 0, name: NVIDIA RTX A2000, pci bus id: 0000:13:00.0, compute capability: 8.6
True
>>>
(ais) [root@rockylinux ~]#
一応GPUは認識できたみたい.
[root@rockylinux ~]# vi /apps/modulefiles/ais
#%Module
set root /apps/pyenv/versions/miniforge3-23.11.0-0/envs/ais
prepend-path PATH $root/bin
[root@rockylinux ~]#
[saber@rockylinux ~]$ module use /apps/modulefiles/
[saber@rockylinux ~]$
[saber@rockylinux ~]$ module load ais
[saber@rockylinux ~]$ ais
っでこんな画面が表示される
[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 535.154.05 Thu Dec 28 15:37:48 UTC 2023
GCC version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
[root@centos7 ~]# ls -l /usr/local/cuda
ls: cannot access /usr/local/cuda: No such file or directory
[root@centos7 ~]#
「pyenv-ana/conda」環境を作る
git clone https://github.com/yyuu/pyenv.git /apps/pyenv
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
pyenv install anaconda3-2024.02-1
source /apps/pyenv/versions/anaconda3-2024.02-1/etc/profile.d/conda.sh
(miniforge3でも構わないです)
っで構築
[root@centos7 ~]# conda env remove --name ais
[root@centos7 ~]# conda create -n ais python=3.9 pip cudatoolkit=11 tensorflow=2.8=cuda* cudnn=8 -c conda-forge
[root@centos7 ~]# conda activate ais
(ais) [root@centos7 ~]# pip install ais-cryoet
テスト
(ais) [root@centos7 ~]# python
>>> import tensorflow as tf
>>> tf.test.is_gpu_available()
True
>>>
environment-modules
[root@centos7 ~]# vi /apps/modulefiles/ais
#%Module
set root /apps/pyenv/versions/anaconda3-2024.02-1/envs/ais
prepend-path PATH $root/bin
[root@centos7 ~]#
テスト
[illya@centos7 ~]$ module use /apps/modulefiles/
[illya@centos7 ~]$ module load ais
[illya@centos7 ~]$ ais
Traceback (most recent call last):
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/bin/ais", line 5, in <module>
from Ais.main import main
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/lib/python3.9/site-packages/Ais/main.py", line 4, in <module>
from Ais.core.window import *
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/lib/python3.9/site-packages/Ais/core/window.py", line 3, in <module>
from OpenGL.GL import *
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/lib/python3.9/site-packages/OpenGL/GL/__init__.py", line 4, in <module>
from OpenGL.GL.VERSION.GL_1_1 import *
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module>
from OpenGL.raw.GL.VERSION.GL_1_1 import *
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/lib/python3.9/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module>
from OpenGL.raw.GL import _errors
File "/apps/pyenv/versions/anaconda3-2024.02-1/envs/ais/lib/python3.9/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module>
_error_checker = _ErrorChecker( _p, _p.GL.glGetError )
AttributeError: 'NoneType' object has no attribute 'glGetError'
[illya@centos7 ~]$
aisの中身を確認
[root@centos7 ~]# source /apps/pyenv/versions/anaconda3-2024.02-1/etc/profile.d/conda.sh
[root@centos7 ~]# conda activate ais
(ais) [root@centos7 ~]# conda list
:
pyopengl 3.1.7 pypi_0 pypi
:
(ais) [root@centos7 ~]#
っで
(ais) [root@centos7 ~]# conda search pyopengl
Loading channels: done
# Name Version Build Channel
pyopengl 3.1.1a1 py27_0 pkgs/main
pyopengl 3.1.1a1 py310h06a4308_0 pkgs/main
pyopengl 3.1.1a1 py311h06a4308_0 pkgs/main
pyopengl 3.1.1a1 py312h06a4308_0 pkgs/main
pyopengl 3.1.1a1 py36_0 pkgs/main
pyopengl 3.1.1a1 py36h06a4308_0 pkgs/main
pyopengl 3.1.1a1 py37_0 pkgs/main
pyopengl 3.1.1a1 py37h06a4308_0 pkgs/main
pyopengl 3.1.1a1 py38_0 pkgs/main
pyopengl 3.1.1a1 py38h06a4308_0 pkgs/main
pyopengl 3.1.1a1 py39h06a4308_0 pkgs/main
(ais) [root@centos7 ~]#
(ais) [root@centos7 ~]# conda install pyopengl -c anaconda
(pipなら「pip install PyOpenGL==3.1.6」でも有効みたい)
これで pyopengl は 3.1.1a1 になると思うのだが、、表示的には変わらなかった
(ais) [root@centos7 ~]# conda list
:
pyopengl 3.1.7 pypi_0 pypi
:
(ais) [root@centos7 ~]#
けどこれで起動しました.