在Google colab上运行gprMax

在Google colab上运行gprMax

Run gprMax using Google colab GPU

Requirements:

  1. Google account.
  2. gprMax package, which you can download here .
  3. miniconda3 package, which you can download here, remember you need Linux version.

Installation

The following steps provide guidance on how to install:

  1. Mount your google drive, upload gprMax package and miniconda3 package.
  2. Install miniconda3.
  3. 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

在Google colab上运行gprMax_第1张图片

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.

在Google colab上运行gprMax_第2张图片

3.Install gprMax

First, run !exec bash and conda to check your conda environment, you can see the conda usage like this:

在Google colab上运行gprMax_第3张图片

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

在Google colab上运行gprMax_第4张图片

# run gprMax
python -m gprMax fp_sz_0.03.in -gpu -n 40

在Google colab上运行gprMax_第5张图片

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.

你可能感兴趣的:(1,gprMax,google,colab,conda)