How to use EC2 GPU machines + Steam In-Home Streaming + a VPN to play AAA titles on a shitty laptop

Live streaming

You might have tried a service like the now defunct OnLive. Though personally I’ve played and beat many AAA games on the service, it unfortunately a) had a very limited selection and b) is now gone. I also have a bunch of games on Steam that I’ve played using my eGPU. With the new Macbook though, I won’t be able to continue my low-end-laptop but high-end gaming extravaganza since there’s no Thunderbolt. So why am I not concerned? Steam recently introduced In-Home Streaming, which basically creates a mini-OnLive in your own home with all the same Steam games I played with my eGPU. But… let’s do it over the Internet!

Cost

Playing games this way is actually quite economical – especially when comparing to purchasing a full-on gaming rig. Here are the costs you’ll need to consider:

  • GPU Instance runs about $0.11/hr (on a Spot instance, regularly around $0.70/hr)
  • Data transfer will around $0.09/GB, and at a sustained ~10mbit, itll cost you $0.41/hr (4.5GB/hr)

This comes out to around $0.52/hr, not bad, for the cost of a $1000 gaming pc, you get ~1900 hours on much higher-end hardware!

The catch?

This is all fun and games, but you need to make sure of two things:

  1. You are within 20ms to the closest AWS datacenter (test here) and has GPU instances
  2. You have at least a 10mbit connection and it’s unmetered

Setting it up

  1. On AWS, create a new EC2 instance. Use these settings:
    • Base image should be Microsoft Windows Server 2012 R2 Base (since Windows still has all the best games)
      Windows Server 2012 R2
    • Use a g2.2xlarge instance (to get an NVIDIA GRID K520 graphics card)
      EC2 GPU class machine
    • Use a Spot instance, it’s significantly cheaper (1/7th the regular cost) than regular instances
    • For storage, I recommend at least 60GB (so you can install lots of fancy games)
    • Also for storage if you’re using spot instances, make sure your primary disk doesn’t get deleted on termination
    • For the Security Group, i’d recommend just adding type All traffic
    • Finally, for the key pair, create a new one since you’ll need one for Windows (to retrieve the password)
  2. Once your spot instance is assigned, use Microsoft Remote Desktop to connect to it (get it here on a Mac). The username is Administrator and the password you’ll need to retrieve from the EC2 Console. Once inside, make sure to install TightVNC server and use Screen Sharing (on a mac) to connect to the server. VNC is necessary so that the server uses the proper video card for rendering.

  3. Install the NVIDIA K520 drivers from the Nvidia website
    NVIDIA K520

  4. In order to make it actually use the video card, you’ll need to completely remove the default driver. Open up Device Manager, and a) disable the Microsoft Basic Display Adapter, b) uninstall it and c) delete the driver file C:\Windows\System32\Drivers\BasicDisplay.sys (see instructions for how to delete protected drivers here). Reboot and VNC back in.
    Only the NVIDIA GRID K520

  5. Start the Windows Audio Service as per the instructions here. Also, since you’re on EC2, those machines do not virtualize a sound card. So install VB-Cable so you can get sound.

  6. Install the Hamachi VPN service (it’s free). It just makes it very easy to get your computer and the server on the same VPN without port forwarding or other crazy things. Steam In-Home streaming only works on the “local” network, so that’s why this is necessary. You might be able to use the built-in VPN server in Windows too, but it’s a huge hassle to set up properly.
    VPN all set up

  7. Install Steam and get yourself on the Beta channel (available in the preferences). Also, start downloading whatever games you’ll want to stream. Oh and on your own Steam installation, make sure to turn on Hardware Decoding in the Steam settings, and I also recommend turning on Display Performance Information.
    Steam Settings

  8. Start gamin!
    Live streaming

Performance

While playing, make sure to hit F6 to see the latency graph. Anything above 50ms will make the delay somewhat noticable, though I’ve played with delays up to 100ms. It just takes some getting used to and before you know it you won’t even know you’re streaming your games from a computer far far away.

One other thing you should do is hit F8 while playing (note that sometimes this will cause the client to crash, but the file will still get written). F6 will do a dump of stats in the C:\Program Files (x86)\Steam\logs\streaming_log.txt file on the server. Open it up to see detailed latency timings. Here’s an example of the interesting lines:

"AvgPingMS"       "11.066625595092773"

"AvgCaptureMS"    "4.555628776550293"  
"AvgConvertMS"    "0.023172963410615921"
"AvgEncodeMS"     "5.5545558929443359"
"AvgNetworkMS"    "7.0888233184814453"
"AvgDecodeMS"     "3.7478375434875488"
"AvgDisplayMS"    "6.3670969009399414"

"AvgFrameMS"      "27.798770904541016"
"AvgFPS"          "57.622333526611328"

Unfortunately Steam doesnt support pulling the video from the H264 encoder on the GRID’s NvFBC (which would reduce AvgEncodeMS a bunch). If you were running a GTX video card locally this is one thing that’d make it faster than using EC2 (in addition to largely decreasing NetworkMS).

See more information about this file in the Steam In-Home Streaming Steam Group.

Trouble?

Two quick notes when having trouble.

First, if you have Hamachi running and you can’t get your client computer to see the server Steam, usually restarting Steam on the server will get the client to see it again. It’s a bit of a pain since you’ll need to VNC into the computer to restart things.

Second, if the game freezes, the way to get it out of it’s broken state is to Microsoft Remote Desktop in, close things, then go back in via VNC to restore Steam, etc.

Summary

If you have a) a fast internet connection and b) you’re near an AWS datacenter with GPU instances, in my opinion, this is actually quite practical. Not only performance-wise, but it’s also quite economical.

Also, RIP OnLive. Loved those guys.

Happy gaming!