Edit

Share via


Enable GPU acceleration for Azure Virtual Desktop

Azure Virtual Desktop supports graphics processing unit (GPU) acceleration in rendering and encoding for improved app performance and scalability using the Remote Desktop Protocol (RDP). GPU acceleration is crucial for graphics-intensive applications, such as those used by graphic designers, video editors, 3D modelers, data analysts, or visualization specialists.

There are three components to GPU acceleration in Azure Virtual Desktop that work together to improve the user experience:

  • GPU-accelerated application rendering: Use the GPU to render graphics in a remote session.

  • GPU-accelerated remote frame encoding: The Remote Desktop Protocol encodes all graphics rendered for transmission to the local device. GPU-accelerated remote frame encoding uses the GPU to encode the rendered graphics frames to provide higher frame rates and better user experiences, although this feature may consume more network bandwidth and both session host and client resources. This benefits applications such as 3D modeling, CAD/CAM, or video playback and editing. You can choose to encode with:

    • AVC/H.264
    • Hight Efficiency Video Coding (HEVC), also known as H.265. This allows for 25-50% better data compression compared to AVC/H.264, at the same video quality or improved quality at the same bitrate.

Note

  • If you enable both HEVC/H.265 and AVC/H.264 hardware acceleration, but the HEVC/H.265 codec isn't available on the local device or your environment does not meet the prerequisites for HEVC/H.265, AVC/H.264 is used instead.

  • You can enable full-screen video encoding with AVC/H.264 even without GPU acceleration, but HEVC/H.265 requires a compatible GPU-enabled remote virtual machine.

  • You can also increase the default chroma value to improve the image quality.

This article shows you which Azure VM sizes you can use as a session host with GPU acceleration, and how to enable GPU acceleration for rendering and encoding.

Supported GPU-optimized Azure VM sizes

The following table lists which Azure VM sizes are optimized for GPU acceleration and supported as session hosts in Azure Virtual Desktop:

Azure VM size GPU-accelerated application rendering GPU-accelerated remote frame encoding
NVv3-series Supported HEVC/H.265
AVC/H.264
NVv4-series Supported AVC/H.264
NVadsA10 v5-series Supported HEVC/H.265
AVC/H.264
NCasT4_v3-series Supported HEVC/H.265
AVC/H.264

The right choice of VM size depends on many factors, including your particular application workloads, desired quality of user experience, and cost. In general, larger and more capable GPUs offer a better user experience at a given user density. Smaller and fractional GPU sizes allow more fine-grained control over cost and quality.

VM sizes with an NVIDIA GPU come with a GRID license that supports 25 concurrent users.

Important

Azure NC, NCv2, NCv3, ND, and NDv2 series VMs aren't generally appropriate as session hosts. These VM sizes are tailored for specialized, high-performance compute or machine learning tools, such as those built with NVIDIA CUDA. They don't support GPU acceleration for most applications or the Windows user interface.

Prerequisites

Before you can enable GPU acceleration, you need:

  • An existing host pool with session hosts using a supported GPU-optimized Azure VM size for the graphics features you want to enable. Supported graphics drivers are listed in Install supported graphics drivers in your session hosts.

  • To configure Microsoft Intune, you need:

    • Microsoft Entra ID account that is assigned the Policy and Profile manager built-in RBAC role.
    • A group containing the devices you want to configure.
  • To configure Group Policy, you need:

    • A ___domain account that has permission to create or edit Group Policy objects.
    • A security group or organizational unit (OU) containing the devices you want to configure.

In addition, for HEVC/H.265 hardware acceleration you also need:

  • Session hosts must be running Windows 10 or Windows 11.

  • A desktop application group. RemoteApp isn't supported.

  • If you increased the chroma value to 4:4:4, the chroma value falls back to 4:2:0 when using HEVC hardware acceleration.

  • Disable multimedia redirection on your session hosts by uninstalling the host component.

  • The Administrative template for Azure Virtual Desktop available in Group Policy to configure your session hosts.

  • A local Windows device you use to connect to a remote session must have:

    • A GPU that has HEVC (H.265) 4K YUV 4:2:0 decode support. For more information, see the manufacturer's documentation. Here are some links to documentation for some manufacturers:

    • Microsoft HEVC codec installed. This can be obtained 1 of 3 ways:

      • The Microsoft HEVC codec is included in new installations of Windows 11 22H2 or later.
      • You can purchase the Microsoft HEVC codec from the Microsoft Store.
      • If you are using Windows App version 2.0.503.0 or later and don't already have the Microsoft HEVC codec installed, the app attempts to install a specialized version of the HEVC codec compatible only with remote sessions initiated through Windows App. Note that this method requires access to the Microsoft Store.
    • One of the following apps to connect to a remote session. Other platforms and versions aren't supported.

      • Windows App on Windows, version 2.0.503.0 or later.
      • Remote Desktop app on Windows, version 1.2.6081 or later.

Install supported graphics drivers in your session hosts

To take advantage of the GPU capabilities of Azure N-series VMs in Azure Virtual Desktop, you must install the appropriate graphics drivers. Follow the instructions at Supported operating systems and drivers to learn how to install drivers.

Important

Only Azure-distributed drivers are supported.

When installing drivers, here are some important guidelines:

  • For VMs sizes with an NVIDIA GPU, only NVIDIA GRID drivers support GPU acceleration for most applications and the Windows user interface. NVIDIA CUDA drivers don't support GPU acceleration for these VM sizes. To download and learn how to install the driver, see Install NVIDIA GPU drivers on N-series VMs running Windows and be sure to install the GRID driver. If you install the driver by using the NVIDIA GPU Driver Extension, the GRID driver is automatically installed for these VM sizes.

    • For HEVC/H.265 hardware acceleration, you must use NVIDIA GPU driver GRID 16.2 (537.13) or later.
  • For VMs sizes with an AMD GPU, install the AMD drivers that Azure provides. To download and learn how to install the driver, see Install AMD GPU drivers on N-series VMs running Windows.

