在Google colab上运行gprMax
程序员文章站
2022-05-02 19:18:10
...
在Google colab上运行gprMax
Run gprMax using Google colab GPU
Requirements:
- Google account.
- gprMax package, which you can download here .
- miniconda3 package, which you can download here, remember you need Linux version.
Installation
The following steps provide guidance on how to install:
- Mount your google drive, upload gprMax package and miniconda3 package.
- Install miniconda3.
- Install gprMax.
1.Mount your google drive, upload gprMax package and miniconda3 package.
First, mount your Google drive by running
from google.colab import drive
drive.mount('/content/drive')
Then, upload gprMax package and miniconda3 package. Remember unzip gprMax package: unzip gprMax-master.zip
2.Install miniconda3
Running
import os
os.chdir('/content/drive/My Drive')
!chmod 777 Miniconda3-latest-Linux-x86_64.sh
!bash Miniconda3-latest-Linux-x86_64.sh
After several ENTER and YES,
you will see this if you successfully installed miniconda3.
3.Install gprMax
First, run !exec bash
and conda
to check your conda environment, you can see the conda usage like this:
Then run the following commands:
cd gprMax-master
conda activate gprMax
conda env create -f conda_env.yml
# build
conda activate gprMax
python setup.py build
python setup.py install
pip install pycuda
# run gprMax
python -m gprMax fp_sz_0.03.in -gpu -n 40
Using colab to run gprMax is alittle annoying because you have to run those commands again after 12h runtime.
https://www.paperspace.com/ is something like Google colab, it can save your gprMax environment after 6h runtime.
上一篇: Divide Two Integers