Skip to content

Latest commit

 

History

History
177 lines (106 loc) · 5.54 KB

virtual-desktop-infrastructure-for-unreal-engine-on-oci.md

File metadata and controls

177 lines (106 loc) · 5.54 KB
title parent tags categories date description toc author slug
Virtual Desktop Infrastructure(VDI) for Unreal Engine 5 on Oracle Cloud Infrastructure with nVidia GPU
tutorials
2021-12-12 08:00
Get Virtual Desktop Infrastructure set up on Oracle Cloud Infrastructure with nVidia GPU.
true
oracle-developers
rust-building-an-api

In this blog you'll learn how to set up Virtual Desktop Infrastructure on Oracle Cloud Infrastructure (OCI).

A few weeks ago, Unreal Engine 5.1 was released. There are a lot of improvements and many new cool features that, for me, are making this release kind of of a big deal.

{% imgx img/UE5/UE5.png "UE5.1" "UE5.1" %}

{% imgx img/UE5/VPT.png %}

Let’s get started with setting this up.

Configuration

Setting up the GPU Compute shape.

  1. First, log into your Oracle Cloud console

  2. Once there, click on the hamburger menu

    {% imgx img/hamburger.png %}

  3. Click "Compute"

    {% imgx img/compute.png %}

  4. Click "Instances"

    {% imgx img/instances.png %}

  5. Click "Create instance"

    {% imgx img/create.png %}

  6. Change name

    {% imgx img/changeName.png %}

  7. Choose the compartment that you want to run it on

  8. This guide will focus on Ubuntu OS, so select Canonical Ubuntu.

  9. Next, select Bare Metal Machine and GPU shape

  10. Tick Terms and Conditions (Please note that the GPU shape will be charged against your account event when instance is stopped)

  11. Confirm by clicking on Select Shape

    {% imgx img/selectShape.png %}

Setting up networking

  1. For the purpuse of this guide we will create new virtual network called "GPUVCN" but you can reuse your exisiting one if you wish

    {% imgx img/newVCN.png" %}

  2. Also create new subnet and call it "GPUSUBNET"

    {% imgx img/newSubnet.png %}

  3. Next, create new SSH keys (or upload your public key files.pub)

    {% imgx img/newSSH.png" %}

Other settings

  1. Running Unreal usually requires a lot of hard drive space, so I recommend selecting a boot volume starting from 500GB+. This may vary depending on your requirements

    {% imgx img/bootVolume.png" %}

  2. I also recommend setting up a high performance VPU as this will speed things up when compiling, calculating shaders etc. Hit create once you finish

    {% imgx img/VPU.png %}

Security rules

  1. Once our instance is provisioned, let's create network security rules to allow connections for Remote desktop and SSH

    {% imgx img/NSG/1VNICnoNSG.png %}

  2. Next, create a new security rule by navigating to our VCN

    {% imgx img/NSG/2openVCN.png %}

    {% imgx img/NSG/3createNSG.png %}

  3. Navigate back to our compute instance and add the new Security Rule

    {% imgx img/NSG/4addAllowNSG.png %}

Setting up remote desktop on your GPU Compute shape.

The next steps will focus on enabling the Ubuntu GUI on the GPU shape. These steps can be done either in Terminal or Visual Studio Code.

  1. In order to connect to your instance, you can follow this guide

  2. Now that we are in, lets run few commands to set up our GUI for Ubuntu

  3. Run the following to update and upgrade your OS and install nVidia drivers:

    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt install libnvidia-common-515
    $ sudo apt install libnvidia-gl-515
    $ sudo apt install nvidia-driver-515
  4. Install the Ubuntu GUI:

    $ sudo apt install ubuntu-desktop
  5. In order to enable remote access, let's install XRDP, an open-source Remote Desktop Protocol server:

    $ sudo apt install xrdp
  6. Install net tools so we can debug our connectivity:

    sudo apt install net-tools
  7. Change your port setting from tcp6 to tcp4:

    sudo nano /etc/xrdp/xrdp.ini
  8. Inside that config file, change port=3389 to port=tcp://:3389

  9. The next step is to flush your iptables so that we can reset our linux firewall (https://www.comparitech.com/net-admin/beginners-guide-ip-tables/). You can do that by running:

    $ sudo iptables -F
  10. Save your config:

    sudo netfilter-persistent save

I recommend creating a new user and securing your admin account with a password, or whitelisting your external IP. You can find out how using this video we did a while back.

You should now be able to access the virtual machine using the Remote Desktop solution of your choice. Just type your external IP to connect to your machine.

Using Unreal Engine on your Cloud

  1. Get Unreal Engine downloaded to your machine. Since we have a GUI interface, you can install it in terminal by running sudo apt install -y chromium-browser.

  2. Open browser on your machine

  3. Navigate to https://www.unrealengine.com/en-US/linux and log in/create an epic account

  4. Download your preferred version of the engine and extract the zip file:

    {% imgx img/UE5/UEforLinux.png %}

  5. To open Unreal Engine, run /path/to/ue5.1/Engine/Binaries/Linux/UnrealEditor in terminal:

    {% imgx img/UE5/Terminal.png %}

    {% imgx img/UE5/UEStart.png %}

Outro

As a word of caution, I would say that Unreal Editor still require a bit of work in order to be as intuitive as it is on Windows. Hence, the use case here is probably focusing on accelerating the rendering for video generation and pixel streaming.