Setting up GPU-enabled Narupa server on Oracle Bare Metal Cloud for Virtual Reality Clients

Introduction about Virtual Reality Servers

Virtual reality (VR) is an interactive computer-generated experience taking place within a simulated environment. It incorporates mainly auditory and visual feedback, but may also allow other types of sensory feedback like haptic. This immersive environment can be similar to the real world or it can be fantastical. Augmented reality systems may also be considered a form of VR that layers virtual information over a live camera feed into a headset or through a smartphone or tablet device giving the user the ability to view three-dimensional images.

Current VR technology most commonly uses virtual reality headsets or multi-projected environments, sometimes in combination with physical environments or props, to generate realistic images, sounds and other sensations that simulate a user’s physical presence in a virtual or imaginary environment. A person using virtual reality equipment is able to “look around” the artificial world, move around in it, and interact with virtual features or items. The effect is commonly created by VR headsets consisting of a head-mounted display with a small screen in front of the eyes, but can also be created through specially designed rooms with multiple large screens.

VR systems that include transmission of vibrations and other sensations to the user through a game controller or other devices are known as haptic systems. This tactile information is generally known as force feedback video gaming and training applications.

Narupa is a flagship project by SimuLitix whose specialize in solutions on Virtual Reality. Augmented Reality. Mixed Reality. Hardware-adapted parallelism. High-bandwidth networks. Cloud-based super computing. These have the potential to transform how research scientists undertake nanoscale design, engineering, and simulation. SimuLitix combines these technologies to make real-time simulation tools that accelerate research. they cooperate with communities across academia and industry to tackle nanotech engineering problems like building smarter and greener materials, designing the drugs of the future, and constructing greener more efficient catalysts.

Narupa is a virtual reality enabled real-time interactive molecular dynamics framework for nanotech research applications in domains like biochemistry, materials design, and synthetic chemistry. Narupa is a portmanteau of the prefix ‘nano’ and suffix ‘arupa’. Arūpa is a Sanskrit word describing non-physical and non-material objects. it as a concept for describing what it’s like to reach out and touch a simulated nanoscale object in VR.

The open-source Narupa repository is available on GitLab under a GPL v3.0,

About this Blog

This Blog will help you Setup GPU Instance on Oracle Cloud Infrastructure OCI , Open the required ports, Install Narupa Server , Run VR Simulations, We assume that you already have Oracle Cloud Infrastructure administrative access to run these steps described in this blog . Another Assumption is you have already setup a OCI VM image that runs latest version of terraform , if you have not done so please refer my previous blog on setting up Cluster in Cloud using Terraform on OCI

How to Setup Create GPU Instance on OCI and Setup Narupa Server

We will first create a Oracle Bare metal GPU Instance on Oracle Cloud Infrastructure using Terraform , then Build Install and Run Narupa Server. To understand how to get Terraform environment variables please refer my previous blog Setting up highly scalable cluster on OCI

In a nutshell we would need to setup following variables

  • TF_VAR_tenancy_ocid
  • TF_VAR_region
  • TF_VAR_user_ocid
  • TF_VAR_fingerprint
  • TF_VAR_compartment_ocid
  • TF_VAR_private_key_path ( PEM )
  • TF_VAR_ssh_public_key_ocid ( Required to SSH to VMs created with Terraform )
  • TF_VAR_ssh_private_key_ocid ( Required to SSH to VMs created with Terraform )

Creating BM GPU Virtual Machine using Terraform

We will be using OCI Narupa Project from Gitlub to create BM GPU instance on OCI

SSH to Terraform VM

ubuntu@TerraformVM:~/new$ git clone https://gitlab.com/intangiblerealities/narupacloud/oci-narupa.git
Cloning into 'oci-narupa'…
remote: Enumerating objects: 197, done.
remote: Counting objects: 100% (197/197), done.
remote: Compressing objects: 100% (89/89), done.
remote: Total 197 (delta 111), reused 177 (delta 98)
Receiving objects: 100% (197/197), 32.17 KiB | 8.04 MiB/s, done.
Resolving deltas: 100% (111/111), done.

change to directory and list contents

ubuntu@TerraformVM:~/new$ cd oci-narupa/
ubuntu@TerraformVM:~/new/oci-narupa$ ls
LICENSE credentials.example.sh output.tf setup.tf.bootstrap
README.md datasources.tf provider.tf terraform.tfvars.example
compute.tf network.tf script variables.tf

Edit Terraform Variable file

