AWS (Linux)


This guide is meant for demonstration purposes only.

This guide will walk through how to setup a single AWS instance with multiple GPUs.

Before starting, it is recommended to have the following items ready:

  • AWS account

  • AWS subscription and quota capable of starting GPU instances such as p2.xlarge or better

  • SSH public key

  • SSH/SCP programs on local computer (eg. Putty/Winscp on windows)

  • M-Star license file (you may need to first obtain the MAC address of the instance before a license file will be issueed)

After finishing these steps, you will have a AWS GPU instance fully setup. The installation of the software will be done to the /usr/local folder for a system-wide installation.

Create a virtual machine

  • Go to the EC2 Dashboard

  • Launch Instance

  • Choose the Ubuntu 18.04 AMI. Click Select

  • Choose the Instance type: p3 or p4 instances are recommended. Click Next.

  • Configure Instance Details. (Setup as needed). Click Next.

  • Configure Add Storage

  • Setup Root device with 500GB, Click Next

  • Configure Tags. Setup as needed. Click Next.

  • Configure Security Group

    • Create or select a security group that has the following rule. This allows SSH traffic to the instance

      • Type: SSH

      • Source: Custom,

    • Click Review and Launch

  • Launch the instance

  • Proceed back to the instance dashboard

  • Wait for instance to come up

Install Software

  • SSH to the instance using the “ubuntu” username

  • Copy and paste the script shown below into a new file and execute it once. This script does the following:


To perform a quick install on Ubuntu 18. Please see Ubuntu 18 Quick Setup


  • This instance is configured open to the internet

  • Be aware of how storage volume persist after virtual machine termination

Install CUDA

sudo mv /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys
sudo add-apt-repository "deb /"
sudo apt-get update
sudo apt-get -y install cuda

Build and install OpenMPI

tar xzf openmpi-4.1.1.tar.gz
cd openmpi-4.1.1
mkdir build
cd build
../configure --prefix=$HOME/openmpi --with-cuda
make -j 4 && sudo make install

Copy this text into a new file $HOME/openmpi/

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export PATH=$DIR/bin:$PATH

Download and install M-Star

# Now Install M-Star CFD using the standard Linux instructions
cd $HOME
mkdir mstarcfd
cd mstarcfd
tar xzf mstarcfd-centos7-2.0.X.tar.gz

# SETUP license file according to license install instructions.

Download test cases

tar xf testcases-10272021.tar

Navigate to one of the test cases directories containing an input.xml file.

Create script in the test case directory to bring in the openmpi and mstar environments.

source $HOME/openmpi/
source $HOME/mstarcfd/

mpirun -np 4 mstar-cfd-mgpu -i input.xml -o out --gpu-auto

Run the execution script

chmod +x