Remote Desktop graphics performance

A common question asked by our customers is if graphics processing units (GPUs) really improve remote end-user experience in virtual desktop environments. The answer is yes, they do in many use cases and for both on-premises and cloud setups. One reason is that the Central Processing Unit (CPU) load on a remoting host can be reduced significantly by offloading graphics calculations used in many modern Windows applications to a GPU. Another reason is that GPUs can do video encoding and decoding much more efficient than any CPU. Simply said, offloading graphics calculations and video codecs to a GPU improves remote end-user experience. This article is an introduction into how GPUs work and why this is beneficial for remoting environments.

CPUs

First, it’s important to understand what a CPU does. A CPU is “in charge” of a computer system. It manages the system’s activities (like component communication, disk queue, and memory retrieval) and it executes instructions received from a computer program. Simply put, it:

  1. receives input from a program (or from memory)
  2. performs arithmetic and logical calculations on that data per the instructions given
  3. produces output, stores it back in memory or displays it on the screen

There are a lot of parts to a CPU and we won’t go into a deep dive here, but it’s important for the sake of understanding GPUs to be familiar with some CPU architecture. A CPU has a certain number of cores (units that process instructions at the same time). Each CPU core is made up of a control unit, some arithmetic logic units (ALUs), and some memory (cache for short term storage, DRAM for long term storage).

Remote Desktop graphics performance

The control unit retrieves data from memory. The ALU performs arithmetic and logical operations on the data, and the control unit moves the results back in to memory. The ALU is versatile in that it is capable of performing a large set of arithmetic and logical operations. On a multi-core processor, each core has a certain number of ALUs and each ALU can execute one calculation at a time. So, if a processor has 4 cores, with 8 ALUs per core, it can execute 32 instructions at one time.

GPUs

A GPU, on the other hand, is much more specialized – its sole job is to calculate the color of individual pixels in complex 2D or 3D scenes that are described by simple graphics objects, such as triangles, rectangles, circles, lines and fonts. The graphics chips you find on modern GPUs include hundreds or even thousands of very simple processing units called shaders (GPU manufacturers refer to shaders as “cores”, “CUDA cores”, or “Shader Processors (SPs)”). But unlike a multi-purpose CPU core, a GPU shader cannot execute code independently of other supporting components. Shaders are highly optimized for a fairly small set of graphics calculations they can do really fast and with very low energy consumption. Due to the number of shaders on board, the GPU is capable of processing a large amount of lightweight threads.

Remote Desktop graphics performance

The pixilation process of calculating and coloring individual pixels in complex 2D or 3D scenes is called rasterizing or rendering.

Remote Desktop graphics performance

The pixel color data is temporarily stored in a special graphics memory called the frame buffer. The frame buffer represents the physical pixels on one or more computer screens. As soon as the entire scene in the frame buffer is complete, a pixel stream of the rendered scene is sent to the screen.

Motion

To create the illusion of movement for the human eye, a frame is displayed on the screen and repeatedly replaced by a slightly advanced frame. Stitching collected frames together is the digital equivalent to the art of stop motion animation (think Wallace and Gromit “Claymation” movies).

Remote Desktop graphics performance

The same is true when dragging an application window (with graphic elements) across the screen.

Speed

Rendering in the past took a lot of time. At the time when the first Star Wars movie was produced, a computer-generated imagery (CGI) effect took hours, even days per frame. Now, rendering a CGI effect on a typical gaming PC can render these kinds of effects in real-time. The update frequency (in the frame buffer or) on the screen is measured in frames per second (FPS). The scene refresh cycle can range from once every couple of seconds to hundreds of times per second, depending on complexity and dynamic of the scene and depending on screen resolution. In general:

  • 24 or 30 FPS is used in the film industry
  • 30 to 60 FPS is regarded as good enough for most virtual desktop environments
  • 120 FPS is the sweet spot for gaming and virtual reality

GPU and CPU Work Together

So, the CPU chugs away, and when it gets some instructions pertaining to graphics, it acts as a broker, constantly offloading graphics calculations to hundreds or thousands of shaders on a dedicated GPU, which calculates pixel colors from graphics instructions in parallel. The faster that frames get rendered and output to the screen, the better the end-user experience.

GPU Benefits to Multi-user Environments

In a virtual desktop environment, the pixel stream doesn’t go to a physical monitor. Instead the pixel stream is encoded into a video stream and gets redirected to the remoting client. Most modern GPUs include helper units for video encode and decode (codec). This allows for effective hardware-accelerated encoding or decoding of MP4 videos using the H.264/H.265 family of algorithms, also known as MPEG-4 AVC (Advanced Video Coding).

