本家様 http://blake.bcm.edu/emanwiki/EMAN2
バージョン番号が良く分からなかったが
EMAN2.1、EMAN2.2、EMAN2.3とかはメジャーバージョン.
EMAN2.11とEMAN2.12は「EMAN2.1」のマイナーバージョンアップ版の位置付けみたい. っで最新は EMAN2.99.XXみたい.
EMAN2.1 ------------> EMAN2.2 --------> EMAN2.3 --------> EMAN2.9
+-- EMAN2.11 +-- EMAN2.21 +-- EMAN2.31 +-- EMAN2.91
+-- EMAN2.12 +-- EMAN2.22 +-- EMAN2.99.XX
macOSについてはEMAN2/macOS
EMAN2/windowsPC
eman2の最新版はconda経由で入手可能となってます.
https://anaconda.org/cryoem/eman-dev/files
っで早速淹れてみます.
インストール先は rockylinux8です. GPUカードが入ってnvidiaドライバーは有効. cudaライブラリは入れていないです.
[root@rockylinux ~]# cat /etc/redhat-release
Rocky Linux release 8.10 (Green Obsidian)
[root@rockylinux ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 535.183.01 Sun May 12 19:39:15 UTC 2024
GCC version: gcc version 8.5.0 20210514 (Red Hat 8.5.0-22) (GCC)
[root@rockylinux ~]# ls -l /usr/local/cuda*
ls: cannot access '/usr/local/cuda*': No such file or directory
[root@rockylinux ~]#
最新版はcondaでインストールできるので必要となるconda環境は、ここではpyenv/anacondaで作ってまして、もしpyenv/anaconda環境がなければ
git clone https://github.com/yyuu/pyenv.git /apps/pyenv
cd /apps/pyenv
git pull
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
pyenv install anaconda3-2024.06-1 #「pyenv install --list」でanacondaの最新版を探す. miniforgeでも可)
として構築して、その後conda環境をロードします
source /apps/pyenv/versions/anaconda3-2024.06-1/etc/profile.d/conda.sh
conda環境が整ったら
conda create -n eman2.99 eman-dev python=3.11 -c cryoem -c conda-forge
:
(途中のメッセージ)
For Linux 64, Open MPI is built with CUDA awareness but this support is disabled by default.
To enable it, please set the environment variable OMPI_MCA_opal_cuda_support=true before
launching your MPI processes. Equivalently, you can set the MCA parameter in the command line:
mpiexec --mca opal_cuda_support 1 ...
In addition, the UCX support is also built but disabled by default.
To enable it, first install UCX (conda install -c conda-forge ucx). Then, set the environment
variables OMPI_MCA_pml="ucx" OMPI_MCA_osc="ucx" before launching your MPI processes.
Equivalently, you can set the MCA parameters in the command line:
mpiexec --mca pml ucx --mca osc ucx ...
Note that you might also need to set UCX_MEMTYPE_CACHE=n for CUDA awareness via UCX.
Please consult UCX's documentation for detail.
:
でeman2をインストールします. 何が入ったか確認してみます. *python-3.11.xで進めないとエラーになる
conda activate eman2.99
conda list
:
cuda-version 11.8 h70ddcb2_3 conda-forge
cudatoolkit 11.8.0 h4ba93d1_13 conda-forge
cudnn 8.9.7.29 hbc23b4c_3 conda-forge
:
eman-dev 2.99.58 gui_h5f1209e_100 cryoem <-- eman-dev 2.99.58が入りました.
:
jupyterlab 4.2.5 pyhd8ed1ab_0 conda-forge <-- jupyterlab が使えるみたい
:
python 3.11.9 hb806964_0_cpython conda-forge
:
tensorflow 2.12.1 cuda112py311h63ba870_1 conda-forge
tensorflow-base 2.12.1 cuda112py311hb4f7669_1 conda-forge
tensorflow-estimator 2.12.1 cuda112py311h9aaad64_1 conda-forge
:
tensorflowはcuda版が入っているみたい. eman2-dev-2.99.58より上はpython3.12.xが必要. っがjson関係でe2projectmanager.pyが動かない...
EnvironmentModulesは下記のようにします
「/apps/modulefiles/eman2/2.99」
#%Module1.0
set EMAN2DIR /apps/pyenv/versions/anaconda3-2024.06-1/envs/eman2.99
setenv EMAN2DIR $EMAN2DIR
prepend-path PATH $EMAN2DIR/bin
prepend-path LD_LIBRARY_PATH $EMAN2DIR/lib
っで試します
[saber@rockylinux ~]$ module use /apps/modulefiles
[saber@rockylinux ~]$ module load eman2/2.99
[saber@rockylinux ~]$ e2version.py
EMAN 2.99.58 ( GITHUB: 2024-08-21 00:17 - commit: NOT-INSTALLED-FROM-GIT-REPO )
Your EMAN2 is running on: Linux-4.18.0-553.el8_10.x86_64-x86_64-with-glibc2.28 4.18.0-553.el8_10.x86_64
Your Python version is: 3.11.9
[saber@rockylinux ~]$ e2speedtest.py
This could take a few minutes. Please be patient.
Initializing
....................
....................
....................
....................
....................
....................
....................
....................
Your machines speed factor = 2.7749 +- 0.0224 (0.0083 +- 0.00007 sec)
[saber@rockylinux ~]$
[saber@rockylinux ~]$ e2display.py <-- e2displayの画面が表示される
[saber@rockylinux ~]$ e2proc2d.py :64:64:1 test.hdf --process mask.sharp:outer_radius=24
1 images, processing 0-0 stepping by 1
1 images
[saber@rockylinux ~]$ e2display.py test.hdf
最後の「e2display.py test.hdf」では下記が表示されます
GPUのテスト.
[saber@rockylinux ~]$ module use /apps/modulefiles
[saber@rockylinux ~]$ module load eman2/2.99
[saber@rockylinux ~]$ which python
/apps/pyenv/versions/anaconda3-2024.06-1/envs/eman2.99/bin/python
[saber@rockylinux ~]$ python
Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from tensorflow.python.client import device_lib
2024-09-09 00:12:09.201044: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
>>>
>>> device_lib.list_local_devices()
2024-09-09 00:12:35.263376: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-09 00:12:35.276366: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-09 00:12:35.276534: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-09 00:12:35.346040: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-09 00:12:35.346228: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-09 00:12:35.346362: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-09 00:12:35.346471: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] 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
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 13211786764751257407
xla_global_id: -1
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 4495114240
locality {
bus_id: 1
links {
}
}
incarnation: 18225742708348277138
physical_device_desc: "device: 0, name: NVIDIA RTX A2000, pci bus id: 0000:13:00.0, compute capability: 8.6" <-- GPUも認識されました.
xla_global_id: 416903419
]
>>>
>>>
>>> quit();
[saber@rockylinux ~]$
っと一応eman2で利用可能みたい.
メモ:eman2.91にあったsphireですが2.99.xxでは動かないみたい.
20210308にリリース https://cryoem.bcm.edu/cryoem/downloads/view_eman2_version/32
サイトから「eman2.91_sphire1.4_sparx.linux64.sh」をダウンロードします
「eman2.91_sphire1.4_sparx_huge.linux64.sh」は関連ライブラリを含んだ完全版. ネットに繋げられないクローズドな計算機向けみたい
インストール先はRockyLinux8です
[root@rockylinux ~]# cat /etc/redhat-release
Rocky Linux release 8.10 (Green Obsidian)
[root@rockylinux ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 535.183.01 Sun May 12 19:39:15 UTC 2024
GCC version: gcc version 8.5.0 20210514 (Red Hat 8.5.0-22) (GCC)
[root@rockylinux ~]# ls -l /usr/local/cuda*
ls: cannot access '/usr/local/cuda*': No such file or directory
[root@rockylinux ~]#
インストール先は /apps/eman2.91 とします
[root@rockylinux ~]# bash /apps/src/eman2.91_sphire1.4_sparx.linux64.sh
Welcome to EMAN2-SPHIRE-SPARX combined
EMAN2-SPHIRE-SPARX will now be installed into this location:
/root/eman2-sphire-sparx
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/root/eman2-sphire-sparx] >>> /apps/eman2.91 <--- ここでインストール先を指定します
:
(しばらく時間が掛かります)
:
installation finished.
Do you wish the installer to initialize EMAN2-SPHIRE-SPARX
by running conda init? [yes|no]
[no] >>> no <-- no とします.
You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:
eval "$(/apps/eman2.91/bin/conda shell.YOUR_SHELL_NAME hook)"
To install conda's shell functions for easier access, first activate, then:
conda init
If you'd prefer that conda's base environment not be activated on startup,
set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Thank you for installing EMAN2-SPHIRE-SPARX!
[root@rockylinux ~]#
EnvironmentModulesは下記のようにします
「/apps/modulefiles/eman2/2.91」
#%Module1.0
set EMAN2DIR /apps/eman2.91
setenv EMAN2DIR $EMAN2DIR
prepend-path PATH $EMAN2DIR/bin
prepend-path LD_LIBRARY_PATH $EMAN2DIR/lib
インストール物の確認
[root@rockylinux ~]# module use /apps/modulefiles/
[root@rockylinux ~]# module load eman2/2.91
[root@rockylinux ~]# which conda
/apps/eman2.91/bin/conda
[root@rockylinux ~]# conda list
:
conda 4.9.2 py37h06a4308_0
conda-build 3.21.4 py37h06a4308_0
:
cudatoolkit 10.1.243 h6bb024c_0
cudnn 7.6.5 cuda10.1_0
:
eman-deps 24.1 hfe7c423_2 cryoem
eman-deps-cli 24.1 hfe7c423_2 cryoem
eman-deps-cxx 24.1 hfe7c423_2 cryoem
eman2 2.91 h2bc3f7f_0 file://home/eman2/miniconda3/conda-bld
:
python 3.7.9 h7579374_0
:
tensorflow 2.1.0 gpu_py37h7a4bb67_0 <-- gpu対応のtensorflowが入っている
:
[root@rockylinux ~]#
っでテスト
[saber@rockylinux ~]$ module use /apps/modulefiles
[saber@rockylinux ~]$ module load /apps/modulefiles/eman2/2.91
[saber@rockylinux ~]$ e2version.py
EMAN 2.91 final ( GITHUB: 2021-03-08 11:36 - commit: 81caed2 )
Your Python version is: 3.7.9
[saber@rockylinux ~]$ e2speedtest.py
This could take a few minutes. Please be patient.
Initializing
....................
....................
....................
....................
....................
....................
....................
....................
Your machines speed factor = 2.0003 +- 0.0107 (0.0115 +- 0.00006 sec)
[saber@rockylinux ~]$
[saber@rockylinux ~]$ e2display.py <-- e2display画面がでればok
[saber@rockylinux ~]$ e2proc2d.py :64:64:1 test.hdf --process mask.sharp:outer_radius=24
1 images, processing 0-0 stepping by 1
1 images
[saber@rockylinux ~]$ e2display.py test.hdf
e2display.pyによって開いた画像は下記になる.
ちょいとGPUテストをここで.
[saber@rockylinux ~]$ module use /apps/modulefiles
[saber@rockylinux ~]$ module load /apps/modulefiles/eman2/2.91
[saber@rockylinux ~]$ which python
/apps/eman2.91/bin/python
[saber@rockylinux ~]$ python
Python 3.7.9 (default, Aug 31 2020, 12:42:55)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from tensorflow.python.client import device_lib
>>>
>>> device_lib.list_local_devices()
2024-09-08 22:17:15.650791: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2024-09-08 22:17:15.655293: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3791995000 Hz
2024-09-08 22:17:15.655493: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x558a0f906cb0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2024-09-08 22:17:15.655513: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2024-09-08 22:17:15.686570: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2024-09-08 22:17:15.940753: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-08 22:17:15.940873: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
pciBusID: 0000:13:00.0 name: NVIDIA RTX A2000 computeCapability: 8.6
coreClock: 1.2GHz coreCount: 26 deviceMemorySize: 5.79GiB deviceMemoryBandwidth: 268.26GiB/s
2024-09-08 22:17:15.943608: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2024-09-08 22:17:16.004573: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2024-09-08 22:17:16.032209: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2024-09-08 22:17:16.086668: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2024-09-08 22:17:16.137279: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2024-09-08 22:17:16.163789: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2024-09-08 22:17:16.266764: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2024-09-08 22:17:16.266866: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-08 22:17:16.267006: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-08 22:17:16.267078: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
2024-09-08 22:17:16.267119: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2024-09-08 22:17:16.329287: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
2024-09-08 22:17:16.329311: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] 0
2024-09-08 22:17:16.329317: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] 0: N
2024-09-08 22:17:16.329417: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-08 22:17:16.329558: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-08 22:17:16.329650: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), (略
2024-09-08 22:17:16.329725: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/device:GPU:0 with 5522 MB memory) -> physical GPU (device: 0, name: NVIDIA RTX A2000, pci bus id: 0000:13:00.0, compute capability: 8.6)
2024-09-08 22:17:16.331022: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x558a11b059d0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2024-09-08 22:17:16.331038: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): NVIDIA RTX A2000, Compute Capability 8.6
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 8845768690766589488
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 5758218892036286069
physical_device_desc: "device: XLA_CPU device"
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 5791154176
locality {
bus_id: 1
links {
}
}
incarnation: 10197384907304663641
physical_device_desc: "device: 0, name: NVIDIA RTX A2000, pci bus id: 0000:13:00.0, compute capability: 8.6"
, name: "/device:XLA_GPU:0"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 9338540096626291346
physical_device_desc: "device: XLA_GPU device"
]
>>>
>>> quit();
[saber@rockylinux ~]$
大丈夫みたい.