By: Alix Akhribi, Software Engineer at TensorIoT
What is cloud gaming and why?
Cloud gaming is a way of playing video games through remote hardware. Spending a lot of money building dedicated gaming machines, downloading a game onto that machine, and playing it locally is time consuming and costly. Cloud gaming only relies on internet streaming to deliver games to your device of choice. That means that your television, phone, or computer is not limited by its own hardware to play these games.
There are several reasons why cloud gaming has become popular in recent times. The first and most important reason is that you can reach quality benchmarks, similar to what is possible on high-end systems on devices that are not dedicated gaming hardware. These high-end resolutions and 60 frames-per-second framerates are possible on modest internet speeds with most supporting 4k at around 30mbps. The second reason cloud gaming is popular is convenience. You no longer have to worry about upgrading your PC or taking your gaming laptop with you on the go. If you wanted to, you could even run these games on your phone.
At the time of writing this, it seems like everyone is trying to get in on cloud gaming. Cloud providers are battling it out over who will have the best cloud gaming platform. More and more game studios are starting to release subscription-based services on their cloud platforms, giving users access to all their games. Some companies are dedicated to cloud gaming and sell time-based access to cloud gaming. Then you have people, like myself, that want to set up their own cloud gaming setup and environment. If that’s you as well, then keep on reading and learn how you can leverage AWS to make your own cloud gaming setup.
Cost of Cloud Gaming on AWS
Cost depends on your region and the type of instance you are using but AWS’ scalable platform allows individuals to create a cloud gaming setup inexpensively. If you wanted to keep the prices as low as possible, you can use a spot Amazon EC2 instance. What spot pricing allows you to do is bid on unused Amazon EC2 instance at a significant reduced rate. Roughly 1/7th the regular cost than regular instances. However, costs vary depending on the region, and prices will also reflect the demand of these spot instances. By comparison, on-demand instances have a fixed rate that won’t fluctuate based on demand unless Amazon changes them.
You’ll need to use some disk space for the Amazon EC2 instance. Whenever you decide to spin up an Amazon EC2 instance, you base the instance on an AMI (Amazon Machine Image). The AMI will already be pre-configured with a Windows install and will be copied to a general-purpose Amazon EBS storage (Elastic Block Store). Whenever you terminate the instance, the Amazon EBS storage is deleted with it. The price for this storage depends on the region you are in.
Setting up EC2
To get the best gaming experience out of our Amazon EC2 instance, we’ll want to use a g3s.xlarge for its NVIDIA Telsa M60 and 30.5gb of RAM. In the top right corner of the console, between your name and support, you’ll notice a region. Click on that and make sure you select on that is closest to you. You can also use CloudPing to find the best option for you in case a g3s.xlarge instance is not available in your selected region. Look for the region with the lowest ping as it will provide the best gaming experience. Once you have chosen your region, click on Amazon EC2, instances, and the launch instance.
1. For your AMI, choose Microsoft Windows Server 2019 Base.
2. Next, you’ll select the instance for our cloud gaming. For the instance type, click on filter by and select GPU instances. Select g3s.xlarge and click next.
3. If you wanted to make it a little bit cheaper, you could select a spot instance. If you don’t want a spot instance, click next to choose the storage and move on to the next step in the instructions. If you are going to make it a spot instance, you would go ahead and click on “request spot instances” next to purchasing options. This will display all the availability zones and their prices. You will be asked to fill in a maximum price. To play it safe, you could set your maximum price close to the on-demand price. The main thing to keep in mind here is that should the price exceed your maximum price while you are playing, your instance will be terminated. Setting a maximum price does not mean this is what you’re going to pay the entire time, only what you’re willing to pay up to. So, if you set your maximum to $0.75 per hour and the price sits around $0.11 per hour as you play, you’ll be paying that $0.11 per hour. Click next to choose the storage.
4. For the storage, I recommend anywhere from 100gb-150gb depending on the games you’re going to want to install plus the windows operating system. If you are using spot instances, make sure that your primary disc does not get deleted on termination.
5. Click next to add tags. These tags are purely for your own information. I recommend using the Name tag as it will appear in the AWS Management Console as the name of your instance. Type whatever you want to name it in the value and click next. I kept it simple and used the name Cloud-Gaming.
6. Next for the security group, to make life easier, I recommend allowing all traffic. Click on “Create a new security group.” You’re going to want to enter a security group name so that you can reuse this next time you want to launch an instance. Since you will be reusing this security group in the future, make sure to name it something that will make sense and easily identifiable to you in the future. Click on the drop-down under type and select “Allow all traffic.” Double-check to make sure everything looks right and click launch.
7. You will then be asked for a key pair. This will be used to encrypt/decrypt your default password for the Admin account. Select create new key pair and give it a name. Download the file and make sure to keep this file after you haven’t downloaded it. You will need this file to get the password to your instance! Something to keep in mind is that if you are to do this again in the future, you can select this key pair again by selecting “Choose an existing key pair” Now give it a few minutes for the instance to start up.
Install the Drivers
Once your instance has spun up and is ready to go, get your windows password and connect using Remote Desktop Connection or download Microsoft Remote Desktop if you’re on a mac.
Once you’re inside your instance, you’re going to want to change your password to make it easier to log back in. Use the following steps:
- Click “Start”, then look for “Administrative Tools”.
- Click “Computer Management” & expand
- Go to “Local Users and Groups”, click “Users”, right-click “Administrator”
- “Set Password”
- “Proceed” type and retype your new password
- Click “Ok”.
The next thing you’re going to want to do is disable the “IE Enhanced Security.” Open “Server Manager,” click “Local Server” on the left, and then click “On” next to “IE Enhanced Security” and disable it for Administrators and regular Users.
The third step is: download Chrome. Once Chrome is installed, you’re going to want to download DirectX and the NVIDIA Tesla M60 drivers. Don’t reboot just yet since we’re going to install some other stuff first and reboot only once.
To make games use the video card, you’ll need to remove the default display driver completely. Run the following in a Command Prompt, but be sure to run each command individually.
Press enter or click to view image in full size
If you want sound in your games you can download Razer Surround Drivers. After you install, you will get a pop up asking you to log in, but you can ignore it as it isn’t required. What is required is enabling sound. To do that you will:
- Click “Start,” “Administrative Tools”
- Double click “Services”
- Find “Windows Audio” double click and select “Automatic” from the “Startup Type” dropdown
- Then click Apply and Ok
- Do the same thing for “Windows Audio Endpoint Builder.”
Last but not least, we’re going to need to install Steam. Once steam has been installed, and you have logged in, we can finally reboot.
Playing your game and steam in-home streaming
To play the game on your Amazon EC2 instance, install the game from Steam and boot it up the way you normally would. Hook up a controller, like I did if you want, and play away! I was able to run Batman Arkham Knight on max settings with no problem at all and no noticeable latency.
If you wanted stream to another machine, you would open Steam on your local machine, find the game in your library and click the “Stream” button. Remember to terminate your Amazon EC2 instance when you’re done playing, so you’re no longer being charged for it. To do that simply go back to the AWS Management Console and select “Instance State,” “Terminate.”
Good luck!
Resource Links:
CloudPing — https://www.cloudping.info/
Windows Password — https://aws.amazon.com/premiumsupport/knowledge-center/retrieve-windows-admin-password/
Google Chrome — https://www.google.com/chrome/
DirectX — https://www.microsoft.com/en-us/download/details.aspx?id=35
NVida Tesla M60 Drivers — https://www.nvidia.com/Download/driverResults.aspx/146687/en-us
Razer Surround Drivers — https://www.razer.com/7.1-surround-sound