Enable GPU-accelerated application rendering and remote frame encoding

By default, Azure Virtual Desktop remote sessions are rendered with the CPU and don't use available GPUs. You can enable GPU-accelerated application rendering, and remote frame encoding using Microsoft Intune or Group Policy.

Important

If settings for GPU-acceleration using both H.264/AVC and H.265/HEVC are enabled, H.265/HEVC is prioritized for compatible remote sessions.

Select the relevant tab for your scenario.

To enable GPU-accelerated application rendering using Intune:

  1. Sign in to the Microsoft Intune admin center.

  2. Create or edit a configuration profile for Windows 10 and later devices, with the Settings catalog profile type.

  3. In the settings picker, browse to Administrative templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment.

    A screenshot showing the redirection options in the Microsoft Intune portal.

  4. Select the following settings:

    1. For GPU-accelerated application rendering, check the box for Use hardware graphics adapters for all Remote Desktop Services sessions.

    2. For GPU-accelerated remote frame encoding using H.264/AVC:

      1. Check the box for Prioritize H.264/AVC 444 Graphics mode for Remote Desktop connections.
      2. Check the box for Configure H.264/AVC hardware encoding for Remote Desktop connections.

    Note

    Checking the box to Prioritize H.264 Graphics mode without checking the box to Configure hardware encoding can result in software/CPU-based H.264/AVC full-screen video encoding.

  5. For GPU-accelerated remote frame encoding using H.265/HEVC, browse to Administrative templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Azure Virtual Desktop in the settings picker.

  6. To enable GPU-accelerated remote frame encoding using H.265/HEVC Check the box for Configure H.265/HEVC hardware encoding for Remote Desktop Connections, then close the settings picker.

  7. Expand the Administrative templates category, then set toggle the switch for each setting as follows:

    1. For GPU-accelerated application rendering, set Use hardware graphics adapters for all Remote Desktop Services sessions to Enabled.

    2. For GPU-accelerated remote frame encoding using H.264/AVC, set Configure H.264/AVC hardware encoding for Remote Desktop connections to Enabled.

    3. For full-screen video encoding, set Prioritize H.264/AVC 444 Graphics mode for Remote Desktop connections to Enabled.

    4. For GPU-accelerated remote frame encoding using H.265/HEVC set Configure H.265/HEVC hardware encoding for Remote Desktop Connections to Enabled.

  8. Select Next.

  9. Optional: On the Scope tags tab, select a scope tag to filter the profile. For more information about scope tags, see Use role-based access control (RBAC) and scope tags for distributed IT.

  10. On the Assignments tab, select the group containing the computers providing a remote session you want to configure, then select Next.

  11. On the Review + create tab, review the settings, then select Create.

  12. After the policy applies to the computers providing a remote session, restart them for the settings to take effect.

Verify GPU acceleration

To verify that a remote session is using GPU acceleration, GPU-accelerated application rendering, frame encoding, or full-screen video encoding:

  1. If you want to verify HEVC/H.265 hardware acceleration, complete the following extra steps:

    1. Make sure the local Windows device has the Microsoft HEVC codec installed by opening a PowerShell prompt and run the following command:

      Get-AppxPackage -Name "Microsoft.HEVCVideoExtension" | FT Name, Version
      

      The output should be similar to the following output:

      Name                         Version
      ----                         -------
      Microsoft.HEVCVideoExtension 2.1.1161.0
      
    2. Make sure multimedia redirection is disabled on the session host if you're using it.

  2. Connect to one of the session hosts you configured, either through Azure Virtual Desktop or a direct RDP connection.

  3. Open an application that uses GPU acceleration and generate some load for the GPU.

  4. Open Task Manager and go to the Performance tab. Select the GPU to see whether the GPU is being utilized by the application.

    A screenshot showing the GPU usage in Task Manager when in a Remote Desktop session.

    Tip

    For NVIDIA GPUs, you can also use the nvidia-smi utility to check for GPU utilization when running your application. For more information, see Verify driver installation.

  5. To verify GPU-accelerated full-screen encoding using HEVC/H.265 you can open the Connection Information window from your session.

    1. If your session is in full-screen mode, select the signal strength icon in the RDP connection bar at the top of your session window. If your session is in windowed mode, right-click on the top of the window and select Connection Information from the context menu.

    2. Select "See details" to expand the window with additional information. If you see Codecs Used: HEVC under Graphics details, then GPU-accelerated frame encoding with HEVC/H.265 and full-screen video encoding is in use.

  6. You can use Event Viewer to verify GPU acceleration with either AVC/H.264 or HEVC/H.265. To do so, open Event Viewer from the Start menu, or run eventvwr.msc from the command line.

  7. Navigate to one of the following locations:

    1. For connections through Azure Virtual Desktop, go to Applications and Services Logs > Microsoft > Windows > RemoteDesktopServices-RdpCoreCDV > Operational.

    2. For connections through a direct RDP connection, go to Applications and Services Logs > Microsoft > Windows > RemoteDesktopServices-RdpCoreTs > Operational.

  8. Look for the following event IDs:

    • Event ID 170: If you see AVC hardware encoder enabled: 1 in the event text, GPU-accelerated frame encoding is in use.

    • Event ID 162:

      • If you see Avc444FullScreenProfile in the event text, GPU-accelerated frame encoding with AVC/H.264 and full-screen video encoding is in use.
      • If you see HevcProfile in the event text, GPU-accelerated frame encoding with HEVC/H.265 and full-screen video encoding is in use.

Increase the default chroma value to improve the image quality.