Achieve 60 FPS in a remote environment with a 4K monitor ~ Stream distribution using NICE DCV via QUIC UDP
This article is a translation of "Stream a remote environment with NICE DCV over QUIC UDP for a 4K monitor at 60 FPS".
In recent years, game development has become more decentralized. In 2020, COVID-19 accelerated the demand and innovation of remote solutions.
Regardless of form or size, the game team was left with two options. Do you want to rush home and access your office via a virtual private network (VPN), or leave your development workstation in your office and access it from your home hardware via Remote Desktop Protocol (RDP)? It was either. But now, game developers are trying to create an environment where they can work the way they want, more permanently, with a full cloud migration.
Many game studios are migrating their workstations and continuous integration / continuous deployment (CI / CD) pipelines to cloud infrastructure. Leveraging AWS game development cloud solutions, game development teams have the resources they need to quickly code, deploy, and release remotely. Previously, to create a decentralized development pipeline, game studios had to hand over hardware to engineers and spend a great deal of time onboarding their newly created environment. To help reduce costs, spend more time building immersive and entertaining games, and support a hybrid work environment for employees around the world, developers use AWS. To move to cloud game production (GPIC) solutions for a variety of use cases such as remote QA testing, game delivery to the press, and integration of 3D development streaming in an immersive environment. I am using it.
There is an important proposition in all cloud-based game production use cases. How does it keep a high frame rate (FPS) during streaming? It is that. This article describes the procedure for building a remote workstation on the AWS cloud so that it can be streamed at Streaming 60 FPS, and using QUIC UDP communication with NICE DCV. NICE DCV is a remote display protocol that enables secure and high performance delivery of remote desktop and application streaming.
Important point
Disclaimer The steps in this blog are for tutorials and early streaming proof of concept (PoC) purposes and are not a complete enterprise solution. Contact us to design the right architecture for your organization.
Prerequisites
Before starting this tutorial, the developer needs to prepare the following:
Quick Version — AWS CloudShell Automatic Workstation Script (10 minutes)
If you want to spin up your workstation using the command line and automation scripts to test your games and other software, check out the AWS CloudShell .sh file for a single script on AWS Samples GitHub. please. This script was created to support the same AMI used to demo NICE DCV on his QUIC UDP in this blog.
This AWS sample deploys with a small Infrastructure as Code (IaC). Users can deploy and log in to workstations with fewer commands by using his AWS CloudShell, a browser-based shell available directly from the AWS console. Both AWS Samples GitHub and the scripts used in this blog use the NICE DCV AMI, so you don't need to subscribe to the AWS Marketplace. However, you should raise your G4dn instance limits before proceeding with the quick version of AWS Sample or the step-by-step walkthrough presented in this blog.
Walkthrough (about 60 minutes)
Part 1: Server (Launch NICE DCV Server AMI)
Network settings (VPC, security group, route table)
1. Create a VPC. This demo uses us-east-1 (Northern Virginia) or other regions to create a 10.0.0.0/16 IPv4 CIDR block. The VPC name should nicedcv-quicudp-demo
.
2. Add an internet gateway and update the route of your VPC to include the internet gateway. 3. Attach the internet gateway to the nicedcv-quicudp-demo VPC.
4. Set the route to allow the public internet through the internet gateway.
5. Create a subnet. In this demo, we will use the / 24 subnet mask mask to create two subnets, one for the public subnet (10.0.1.0/24) and one for the private subnet (10.0.2.0/24). This allows you to use up to 255 IPs per subnet (251 excluding Amazon's own), leaving plenty of room for expansion into VPCs and subnets.
6. Select PublicSubnetA
. Select Modify auto-assign IP from Actions. On this screen, select the Enable auto-assign public IPv4 address check box. Launching an instance on this subnet will automatically set a public IPv4 address. Select Save.
This Workstation Network Security Best Practices Note This blog focuses on NICE DCV, so high availability of workstation architecture and fleet design for remote workstation networking are out of scope. We are here. However, we recommend that you logically separate remote workstations for each team. Network design protects access and sensitive information stored on workstation Amazon EBS volumes by limiting the network to a smaller CIDR block range while logically separating it using public and private subnets. You can control it more finely. Most workstations require the instance to be on a private subnet. However, in this blog, we'll add instances within public subnets to reduce complexity by adding private host zones, bastion hosts, NAT gateways, and skipping steps to handle routing between public and private subnets. It is running. However, IP restrictions are applied only to access from your own IP address.
7. Create a new security group for the demo. Then create two inbound rules. One creates Type as Custom UDP, Port range as 8443, and Source as My IP. The other is to create Type as Custom TCP, Port range as 8443, and Source as My IP. Now the instance is only allowed to access inbound traffic from your IP.
8. Leave the outbound rule with Type All Traffic and Destination set to 0.0.0.0/0. Then press the Create security group button to create a security group.
Spin up your workstation with the NICE DCV AMI
Now that you have the network set up, you are ready to create your first workstation.
1. Create a new key pair in the EC2 console. Used to generate a password to log in to a remote workstation.
Important! Save the .pem
file in a safe place. You can use this file to access your instance and get your Windows administrator password.
2. In the AWS Marketplace, go to the NICE DCV for Windows (G4dn and NVIDIA Gaming Driver) page and select Continue to Subscribe.
Note: If you don't want to use the AWS Marketplace AMI and want to manage the NVIDIA gaming driver installation yourself, you can also access it from NICE DCV and manually install his NICE DCV server on your instance. However, using the AWS Marketplace AMI will save you time.
3. Since DCV is an Amazon company, you don't need to subscribe to the marketplace list and it says Subscriptions are not required for this product.
. Select Continue to Configuration.
4. In this demo, 64-bit (x86) Amazon Machine Image (AMI), software version 2021.2 (September 9, 2021) and US East (N. Virginia) have already been validated. You will be charged per hour for the AMI, depending on the size of the g4dn you select. Select Continue to Launch.
5. You cannot configure storage settings in the AWS Marketplace. Most developers need a lot of storage on their workstation to install the software they need to develop and the games they want to test. On the Launch this software page, change to Launch from Website in the Choose Action dropdown.
6. Change the EC2 instance type to g4dn.4xlarge
. This will result in a 16 vCPU NVIDIA Tesla T4 GPU (16 GB) machine. In the VPC settings, change the VPC created earlier, the subnet setting to the public subnet, the security group setting to the demo security group, and the key pair to the demo key pair created earlier. Then select Launch.
This procedure launches an instance from the EC2 console.
Increase storage on Windows
In order to store all the games and applications you are trying to test on the G4dn using NICE DCV via QUIC UDP, you will need more C: drive capacity than the default setting. Let's change the volume used in the C: drive.
1. From the EC2 instance screen, go to the Storage tab. Therefore, select the volume ID whose device name is /dev/sda1
. Then you will see 30 GiB. 2. Select Modify Volume from Actions. Originally, it is best practice to create a snapshot before changing the volume size, but in the procedure of this blog, since we just created an instance, we will change the volume without creating a snapshot. .. Change the Size from 30 to 250 to get enough application space. Select Modify.
3. Confirm the contents on the Modify Volume Screen screen and select Yes. This step can take 10 to 20 minutes to perform the optimization, but you can move on to the next step without waiting for it to complete.
Get workstation password
When the instance initialization is complete and the EC2 console Status Check shows 2/2 and passed the check, you're ready to log in to your workstation.
1. Select an instance. Select Connect on your instance of the EC2 console. Then select RDP client.
Make a note of the public IP that is displayed. You will also need a password, so follow the steps below to get it.
2. Select Get Password to get the password. From your browser, upload the .pem
file for the key pair you created earlier. Then select Decrypt Password. Copy the combined password to a secure location.
Part 2: Client — Download DCV Viewer and log in to your workstation via QUIC UDP
1. Download the DCV client from https://www.nice-dcv.com/ for your environment. In this blog, I'm using version 2021.2 on a macOS (x86_64) client and I'm testing it on macOS Catalina 10.15.7 on a 2019 MacBook Pro.
2. Install and launch DCV Viewer on your local machine. In the DCV Viewer, select Connection Settings. Then select Protocol and make sure QUIC (with Datagram Extension) / UDP is selected in the dropdown. Make sure the TCP and UDP ports are set to 8443 and select Apply.
3. Return to the connection screen, enter the host's public IP, then enter Administrator, and then enter the password you obtained earlier using the key pair.
4. Select connect. You should see a Windows screen at the top of the NICE DCV Viewer window with a title that contains 8443.
5. Enter Disk Management
in the search. Select Okay when prompted to initialize the disc. Disk 0 is displayed as 250.00 GB. You can also see that Disk 1 is unallocated and is 209.55 GB.
6. Disk 1 storage must be allocated to create the D: drive. Right-click on Disk 1 and select New Simple Volume. Select Next in the wizard. Leave the default of 214574 and select Next again.
7. Leave the Assign the following drive letter D and select Next. Leave all the default settings and format as NTFS. Select Next, decide whether to keep the title “New Volume” or remove it, and select Finish. Now you can see the D: drive where you can store your games and applications. Right click and set to "Mark this partition as active".
8. On Windows, the volume looks like this:
Ultimately, the amount of space you need depends on the number of applications and games you run on your machine. The C: drive is an EBS volume that you can detach from the instance itself. In its current state, everything stored on the D: drive disappears when you terminate the instance.
Software installation and frame rate testing
Once you have successfully connected to your instance via QUIC UDP, you can install the software you need for development and game testing.
Some software in the cloud requires a license server or enterprise license agreement to manage a fleet of large workstations. In addition, software such as IDEs (Integrated Development Environments) and CI / CD solutions require additional storage separate from the workstation, or complete deployment within it to separate version control and build processes from the workstation. You may need an architecture that lets you. Finally, when deploying virtual machines for eSports events, developers need a machine that is as physically close to the end player as possible and must deliver with low latency. Your AWS account team can help you scale and design your workstation solution according to your software needs and use cases.
In this blog, we will use the workstation as a PC to test the game for remote QA usability testing scenarios, and before providing the workstation to employees performing remote QA, the ideal frame rate for this workstation. Make sure you get.
After connecting in Windows, go to Connection> Streaming Mode and make sure you are connected via QUIC UDP. The Streaming Mode window loads and the Streaming Mode (QUIC) is displayed. You will also use this window later to check the frame rate. I haven't done anything on the machine, so the FPS is displayed as 0. NICE DCV knows that there is no change in the pixels.
In the example in this blog, we will download and install Spellbreak, a free-to-play battle royale game developed by AWS customer Proletariat, on your C: drive. Spellbreak is a fun, action-packed spell slinger set in a fantasy world. The screenshot below shows a 2019 16-inch Mac Book Pro, 3072 x 1920 display resolution machine accessing an EC2 G4dn.4xlarge instance on us-east-1 from Atlanta with Spellbreak running up to 60 FPS. It shows how it is.
Frame rate note: Frame rates depend on network latency, changes in pixel density and activity on the screen, monitor resolution and size, and application strength. The NICE DCV codec balances these variables with bandwidth to provide the highest possible responsiveness.
If you are new to NICE DCV, you need to enable the camera's relative mouse position to support some games and engines. On a Mac, you can set it with Connection> Relative Mouse Position or by pressing Shift + Command + F8.
summary
This blog aims to explore the use cases of streaming games, including remote workstations, as well as to test the QA of end-user games and to demonstrate for the press using NICE DCV via QUIC UDP. Once you have the software installed and tested, you can scale your solution by creating an AMI.
If you need a workstation fleet, take a look at Amazon Nimble Studio, which allows you to create VFX, animations, and interactive content in your creative studio, and Amazon AppStream 2.0, a fully managed, non-persistent application and desktop streaming service. Both support integration with Amazon FSx for Windows File Server for persistent and scalable file storage. Both Amazon Nimble Studio and Amazon AppStream 2.0 are built on the NICE DCV codec, reducing the operational costs required to support large workstations. When considering building a fleet solution, developers should refer to the architecture for remote workstations and build farms for an engine-independent architecture. Contact your AWS account team to find the right workstation solution for your large enterprise fleet.
Today, many people use TCP connections for streaming use cases, but QUIC UDP performance points a new direction for streaming. As 3D development, games, and 3D applications are aggregated into an immersive experience that goes beyond local PCs, low-latency delivery of streaming over UDP must be completed within the headset for VR and XR headsets. It is an important foundation for the future of applications in immersive environments such as streaming games in. Check out the NICE DCV for Windows (g4dn with NVIDIA gaming driver) AMI now and experience this space.
The translation was done by Solution Architect Haruyama. The original text is here.