Since we want to create a BM VM of Ubuntu OS in Ashburn Region ( where we have access to create to BM VM ) the variable file will look like this

variable "ServerImageOCID" {
description = "What image to use for the management node.
A map of region name to image OCID."
type = "map"

default = {
// See https://docs.us-phoenix-1.oraclecloud.com/images/
// Ubuntu 16.04
uk-london-1 = "ocid1.image.oc1.uk-london-1.aaaaaaaajxg7h2afqlesebr3qde2q562juauobyotat3aiphjikbf4v72z3a"
// Ubuntu 16.04 GPU image
//eu-frankfurt-1 = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaauilrmwndm7qslryagyh5mh6kifdzerakii27bt5kas3s62loe7ma"
// Our image with everything set up.
us-ashburn-1 = "ocid1.image.oc1.iad.aaaaaaaahh6wjs5qp2sieliieujdnih7eyxt32ets3nuiifzjjfkqnbelcra"
}

To get details of us-ashburn-1 Ubuntu Image refer this link

Now the variable file will look as below

ubuntu@TerraformVM:~/oci-narupa$ cat variables.tf
variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "private_key_path" {}
variable "region" {}
variable "compartment_ocid" {}
variable "ssh_public_key" {}
variable "ssh_private_key" {}
variable "ADS" {
description = "The list of ADs you want to create your narupa across."
default = ["2"]
}
variable "ServerAD" {
description = "The AD the management node should live in."
default = "2"
}
variable "ServerShape" {
description = "The shape to use for the management node"
default = "BM.GPU3.8"
}
variable "ServerImageOCID" {
description = "What image to use for the management node. A map of region name to image OCID."
type = "map"
default = {
// See https://docs.us-phoenix-1.oraclecloud.com/images/
// Ubuntu 16.04
uk-london-1 = "ocid1.image.oc1.uk-london-1.aaaaaaaajxg7h2afqlesebr3qde2q562juauobyotat3aiphjikbf4v72z3a"
// Ubuntu 16.04 GPU image
//eu-frankfurt-1 = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaauilrmwndm7qslryagyh5mh6kifdzerakii27bt5kas3s62loe7ma"
// Our image with everything set up.
us-ashburn-1 = "ocid1.image.oc1.iad.aaaaaaaahh6wjs5qp2sieliieujdnih7eyxt32ets3nuiifzjjfkqnbelcra"
}
}
variable "BootStrapFile" {
default = "./script/setup.sh"
}
variable "NarupaNameTag" {
default = "narupa"
}

Editing the terraform.tfvars file

This is most important file , you need to have all the required variables taken from OCI Console for this to work properly, copy terraform.tfvars.example to terraform.tfvars

cat terraform.tfvars
Authentication details
tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa4jbkwc4jal7ydsXXXXXX"
user_ocid = "ocid1.user.oc1..aaaunknownvwkmaXXXXXXXXXXXXXXXXX"
fingerprint = "73:09:ff:fa:dc:Hidden:0b:a9:88"
private_key_path = "/home/ubuntu/oci-narupa/oci_api_key.pem"
region = "us-ashburn-1"
ADS = ["2"]

compartment_ocid = "ocid1.compartment.oc1..aaaaaXXXXXXXXclxcbya"
Public/private keys used on the instance
ssh_public_key = <<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8QlCPHyRpwwOgPhlCQTyK0ViuEeqYVGkF45xRU6PnO9LCboOXXXXXXXJustIgore madhurao@MADHURAO-IN
EOF
NarupaNameTag = "narupa"
InstanceADIndex = ["2"]
ServerShape = "BM.GPU3.8"

It is important to access OCI web console to check the GPU VM shape that is available and in which AD it is in , so the below screens will help on that

Run terraform Init and Plan

run terraform apply to create BM GPU VM on OCI in 4 mins

Bare metal GUP VM created on OCI and Public IP is displayed

Opening SSH Port on newly created GPU VM

By default SSH is disabled to the newly created GPU VM , so you would need to Open SSH Port through Ingress rule by adding a new Ingress Rule

What Next ? Installing Narupa Server

What is Narupa repository for?

This repository contains the implementation of the simulations and server for NarupaXR, a virtual reality enabled real-time interactive molecular dynamics framework for use in nanotech research applications. It is an active fork of the iMD-VR framework first described in this paper.

Why is it called Narupa?
Narupa is a portmanteau of the prefix ‘nano’ and suffix ‘arupa’. Wikipedia explains how arūpa is a Sanskrit word describing non-physical and non-material objects. It seemed a good concept for describing what it’s like to interact with simulated nanoscale objects in VR.

SSH to BM Server Install Narupa Server & Mono

git clone https://gitlab.com/intangiblerealities/narupa-server.git
Cloning into 'narupa-server'…
remote: Enumerating objects: 2208, done.
remote: Counting objects: 100% (2208/2208), done.
remote: Compressing objects: 100% (1069/1069), done.
remote: Total 2208 (delta 1169), reused 2026 (delta 1031)
Receiving objects: 100% (2208/2208), 7.22 MiB | 12.04 MiB/s, done.
Resolving deltas: 100% (1169/1169), done.

cd narupa-server/
-/new/narupa-server$ ls
DocumentationSource Nano README.md build_docs.sh
License.txt Narupa build_docs.bat narupa.sln

Mono is a software platform designed to allow developers to easily create cross platform applications part of the .NET Foundation.

Sponsored by Microsoft, Mono is an open source implementation of Microsoft’s .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of cross platform applications.

Install using this link https://www.mono-project.com/download/stable/

Running Narupa Server

Change Directory to narupa-server / bin / debug and run mono narupa-server.exe
ubuntu@narupa:~/narupa-server/bin/debug$ mono narupa-server.exe -S /home/ubuntu/narupa-server/Narupa/Narupa.Simulations/Assets/Simulations/VR\ Demos/Tamiflu_Neuraminidase.xml -Verbosity Detail
narupa-server 1.0.6
Searching for plugins in: /home/ubuntu/narupa-server/bin/debug/Plugins
Could not find plugin directory!
Logging to: /home/ubuntu/narupa-server/bin/debug/logs
assets folder /home/ubuntu/narupa-server/bin/debug/Assets
Press CTRL+C to exit
05-02-2019 09:35:59.337 dumy-monitor started
05-02-2019 09:35:59.346 open-security-provider started
Found command /server/sendSimulation
Found command /server/sendSimulationPath
Found command /server/setFps
Found command /server/setMultiplayerBoxScale
Found command /server/setVariableRate
Load simulation file:///home/ubuntu/narupa-server/Narupa/Narupa.Simulations/Assets/Simulations/VR Demos/Tamiflu_Neuraminidase.xml
Starting simulation server on 0.0.0.0:8001
The local end point is 0.0.0.0:8001
The following security token can be used: 473GVnWtcqsHNAPGJdw9T4eqTGRd+LY3xKpWpfZ/KCE=
Waiting for a connections
Reading in PDB file from /home/ubuntu/narupa-server/bin/debug/Assets/Simulations/VR Demos/AO_no_water.pdb
Generating bonds using CONECT records and from known residue data
Centering coordinates around zero
Loading in JSON selection file: /home/ubuntu/narupa-server/bin/debug/Assets/Simulations/VR Demos/AO_no_water.json
Loaded simulation file. Proceeding to instantiate topology…
Instantiated topology, proceeding to initialise simulation…
Creating atomic system.
Initialising Verlet Integrator
Added thermostat (Andersen Thermostat) with equilibrium temperature 300 Kelvin
Created a system of 5988 particles with potential energy: 0 kJ/mol
Successfully initialised simulation.
Found command /initialiseVelocitiesCommand
Found command /restraints/addRestraints
Found command /restraints/removeRestraints
Found command /top/Neuraminidase/show
Found command /top/Neuraminidase/hide
Found command /top/Neuraminidase/list
Found command /top/Neuraminidase/addRegex
Found command /top/Neuraminidase/addPath
Found command /top/Neuraminidase/removePath
Found command /top/Neuraminidase/popPattern

Client Access

if you are using Windows Machine , You can download client from this location , Extract the zip file and edit server.json to add IP address of our GPU VM

{
"Descriptor": "Direct Connection",
"Uri": "ws://gpu_vm_public_ip_address:8080/",
"SessionKey": "473GVnWtcqsHNAPGJdw9T4eqTGRd+LY3xKpWpfZ/KCE="
}

You can use Actual VR Devices for better simulation than running it on Windows Machine

A Section on Setting up VR Clients Coming Soon in this blog ..

References

https://gitlab.com/intangiblerealities/narupa-server

https://gitlab.com/intangiblerealities/narupacloud/oci-narupa

https://www.mono-project.com/download/stable/

https://gitlab.com/intangiblerealities/narupaXR/blob/master/DocumentationSource/UserGuide/UserGuide.md