0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windows PCでLinuxを使ってクライオ電子線トモグラフィー関連のプログラムを動かす(2)CUDA Toolkit, Imod

Last updated at Posted at 2022-05-26

IMOD本家HP https://bio3d.colorado.edu/imod/
IMODはCryo電顕で撮影した連続傾斜像からの3D再構築やモデル化などを行う標準的ソフトウェアである。
ここではIMODの使い方については説明しない。英語のマニュアルを読み解くか、九工大のEosのHPを参照してください。

かつては、WindowsにはCygwinを使ってインストールしていた。Imodの本家にはその方法も掲載されている。GUIの使い勝手はWSLにインストールするよりもCygwinのほうがよいかも?

Scipion tomoを入れたい場合には、以下は行わずScipionのページへskipしてください。

自分の実行環境

Windows11 Home
Ubuntu20.04.4 LTS
Nvidia GeForforce 1070Ti

CUDA Toolkitのインストール

GPU(NVIDIA CUDA対応)がある場合には、インストールしておく(省略可)。

下記の記事の通りに実行する
https://qiita.com/ksasaki/items/ee864abd74f95fea1efa

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.4.1/local_installers/cuda-repo-wsl-ubuntu-11-4-local_11.4.1-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-4-local_11.4.1-1_amd64.deb
sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-4-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

インストールの確認として以下を実行

nividia-smi
Thu May 26 19:43:34 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.43.04    Driver Version: 512.20       CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
|  0%   35C    P8     6W / 180W |     14MiB /  8192MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     14946      G   /3dmod                          N/A      |
|    0   N/A  N/A     28904      G   /Xwayland                       N/A      |
+-----------------------------------------------------------------------------+

切れてしまっているが、3段目一番左のブロックでNVIDIA GeForce 1070 Tiが認識されていることが確認できる。
また、CUDA VersionはWindowsにインストールされているバージョン(あるいはインストールされている中で最新のバージョンが表示される)

実際にLinuxにインストールされているバージョンを確認するためには、以下を実行

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

この記事では11.4をインストールしているので、11.4が表示されるはず(上記は都合により10.1をインストールした場合が表示されている)

上記記事にある通りdockerやNvidia container toolkit(旧Nvidia docker)を使うと色々便利そうではあるが、勉強不足で理解していないので、ここでは割愛。WSLの場合、そもそも別のディストリビューションを作ってしまう、というのも手だ。

Imodインスール

以下はImodのインストール説明ページに書いてある通りである。
https://bio3d.colorado.edu/imod/download.html
https://bio3d.colorado.edu/imod/doc/guide.html

必要なパッケージ(python2, java)のインストール

sudo apt-get install python
sudo apt-get install default-jdk

*apt-getよりaptのほうがよい?

Imodをダウンロードしてインストール

wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_4.11.15_RHEL7-64_CUDA10.1.sh
sudo sh imod_4.11.15_RHEL7-64_CUDA10.1.sh

一度Ubuntuを再起動したあとに、etomoと3dmodを起動してみる。

etomo
3dmod

それぞれGUIがひらけばOK。
image.png
image.png

トラブルシューティング

エラー1

Error while loading shared libraries: libGLU.so.1: cannot open such file or directory
directory

対応

sudo add-apt-repository ppa:ubuntu-x-swat/udates
sudo apt-get dist-upgrade
sudo apt install ubuntu-desktop mesa-utils

エラー2

Could not load the Qt platform plugin "xcb" in "" even though it was found

対応

sudo apt install libxkbcommon-x11-0
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?