title | parent | tags | categories | date | description | toc | author | slug | |
---|---|---|---|---|---|---|---|---|---|
Virtual Desktop Infrastructure(VDI) for Unreal Engine 5 on Oracle Cloud Infrastructure with nVidia GPU |
|
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.
-
First, log into your Oracle Cloud console
-
Once there, click on the hamburger menu
{% imgx img/hamburger.png %}
-
Click "Compute"
{% imgx img/compute.png %}
-
Click "Instances"
{% imgx img/instances.png %}
-
Click "Create instance"
{% imgx img/create.png %}
-
Change name
{% imgx img/changeName.png %}
-
Choose the compartment that you want to run it on
-
This guide will focus on Ubuntu OS, so select Canonical Ubuntu.
-
Next, select Bare Metal Machine and GPU shape
-
Tick Terms and Conditions (Please note that the GPU shape will be charged against your account event when instance is stopped)
-
Confirm by clicking on Select Shape
{% imgx img/selectShape.png %}
-
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" %}
-
Also create new subnet and call it "GPUSUBNET"
{% imgx img/newSubnet.png %}
-
Next, create new SSH keys (or upload your public key files.pub)
{% imgx img/newSSH.png" %}
-
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" %}
-
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 %}
-
Once our instance is provisioned, let's create network security rules to allow connections for Remote desktop and SSH
{% imgx img/NSG/1VNICnoNSG.png %}
-
Next, create a new security rule by navigating to our VCN
{% imgx img/NSG/2openVCN.png %}
{% imgx img/NSG/3createNSG.png %}
-
Navigate back to our compute instance and add the new Security Rule
{% imgx img/NSG/4addAllowNSG.png %}
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.
-
In order to connect to your instance, you can follow this guide
-
Now that we are in, lets run few commands to set up our GUI for Ubuntu
-
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
-
Install the Ubuntu GUI:
$ sudo apt install ubuntu-desktop
-
In order to enable remote access, let's install XRDP, an open-source Remote Desktop Protocol server:
$ sudo apt install xrdp
-
Install net tools so we can debug our connectivity:
sudo apt install net-tools
-
Change your port setting from tcp6 to tcp4:
sudo nano /etc/xrdp/xrdp.ini
-
Inside that config file, change
port=3389
toport=tcp://:3389
-
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
-
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.
-
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
. -
Open browser on your machine
-
Navigate to https://www.unrealengine.com/en-US/linux and log in/create an epic account
-
Download your preferred version of the engine and extract the zip file:
{% imgx img/UE5/UEforLinux.png %}
-
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 %}
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.