Run gprMax using Google colab GPU
- Google account.
- gprMax package, which you can download here .
- miniconda3 package, which you can download here, remember you need Linux version.
The following steps provide guidance on how to install:
- Mount your google drive, upload gprMax package and miniconda3 package.
- Install miniconda3.
- Install gprMax.
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
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.
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. Another website: https://www.paperspace.com/ is something like Google colab, but it can save your gprMax environment after 6h runtime.