This is not only beneficial when playing back videos on a Windows desktop, but also for encoding the remoting protocol data stream. All modern versions of remoting protocols are based on H.264 streams for the screen content redirection. A CPU can be saturated easily by high definition video streams. Multiuser environments benefit from the fact that the CPU can offload video encoding and graphics rendering to the GPU, reducing the CPU load massively and thereby giving user sessions additional CPU resources for other jobs. This can really enhance the remote end-user experience.

The Growing Necessity of GPUs

Applications built on top of graphics application programming interfaces (APIs) tell the shaders what to do. In today’s Windows world, DirectX and OpenGL are the most popular 3D graphics APIs. They were both designed to offload their graphics instructions to a graphics processor if an adequate graphics card and corresponding driver is present.

Computer games and CAD/CAM applications are common applications that use graphics APIs, but they are no longer the only ones – graphics API usage has become mainstream for thousands of Windows applications like the Window Manager (yes, the graphical shell), Microsoft Office, Internet Explorer and Google Chrome. This is why Windows performance is massively improved when a GPU is present. In addition, some DirectX and most OpenGL commands will simply not work if no physical GPU is present.

Summary

We have told you the way a CPU works, and how it can use a GPU as a helper to perform graphics specific tasks in tandem. You also know now that using a GPU can decrease the overall load on the CPU because it can render graphics efficiently and in tandem with the CPU. Finally, more and more mainstream business applications are using graphics APIs and taking advantage of a GPU if its present. All this shows that adding a GPU to a remoting host in many cases will improve end-user experience. And we contend that adding a GPU to virtual desktop environments will not be optional in the near future – for many use cases it will become mandatory.

Stay tuned for our next post where we will use the REX Analytics framework to demonstrate the benefits of GPUs in a remoting environment.

As enterprises move away from traditional full-stack VDI and trend towards deconstructed VDI, IT professionals are faced with new challenges when designing a solution that fits all their users’ needs and workflows.  

One of the most often over looked component is the display protocol, which is essential for delivering the performance your end users require and, ultimately, the success and user acceptance of your VDI initiative. After agonizing over CPUs and GPUs, IT professionals are often surprised to learn that their use case still requires them to purchase a high-performance display protocol from a third-party vendor, rather than simply using the display protocol included with their client OS.

Remote Desktop graphics performance

However, this may no longer be the case!  Advancements in RDP and RemoteFX now make them viable options for a variety of workloads, including graphics-intense workloads. Even better, with the GPU capabilities unique to Azure, they are a perfect pairing for enterprises or MSPs looking to leverage the public cloud for HPC.

What is RDP?

When we think of how our average Windows laptop connects to a virtual machine, we are most often thinking of RDP. RDP is the Microsoft remote desktop display protocol included in every version off Windows from XP onward. It was originally introduced by Microsoft as part of Terminal Services, available in Windows NT 4.0  Server. It was designed to allow user to remote in and control desktop over a network as well as allow multiple user logins to a single virtual machine session thereby maximizes resource utility and promoting user collaboration.

Later version of RDP offered support for local printers, USB redirection, improved bandwidth usage and support for 24-bit color and sounds. Remote Desktop Services was born!

RDP and DDA

The 2016 release of RDS includes an exciting new development for RDP – DDA! DDA stands for direct device assignment. That means that a physical graphics GPU can be assigned to a specific virtual machine. This means you can use the IHV graphics-driver to run a whole new variety of graphics-intense apps on virtual machine! Multiple sessions of either terminal servers or virtual machines can share the graphics-driver GPUs, increasing hardware utility while providing task workers with an “at desk” user experience in their desktop as well as their favorite apps.

What is RemoteFX?

While RDP is great for task workers, where performance often lacks is in the high-performance computing and graphics-intense space. To meet these computing demands, Microsoft offers RemoteFX. RemoteFX is essentially a dressed up version of RDP which provides an enhanced user experience. It is included in all version OS of Windows Sever 2008 R2 and onward.

RemoteFX is a layer on top of RDP that provides the host-side rendering, GPU virtualization, and intelligent screen capture for improved rendering and compression. However, because it is built on RDP, it offers the same key ingredients for a successful VDI deployment including shared encryption, authentication, management, and device support.

RemoteFX and OpenGL/OpenCL

The latest version of RemoteFX, included with Windows Sever 2016, includes support of Open GL 4.4. Open GL is the key ingredient for running graphics-intense programs such as Photoshop and CAD in a virtual environment. Previously, running a VM on Hyper-V limited the user to Open Gl 1.1 with CPU accelerations without support for OpenCL. This limited users delivering desktops with applications such as Photoshop, which relies on OpenCL for certain features. The latest version of RemoteFX includes enhancements in support for OpenGL and OpenCL, providing an “at-desk” experience for graphics-intense applications. 

Offering High-performance protocols doesn’t have to break the bank! With the latest advancements in RDP and RemoteFX, along with a wide variety of free and open source options – graphics-intense VDI has never been more affordable. Learn more by contacting [email protected]