本家様
https://github.com/juglab/cryoCARE_T2T
https://github.com/juglab/cryoCARE_T2T/wiki/Cryo-CARE

ノイズ除去の一種(GPUを使います)

使い方はSingularityのイメージを作成して、この中で使って解析を進めるみたい.

あとメモリー消費を抑えたエディションも用意されていている。こっちが最新版
https://github.com/juglab/cryoCARE_pip

まずはSingularity版を用意してみる.

cryoCARE_T2T Singularity†

*既にbuildされたimage fileも提供されています. まぁーbuild済みimageを使うのが楽ですね. ただ、IMODを最新にできるのが手動側の利点かな
計算機に搭載のnvidiaドライバが 430.40 以上であることが必要のようでその確認を行う
*cudaライブラリは入れてないです. nvidiaドライバのみを入れてます

[root@centos7 ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  515.76  Mon Sep 12 19:21:56 UTC 2022
GCC version:  gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
 
[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
 
[root@centos7 ~]#

と大丈夫みたい.
っで次. Singularityのimage fileをユーザに作らせたいのでfakerootをそのユーザに与えます Singularity#ye091ebb

[root@centos7 ~]# echo "user.max_user_namespaces=10000" >> /etc/sysctl.conf
[root@centos7 ~]# sysctl -p
user.max_user_namespaces = 10000
[root@centos7 ~]# singularity config fakeroot --add illya

っでfakerootを与えられたユーザにて構築

[illya@centos7 ~]$ git clone https://github.com/juglab/cryoCARE_T2T
[illya@centos7 ~]$ cd cryoCARE_T2T/
[illya@centos7 cryoCARE_T2T]$ ls -CF
cryoCARE.Singularity  example/  LICENSE  preview.png  README.md  user/
 
[illya@centos7 cryoCARE_T2T]$

少々「cryoCARE.Singularity」を修正する必要がありました.

diff --git a/cryoCARE.Singularity b/cryoCARE.Singularity
index 8fd173d..ed22e4d 100644
--- a/cryoCARE.Singularity
+++ b/cryoCARE.Singularity
@@ -4,6 +4,8 @@ BootStrap: docker
 From: tensorflow/tensorflow:1.15.0-gpu-py3
 
 %post
+    apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
+    apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
     apt-get -y update
 
        # libtiff5 is needed for MotionCor2
@@ -39,14 +41,14 @@ From: tensorflow/tensorflow:1.15.0-gpu-py3
 
     # Download IMOD
     mkdir /imod
-    wget -P /imod https://bio3d.colorado.edu/ftp/latestIMOD/RHEL6-64_CUDA8.0/imod_4.10.52_RHEL6-64_CUDA8.0.sh
-    sh /imod/imod_4.10.52_RHEL6-64_CUDA8.0.sh -extract
+    wget -P /imod https://bio3d.colorado.edu/ftp/latestIMOD/RHEL6-64_CUDA8.0/imod_4.12.27_RHEL6-64_CUDA8.0.sh
+    sh /imod/imod_4.12.27_RHEL6-64_CUDA8.0.sh -extract
     ls /
-    tar -xzf /IMODtempDir/imod_4.10.52_RHEL6-64_CUDA8.0.tar.gz -C /usr/local
-    ln -s /usr/local/imod_4.10.52 /usr/local/IMOD
+    tar -xzf /IMODtempDir/imod_4.12.27_RHEL6-64_CUDA8.0.tar.gz -C /usr/local
+    ln -s /usr/local/imod_4.12.27 /usr/local/IMOD
     cp /usr/local/IMOD/IMOD-linux.* /etc/profile.d
     rm -r /imod
-    rm -r /IMODtempDir/imod_4.10.52_RHEL6-64_CUDA8.0.tar.gz
+    rm -r /IMODtempDir/imod_4.12.27_RHEL6-64_CUDA8.0.tar.gz
 
        # Install required Python packages
     pip install keras==2.2.4

その上で下記コマンドでSingularityのimage fileを作ります

[illya@centos7 cryoCARE_T2T]$ singularity build --fakeroot cryoCARE_v0.1.1.simg ./cryoCARE.Singularity

っで動作テスト

作成した「cryoCARE_v0.1.1.simg」は「/home/illya/cryoCARE_T2T/cryoCARE_v0.1.1.simg」に位置している。
MotionCor2を入手して、これを「/home/illya/cryoCARE_T2T/example/」に配置. あとTomo110.zipを入手. 9.1GBあります.これを「/home/illya/cryoCARE_T2T/example/」にて展開

[illya@centos7 ~]$ cd cryoCARE_T2T/example/
[illya@centos7 example]$ ls -l
total 7268
-rw-rw-r--. 1 illya illya   13890 Oct  9 12:59 01_Split_Frames.ipynb
 :
drwxrwxr-x. 2 illya illya      22 Oct  9 12:59 data
-rw-rw-r--. 1 illya illya    6528 Oct  9 12:59 generate_train_data.py
-rwxrwxr-x. 1 illya illya 3058240 Oct  9 13:24 MotionCor2_1.5.0_Cuda101_05-31-2022     <--- singularityの中はcuda10.1なのでMotionCor2
  :
[illya@centos7 example]$ cd data/
[illya@centos7 data]$ unzip -q ~/Tomo110.zip
[illya@centos7 data]$ ls -l
total 0
drwxr-xr-x. 4 illya illya 32 Jul 12  2019 Tomo110
[illya@centos7 data]$

参照 https://github.com/juglab/cryoCARE_T2T#example-data

テスト準備が完了したら起動します

[illya@centos7 ~]$ cd cryoCARE_T2T/
[illya@centos7 cryoCARE_T2T]$ singularity run --nv -B user:/run/user -B example/:/notebooks -B example/data/:/data cryoCARE_v0.1.1.simg
INFO:    underlay of /etc/localtime required more than 50 (87) bind mounts
INFO:    underlay of /usr/bin/nvidia-smi required more than 50 (341) bind mounts
Starting notebook...
Open browser to localhost:8888
[I 14:03:38.314 NotebookApp] Writing notebook server cookie secret to /home/illya/.local/share/jupyter/runtime/notebook_cookie_secret
[I 14:03:38.663 NotebookApp] Serving notebooks from local directory: /notebooks
[I 14:03:38.663 NotebookApp] Jupyter Notebook 6.4.10 is running at:
[I 14:03:38.663 NotebookApp] http://centos7:8888/?token=823f4924266938676c4399523a52220ff995b7e094f77d58
[I 14:03:38.663 NotebookApp]  or http://127.0.0.1:8888/?token=823f4924266938676c4399523a52220ff995b7e094f77d58
[I 14:03:38.663 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:03:38.665 NotebookApp]
 
    To access the notebook, open this file in a browser:
        file:///home/illya/.local/share/jupyter/runtime/nbserver-14024-open.html
    Or copy and paste one of these URLs:
        http://centos7:8888/?token=823f4924266938676c4399523a52220ff995b7e094f77d58
     or http://127.0.0.1:8888/?token=823f4924266938676c4399523a52220ff995b7e094f77d58

notebookですね。他のPCでブラウザを立ち上げて、明記された「http://centos7:8888/?token=823f4924266938676c4399523a52220ff995b7e094f77d58」にアクセスします. firewalldが動いている可能性がありますので、停止させておいてください

2022y10m09d_140802161.png

だが、、テスト実行が動かない...
nvidia-smiがそもそもsingularity内で動かなかった. これはホスト側で「modprobe nvidia_uvm」で回避. だたMotionCor2の実行で「Info: skip device 0, unknown error」「mCheckGPUs: no valid device detected.」が表示される

結局、MotionCor2は本家指定の「MotionCor2_1.3.0-Cuda101」を頑張って入手. それと本体のnvidiaドライバは「510.47.03」「510.85.02」でcudaライブラリは特に入れなくても動いた. まぁcudaライブラリはsingularity側で提供なので.
だが、「515.76」だと無理でした.
よくよく「cryoCARE.Singularity」を見たら....「From: tensorflow/tensorflow:1.15.0-gpu-py3」とある. tensorflow-1.15かぁ...GPUのampere系は無理ですな...singularityだからそこら辺も誤魔化してく、、はくれなかった模様.

メモリー消費を抑えたエディション†

https://github.com/juglab/cryoCARE_pip
Singularity経由でなく pip で構築となっているので、ここでは anaconda で python実行環境を用意してpipで埋めていく.

[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.5 (Blue Onyx)
 
[root@rockylinux9 ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  570.133.07  Fri Mar 14 13:12:07 UTC 2025
GCC version:  gcc version 11.5.0 20240719 (Red Hat 11.5.0-2) (GCC)
 
[root@rockylinux9 ~]#

anaconda環境はcrYOLOとかtopazのように構築しますが、ここでは anaconda3-2024.10-1 で作っていきます

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.10-1
pyenv global anaconda3-2024.10-1
 
export PATH=$PYENV_ROOT/versions/anaconda3-2024.10-1/bin/:$PATH

として

conda create -n cryocare_11 python=3.8 cudatoolkit=11.0 cudnn=8.0 -c conda-forge
conda activate cryocare_11
pip install tensorflow==2.4
pip install cryoCARE
 
conda deactivate

最後にいつもの EnvironmentModules

[root@centos7 ~]# vi /apps/modulefiles/cryoCARE
 
#%Module
set          root /apps/pyenv/versions/anaconda3-2024.10-1/envs/cryocare_11
prepend-path PATH $root/bin
prepend-path LD_LIBRARY_PATH $root/lib
 
[root@centos7 ~]#

blackwell対応†

[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.8 (Blue Onyx)
 
[root@rockylinux9 ~]# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  595.104.02  Release Build  (dvs-builder@U22-I3-H06-02-6)  Thu Sep 17 17:31:15 UTC 2026
GCC version:  gcc version 11.5.0 20240719 (Red Hat 11.5.0-14) (GCC)
 
[root@rockylinux9 ~]# nvidia-smi -L
GPU 0: NVIDIA RTX PRO 2000 Blackwell (UUID: GPU-40660e37-0d35-d4f4-294a-eee3fe83049e)
 
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# conda create -n cryocare-blackwell python=3.11 -y
[root@rockylinux9 ~]# conda activate cryocare-blackwell
 
(cryocare-blackwell) [root@rockylinux9 ~]# pip install --upgrade pip
(cryocare-blackwell) [root@rockylinux9 ~]# pip install "tensorflow[and-cuda]==2.21.*"
(cryocare-blackwell) [root@rockylinux9 ~]# pip install "csbdeep>=0.8,<0.9"
 
(cryocare-blackwell) [root@rockylinux9 ~]# cd /apps
(cryocare-blackwell) [root@rockylinux9 apps]# git clone https://github.com/juglab/cryoCARE_pip.git
(cryocare-blackwell) [root@rockylinux9 apps]# cd cryoCARE_pip
(cryocare-blackwell) [root@rockylinux9 cryoCARE_pip]# vi setup.py
        "numpy~=1.19.2",
        "mrcfile",
        "csbdeep>=0.7.0,<0.8.0",
        "psutil"
 ↓
        "numpy",
        "mrcfile",
        "csbdeep>=0.8.0,<0.9.0",
        "psutil"
(cryocare-blackwell) [root@rockylinux9 cryoCARE_pip]# pip install .
(cryocare-blackwell) [root@rockylinux9 cryoCARE_pip]# conda deactivate
[root@rockylinux9 cryoCARE_pip]#
 
[root@rockylinux9 cryoCARE_pip]# cd /apps/
[root@rockylinux9 apps]# git clone https://github.com/SBC-Utrecht/cryocare-from-movies

「/apps/modulefiles/cryoCARE」

#%Module
set          root /apps/pyenv/versions/miniforge3-26.7.2-0/envs/cryocare-blackwell
prepend-path PATH $root/bin:/apps/cryocare-from-movies
prepend-path LD_LIBRARY_PATH $root/lib

cryocare-from-movies†

本家様 https://github.com/SBC-Utrecht/cryocare-from-movies

最新の60件
2026-11-12 2026-11-02 2026-11-01 2026-10-30 2026-10-28 2026-10-26 2026-10-21 2026-10-20 2026-10-18 2026-10-12 2026-10-08 2026-10-07 2026-10-06 2026-10-04 2026-10-02 2026-10-01 2026-09-30 2026-09-28 2026-09-27 2026-09-26 2026-09-22 2026-09-17 2026-09-11 2026-09-06 2026-08-27 2026-08-24 2026-08-20 2026-08-19 2026-08-18 2026-08-17 2026-08-16 2026-08-15 2026-08-13 2026-08-12 2026-08-11 2026-08-09 2026-07-30 2026-07-25 2026-07-24 2026-07-20 2026-07-18

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2026-09-30 (水) 22:33:18