🎮 Build your own high performance cloud gaming server!

By on  Â· Reading time: 4 mins

Please notice that some games that have an anti-cheat mechanism may not work well with this method.

Game play on an M1 Pro MacBook, gaming VM is located in China, and the laptop is in US. 2k@90fps

Why do we need cloud gaming and why not use Stadia?

First of all, cloud gaming may not seem a good solution if you are an fps player, because video encoding and decoding will consume time, and network latency will do too, this will impact your fps performance significantly. However, if you are an Apple M1 user, or you want to play games on your Apple TV, you will need cloud gaming to play games like Cyberpunk 2077 because these games just cannot run on ARM architecture.

Then why not use Stadia? There are many reasons for it. First of all, Stadia is closing. Secondly, the Stadia cloud does not give you a full desktop experience, and you cannot play games purchased on Steam. Thirdly, personal cloud gaming allows you to stream at 4k@144fps at very low latency giving you connect from the same LAN. There are many more reasons that you should have your own. However, building such a system will not reduce your cost compared to building a playable gaming PC. If you really care about the cost, building a physical gaming machine can be much more cost-effective than building a cloud gaming machine. Because could gaming machine host will cost you much more than a single gaming machine, and you still have to pay for the client machine which can handle 4K@144fps streaming.

Or, you can try to think why not? I personally connect my bedroom projector using Steam Link to one of my gaming VM, 24*7 standby, which is very comfortable. Also, building such a system gives you a VDI environment as well, which is very useful in some cases.

Under the hood

Essentially, a cloud gaming host only involves two things: a gamable environment and a gamable remote desktop. There are several ways to get a gamable environment. One is to use a physical machine(bare metal), which is the most powerful and simple solution. However, it can only serve 1 person to play at the same time. Another solution is a virtual machine, which can split the physical machine and assign to many people to play together.

This article will introduce a way to build virtual machines for cloud gaming, but the experience is similar if you’re trying to build a bare metal machine.

Hardware requirements

The hardware requirements are very high because you need to run a virtual machine with 4K@144fps streaming. The minimum requirements are:

  • Modern CPU, great single-core performance, and many cores
  • 32GB * VM count + a little overhead RAM, more channel is better
  • 0.5-2TB * VM count NVMe storage, or SAN storage
  • 1Gbps network bandwidth. If you’ll use SAN storage, you can use a 10-40Gbps network that supports SR-IOV.
  • GRID GPU with 12GB * (VM count) VRAM, or (RTX GPU with NVENC) * (VM count). You need at least 12GB of VRAM for 4k gaming and 8GB of VRAM for 1080p gaming no matter if you’re targeting 60fps or 144fps.

For mine, I’m using Dell R7525 with 2x 32 core 64 threads AMD EPYC CPU, 2 Tesla GPUs, 256GB RAM in 8 channels, and 4TB iSCSI drive backed by NVMe array, and I can run 4 VMs at the same time with no compromise.

Install Hypervisor

I recommend using VMWare ESXi because it is the easiest to use. Please follow Installing and Setting Up ESXi to install the OS. You still have other options, like Proxmox, KVM, Hyper-V, and Citrix XenServer. However, you cannot use a VMWare workstation on Windows to do this, because it does not support GPU passthrough.

After installing ESXi, head to settings-hardware, search for your network card and enable SR-IOV. If you’re using SAN storage, you need to enable the SAN storage adapter as well. Click Reboot. Then enable global SR-IOV in the BIOS when rebooting.

Install client OS and GRID driver

Create a VM with the following specs:

  • 8 cores, default CPS settings
  • 32GB RAM
  • 1TB NVMe drive
  • SR-IOV network adapter

Install Windows.

Install GRID driver

  1. Download the GRID driver from NVIDIA’s website.
  2. After downloading the driver, there are a host driver and a client driver.
  3. Install the host driver to the ESXi host. Please follow Installing NVIDIA vGPU Software on ESXi to install the driver.
  4. After installing the vib to the ESXi host, reboot the ESXi host.
  5. After reboot, edit the VM config, add PCI device, and add the GRID GPU to the VM, recommend using the model ending with 12q. Then start these VM.
  6. Copy the client driver to the VM, and install it. After installation, reboot the VM.
  7. Clone the VM to create more VMs, you need to change their hostname after cloning.

Stream games

  1. Install Parsec at parsec.app in the VM, and also install Parsec on the client machine.