欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

在Google colab上运行gprMax

程序员文章站 2022-05-02 19:18:10
...

在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

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

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

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

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

在Google colab上运行gprMax

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.