手順1.1.でParallelClusterを起動した場合は、Relionに必要なパッケージがHeadNodeにインストール済みのため基本的に不要。Relionバージョンアップに伴い必要なパッケージが追加されている場合はインストールする。
3.3.2.1. Install Intel® oneAPI Toolkits
ParalellClusterのバージョンにより、HeadNodeにoneAPIがすでにインストールされている場合がある。
oneAPIがインストール済みの場合、新たにインストール先を指定できないため先にアンインストールを行う。
HeadNodeにNiceDCV接続する。
Terminalを起動し、以下のコマンドを実行する。
$ cd /opt/intel/oneapi/installer
$ sudo ./installer
GUIが起動したら「Modify」ボタン → uninstall を選択しアンインストールする。
複数のパッケージが表示される場合は全て行う。
続いてoneAPI Base Toolkitインストールを行う。
HeadNodeにNiceDVC接続する。 (GUIが使用できるのでNiceDCV接続が良い)
以下のサイトからIntel® oneAPI Base Toolkit => Get the Base Kit を選択しIntel® oneAPI Base Toolkit をダウンロードする
https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html
以下のとおりプルダウンを選択する。
--------
[*] Operationg System
=> Linux
[*] Distribution
=> Online & Offline (Recommended)
[*] Installer Type:
=> Online
--------
Command Line Download -> Command Line Installation Parameters の実行コマンドをコピーし、HeadNodeで実行する
$ cd /efs/em
$ which wget
/usr/bin/wget
$ wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18487/l_BaseKit_p_2022.1.2.146.sh
$ sudo sh ./l_BaseKit_p_2022.1.2.146.sh
2023.2.0の場合
$ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/992857b9-624c-45de-9701-f6445d845359/l_BaseKit_p_2023.2.0.49397.sh
$ sudo sh ./l_BaseKit_p_2023.2.0.49397.sh
GUIが起動する。
GUIで以下の通り設定する、実行する。
--------
- I accept the terms of the license agreementにチェックする
- Custom Installation [Customize]を選択
- 左下のInstallation Location | Change の「Change」を選択 -> [/efs/em/opt/intel/oneapi_2023_2]とする
- 以下項目のみ選択し次へ
Installation size: 7.4 GB, Download size: 845.2 MB
=> - Intel® Threading Building Blocks
=> - Intel® oneAPI Math Kernel Libary
以下は不要(情報参考 https://web.chaperone.jp/w/index.php?oneAPI)
=> - Intel® oneAPI DPC++ Library,
=> - Intel® DPC++ Compatibility Tool,
=> - Intel® oneAPI DPC++/C++ Compiler,
- [warning] you have no relevant GPU driver <=GPUないので無視してインストール実行
- Skip Eclips IDE configuration を選択し次へ
- I do NOT consent to the collection of my information を選択して「Install ->」を選択
=> The following tools have been installed successfully: Intel® oneAPI Base Toolkit, v.2023.2
3.3.2.2. Install Intel® oneAPI HPC Toolkit
Intel® oneAPI Toolkitsの入手
https://www.intel.com/content/www/us/en/developer/articles/news/free-intel-software-developer-tools.html
Intel® oneAPI HPC Toolkit => Get the HPC Kit を選択
(https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html)
以下のとおりプルダウンを選択する。
--------
[*] Operationg System
=> Linux
[*] Distribution
=> Online & Offline (Recommended)
[*] Installer Type:
=> Online
--------
$ cd /efs/em
$ which wget
/usr/bin/wget
$ wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18479/l_HPCKit_p_2022.1.2.117.sh
$ sudo sh ./l_HPCKit_p_2022.1.2.117.sh
2023.2.0の場合
$ wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0722521a-34b5-4c41-af3f-d5d14e88248d/l_HPCKit_p_2023.2.0.49440.sh
$ sudo sh ./l_HPCKit_p_2023.2.0.49440.sh
GUIが起動する。
GUIで以下の通り設定、実行する。
--------
- I accept the terms of the license agreementにチェックする
- Custom Installation [Customize]を選択
- 左下のInstallation Location | Change を確認 -> [/efs/em/opt/intel/oneapi_2023_2]となっていればOK (基本的にフォルダは変更できない)
- 以下項目のみ選択し次へ
Installation size: 4.5 MB, Download size: 918.8 MB
=> - Intel® MPI Library
=> - Intel® Cluster Checker <- 2023.2.0には存在しない
=> - Intel® Fortran Compiler & Intel® Fortran Compiler Classic
=> - Intel® oneAPI DPC++/C++ Compiler & Intel® C++ Compiler Classic
ここ以下2つは不要(情報参考 https://web.chaperone.jp/w/index.php?oneAPI)
=> - Intel® Inspector
=> - Intel® Trace Analyzer and Collector
- [warning] you have no relevant GPU driver <=GPUないので無視してインストール実行
- Skip Eclips IDE configuration を選択し次へ
- I do NOT consent to the collection of my information を選択して「Install ->」を選択
=> The following tools have been installed successfully: Intel® oneAPI HPC Toolkit, v.2023.2。
3.3.2.3. Intel® oneAPI EnvironmentModulesの設定
Headnodeにssh接続する。
以下を実行すると指定したefsのディレクトリにmodulefilesへのシンボリックリンクが作成される
$ cd /efs/em/modulefiles/
$ mkdir oneAPI #/efs/em/modulefiles/oneAPI がすでに存在してれば不要
$ /efs/em/opt/intel/oneapi_2023_2/modulefiles-setup.sh --ignore-latest --output-dir=/efs/em/modulefiles/oneAPI
:: WARNING: "/efs/em/modulefiles/oneAPI" exists and will be deleted.
Okay to proceed with deletion? [yn] n #'y' とすると古いバージョンが削除されてしまうので'n'とする
Intelコンパイラをインストールしていない場合は、2.2.を先に実行する。
ParallelClusterを起動し、Head nodeにssh接続する。
モジュールをアンロードする
$ module purge
$ module list
No Modulefiles Currently Loaded.
インテル oneAPIアクティベート
oneAPI 2022.0.2の場合
$ ./efs/em/opt/intel/oneapi/setvars.sh
oneAPI 2023.2.0の場合
$ ./efs/em/opt/intel/oneapi_2023_2/setvars.sh
Intelコンパイラpathの確認
$ which icc icpc
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/icc
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/icpc
$ icc --version
icc (ICC) 2021.5.0 20211109
Intel OpenMPIの確認
$ which mpicc mpicxx
/efs/em/opt/intel/oneapi/mpi/2021.5.1//bin/mpicc
/efs/em/opt/intel/oneapi/mpi/2021.5.1//bin/mpicxx
Intel MPIの確認
$ which mpiicc mpiicpc
/efs/em/opt/intel/oneapi/mpi/2021.5.1//bin/mpiicc
/efs/em/opt/intel/oneapi/mpi/2021.5.1//bin/mpiicpc
cmakeバージョンの確認
$ cmake --version
cmake version 3.16.3
NVIDIA情報確認(HeadNodeはGPUないため以下のメッセージが出る、この確認はskip可)
$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
MPIRunバージョン確認
$ mpirun --version
Intel(R) MPI Library for Linux* OS, Version 2021.5 Build 20211102 (id: 9279b7d62)
PATHの確認(主にintelコンパイラのパスが通っているのを確認)
$ echo $PATH
/efs/em/opt/intel/oneapi/mpi/2021.5.1//libfabric/bin: /efs/em/opt/intel/oneapi/mpi/2021.5.1//bin:
/efs/em/opt/intel/oneapi/mkl/2022.0.2/bin/intel64:
/efs/em/opt/intel/oneapi/dev-utilities/2021.5.2/bin:
/efs/em/opt/intel/oneapi/debugger/2021.5.0/gdb/intel64/bin:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/lib/oclfpga/bin:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/bin:
/efs/em/opt/intel/oneapi/clck/2021.5.0/bin/intel64:
<<snip>>
/efs/em/gtc_sh_ver00o05o01:
/efs/em/UCSF-Chimera64-1.15rc/bin
$ echo $LD_LIBRARY_PATH
/efs/em/opt/intel/oneapi/tbb/2021.5.1/env/../lib/intel64/gcc4.8:
/efs/em/opt/intel/oneapi/mpi/2021.5.1//libfabric/lib:
/efs/em/opt/intel/oneapi/mpi/2021.5.1//lib/release:
/efs/em/opt/intel/oneapi/mpi/2021.5.1//lib:
/efs/em/opt/intel/oneapi/mkl/2022.0.2/lib/intel64:
/efs/em/opt/intel/oneapi/debugger/2021.5.0/gdb/intel64/lib:
/efs/em/opt/intel/oneapi/debugger/2021.5.0/libipt/intel64/lib:
/efs/em/opt/intel/oneapi/debugger/2021.5.0/dep/lib:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/lib:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/lib/x64:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/lib/oclfpga/host/linux64/lib:
/efs/em/opt/intel/oneapi/compiler/2022.0.2/linux/compiler/lib/intel64_lin
<Relion ver 4.0.1までの場合>
$ cd /efs/em/
$ git clone https://github.com/3dem/relion.git #別のコンパイルで実施済みの場合は不要
$ mv relion relion-v401
$ cd relion-v401
<リリースバージョンの場合>
$ git checkout master #or ver4.0; branch ver4.0 は常に最新だがテストが十分でないためリリース版はmaster推奨
$ git branch
* master
Relionコンパイルしインストールを実行する。
$ mkdir build-intel-cpu-xcore
$ cd build-intel-cpu-xcore
$ cmake -DALTCPU=ON \
-DMKLFFT=ON \
-DCUDA=OFF \
-DCudaTexture=OFF \
-DGUI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DFORCE_OWN_FLTK=ON \
-DCMAKE_C_COMPILER=$(which icc) \
-DCMAKE_CXX_COMPILER=$(which icpc) \
-DMPI_C_COMPILER=$(which mpiicc) \
-DMPI_CXX_COMPILER=$(which mpiicpc) \
-DCMAKE_C_FLAGS="-O3 -ip -xCORE-AVX512 -qopt-zmm-usage=high -qoverride-limits" \
-DCMAKE_CXX_FLAGS="-O3 -ip -xCORE-AVX512 -qopt-zmm-usage=high -qoverride-limits" \
-DCMAKE_INSTALL_PREFIX=/efs/em/relion-v401/relion-4.0.1-intel-xcore-cpu ..
$ make -j 24 && make install
For Relion 5 or later
If you have not installed pyenv and anaconda, perform step2. before installing Relion 5.0.
$ cd /efs/em/
$ git clone https://github.com/3dem/relion.git #Not required if already done when building with other compiler
$ mv relion relion-v500-beta #Not required if already done when building with other compiler
$ cd relion-v500-beta
$ git checkout ver5.0
$ git branch
master
* ver5.0
$ git checkout ver5.0
$ git branch
master
* ver5.0
Create the conda environment for Relion (Not required if already created)
$ source /efs/em/pyenv/versions/anaconda3-2023.03/etc/profile.d/conda.sh
$ conda env create -f environment.yml
$ conda env list
# conda environments:
#
base /efs/em/pyenv/versions/anaconda3-2023.03
cryolo-1.9.6 /efs/em/pyenv/versions/anaconda3-2023.03/envs/cryolo-1.9.6
relion-5.0 /efs/em/pyenv/versions/anaconda3-2023.03/envs/relion-5.0
schemes-editing /efs/em/pyenv/versions/anaconda3-2023.03/envs/schemes-editing
topaz-0.2.5 /efs/em/pyenv/versions/anaconda3-2023.03/envs/topaz-0.2.5
Note: You should NOT activate this relion-5.0 conda environment when compiling and using RELION. RELION activates it automatically only when necessary. See https://relion.readthedocs.io/en/latest/Installation.html for more information.
Build and install Relion 5 with Intel compiler.
Specify the path to python in the conda environment created above for -DPYTHON_EXE_PATH.
Create a directory in EFS to download the trained models when cmake is executed and specify its PATH for -DTORCH_HOME_PATH.
(If no path to directory is specified or the specified path does not exist, the trained models is downloaded to /home/ubuntu/.cache/torch (on Headnode) and a cmake error occurs due to insufficient storage.)
$ mkdir relion_torch #Any directory name is acceptable.
$ mkdir relion_torch/v500-beta #Any directory name is acceptable.
$ mkdir relion_torch/v500-beta/torch #Any directory name is acceptable.
$ mkdir build-intel-cpu-xcore #Any directory name is acceptable.
$ cd build-intel-cpu-xcore
$ cmake -DALTCPU=ON \
-DMKLFFT=ON \
-DCUDA=OFF \
-DCudaTexture=OFF \
-DGUI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DFORCE_OWN_FLTK=ON \
-DCMAKE_C_COMPILER=$(which icc) \
-DCMAKE_CXX_COMPILER=$(which icpc) \
-DMPI_C_COMPILER=$(which mpiicc) \
-DMPI_CXX_COMPILER=$(which mpiicpc) \
-DPYTHON_EXE_PATH=/efs/em/pyenv/versions/anaconda3-2023.03/envs/relion-5.0/bin/python \
-DTORCH_HOME_PATH=/efs/em/relion_torch/v500-beta/torch \
-DCMAKE_C_FLAGS="-O3 -ip -xCORE-AVX512 -qopt-zmm-usage=high -qoverride-limits" \
-DCMAKE_CXX_FLAGS="-O3 -ip -xCORE-AVX512 -qopt-zmm-usage=high -qoverride-limits" \
-DCMAKE_INSTALL_PREFIX=/efs/em/relion-v500-beta/relion-5.0-beta-intel-intelmpi-cpu_xcore ..
$ make -j 24 && make install
Moduleファイルを作成する。
$ cd /efs/em/modulefiles/relion/
$ mkdir 4.0.1-pc3.7.0
$ cd 4.0.1-pc3.7.0/
$ cat > intel_amd-intel-intelmpi-cpu_xcore # 対象cpu(メーカー名)-コンパイラ-MPI-対象デバイス_最適化フラグ
#%Module -*- tcl -*-
set RELION /efs/em/relion-v401/relion-4.0.1-intel-xcore-cpu
prepend-path PATH $RELION/bin
prepend-path LD_LIBRARY_PATH $RELION/lib
setenv RELION_CTFFIND_EXECUTABLE /efs/em/ctffind-4.1.14-linux64/bin/ctffind
setenv RELION_GCTF_EXECUTABLE /efs/em/Gctf_v1.06/bin/Gctf-v1.06_sm_20_cu7.5_x86_64
setenv RELION_PDFVIEWER_EXECUTABLE /usr/bin/evince
setenv RELION_ERROR_LOCAL_MPI 96
setenv RELION_QSUB_TEMPLATE /efs/em/aws_slurm_relion.sh
# The mpi runtime ('mpirun' by default)
setenv RELION_QUEUE_USE yes
setenv RELION_QSUB_COMMAND sbatch
setenv RELION_SCRIPT_DIRECTORY $RELION/bin
# To use EFA setting for GPU
setenv RDMAV_FORK_SAFE 1
# Load required dependencies
if { ![ is-loaded mkl ] } { module load mkl }
EFSにインストールしたoneAPIをアンインストールする場合は以下で行う
$ cd /efs/em
2022.1.2の場合
$ sudo sh ./l_BaseKit_p_2022.1.2.146.sh
($ sudo sh ./l_HPCKit_p_2022.1.2.117.sh) #BaseKitのインストーラ起動でHPCKitも同時にできるはず
2023.2.0の場合
$ sudo sh ./l_BaseKit_p_2023.2.0.49397.sh
($ sudo sh ./l_HPCKit_p_2023.2.0.49440.sh) #BaseKitのインストーラ起動でHPCKitも同時にできるはず
GUIが起動したら「Modify」ボタン → uninstall を選択しアンインストールする。
複数のパッケージが表示される場合は全て行う。