GPU MrBayes

GPU MrBayes をダウンロードしてzip を解凍する

Makefile をメモ帳で開き

'MPI ?= no' を 'MPI ?= yes' に書き換える

-arch=sm_20 はRTX 2060 だと-arch=sm_75 に書き換える

Windows System on Linux のUbuntu を起動してcuda 環境を導入

https://developer.nvidia.com/cuda-toolkit にアクセス

Operating System Linux → Architecture x86__64→Distribution→WSL-Ubuntu→Version 2.0→Installer Type →deb (local)

順番に実行

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.6.0/local_installers/cuda-repo-wsl-ubuntu-11-6-local_11.6.0-1_amd64.deb

sudo dpkg -i cuda-repo-wsl-ubuntu-11-6-local_11.6.0-1_amd64.deb

sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-6-local/7fa2af80.pub

sudo apt-get update

sudo apt-get -y install cuda


次にGPU MrBayes を解凍したフォルダをUbuntu でアクセスして以下を実行

sudo apt-get install nvidia-cuda-toolkit

sudo apt-get install openmpi-doc openmpi-bin libopenmpi-dev; MPI をOn にするためにOpenMPI が必要

sudo apt-get install libreadline-dev; readline/readline.h: No such file or directory 対策

sudo apt-get install libncurses5-dev; cannot find -lncurses 対策

make; たぶんこれでコンパイルできる


実際の動かし方の例

mpirun -n (GPU 数を指定) ./mb data.nex; nexus ファイルの場所は適宜調整が必要

mpirun -n 2 ./mb whole_BIC4_nonpartitioned.nex; RT コアでいいのかな?CUDA コアではないとおもう