AWS (Linux)

Important

This guide is meant for demonstration purposes only.

This guide will walk through how to set up 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 issued)

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

Create a Virtual Machine

  1. Go to the EC2 Dashboard.

  2. Launch Instance.

  3. Choose the Ubuntu 18.04 AMI. Click Select.

  4. Choose the Instance type: p3 or p4 Instances are recommended. Click Next.

  5. Configure Instance Details (set up as needed). Click Next.

  6. Configure Add Storage.

  7. Set up root device with 500GB. Click Next.

  8. Configure tags (set up as needed). Click Next.

  9. 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, 0.0.0.0/0

  • Click Review and Launch.

  1. Launch the Instance.

  2. Proceed back to the Instance dashboard.

  3. Wait for Instance to come up.

Install Software

Warning

  • This Instance is configured open to the internet.

  • Be aware of how storage volume persists after virtual machine termination.

  1. SSH to the Instance using the Ubuntu username.

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

Install CUDA.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda

Build and install Open MPI.

wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.1.tar.gz
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/env.sh.

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

Download and install M-Star.

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

# SET UP license file according to license install instructions.

Download test cases.

cd
wget https://cdn.mstarcfd.com/testcases-10272021.tar
tar xf testcases-10272021.tar

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

Create run.sh script in the test case directory to bring in the Open MPI and M-Star environments.

source $HOME/openmpi/mstar.sh
source $HOME/mstarcfd/mstar.sh

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

Run the execution script.

chmod +x run.sh
./run.sh