使用 RemoteFX vGPU 部署图形设备Deploy graphics devices using RemoteFX vGPU

适用于: Windows Server 2016、Microsoft Hyper-V Server 2016Applies to: Windows Server 2016, Microsoft Hyper-V Server 2016

备注

出于安全方面的考虑,从 2020 年 7 月 14 日的安全更新开始,所有版本的 Windows 都会默认禁用 RemoteFX vGPU。Because of security concerns, RemoteFX vGPU is disabled by default on all versions of Windows starting with the July 14, 2020 Security Update. 要了解详细信息,请参阅 KB 4570006To learn more, see KB 4570006.

使用 RemoteFX 的 vGPU 功能可以让多个虚拟机共享物理 GPU。The vGPU feature for RemoteFX makes it possible for multiple virtual machines to share a physical GPU. 呈现和计算资源在虚拟机之间动态共享,这使得 RemoteFX vGPU 适用于不需要专用 GPU 资源的高突发负载。Rendering and compute resources are shared dynamically among virtual machines, making RemoteFX vGPU appropriate for high-burst workloads where dedicated GPU resources are not required. 例如,在 VDI 服务中,可以使用 RemoteFX vGPU 将应用呈现成本卸载到 GPU,同时降低 CPU 负载并提高服务可伸缩性。For example, in a VDI service, RemoteFX vGPU can be used to offload app rendering costs to the GPU, with the effect of decreasing CPU load and improving service scalability.

RemoteFX vGPU 要求RemoteFX vGPU requirements

主机系统要求:Host system requirements:

  • Windows Server 2016Windows Server 2016
  • 与 WDDM 1.2 兼容的驱动程序的 DirectX 11.0 兼容 GPUA DirectX 11.0-compatible GPU with a WDDM 1.2-compatible driver
  • 具有第二级地址转换 (SLAT) 支持的 CPUA CPU with Second Level Address Translation (SLAT) support

来宾 VM 要求:Guest VM requirements:

来宾 VM 的其他注意事项:Additional considerations for guest VMs:

  • OpenGL 和 OpenCL 功能仅适用于运行 Windows 10 或 Windows Server 2016 的来宾。OpenGL and OpenCL functionality is only available in guests running Windows 10 or Windows Server 2016.
  • DirectX 11.0 仅适用于运行 Windows 8 或更高版本的来宾。DirectX 11.0 is only available for guests running Windows 8 or later.

启用 RemoteFX vGPUEnable RemoteFX vGPU

在 Windows Server 2016 主机上配置 RemoteFX vGPU:To configure RemoteFX vGPU on your Windows Server 2016 host:

  1. 安装适用于 Windows Server 2016 的 GPU 供应商建议的图形驱动程序。Install the graphics drivers recommended by your GPU vendor for Windows Server 2016.
  2. 创建运行 RemoteFX vGPU 支持的来宾操作系统的虚拟机。Create a VM running a guest OS supported by RemoteFX vGPU. 若要了解详细信息,请参阅RemoteFX 3D 视频适配器 (vGPU) 支持To learn more, see RemoteFX 3D Video Adapter (vGPU) support.
  3. 将 RemoteFX 3D 图形适配器添加到 VM。Add the RemoteFX 3D graphics adapter to the VM. 若要了解详细信息,请参阅配置 RemoteFX VGPU 3d 适配器To learn more, see Configure the RemoteFX vGPU 3D adapter.

默认情况下,RemoteFX vGPU 将使用所有可用且受支持的 Gpu。By default, RemoteFX vGPU will use all available and supported GPUs. 若要限制 RemoteFX vGPU 使用的 Gpu,请遵循以下步骤:To limit which GPUs the RemoteFX vGPU uses, follow these steps:

  1. 导航到 Hyp​​er-V 管理器中的 Hyper-V 设置。Navigate to the Hyper-V settings in Hyper-V Manager.
  2. 选择 "Hyper-v 设置" 中的物理 gpuSelect Physical GPUs in Hyper-V Settings.
  3. 选择不想使用的 GPU,然后清除“将此 GPU 用于 RemoteFX”****。Select the GPU that you don't want to use, and then clear Use this GPU with RemoteFX.

配置 RemoteFX vGPU 3D 适配器Configure the RemoteFX vGPU 3D adapter

可以使用 Hyper-V 管理器 UI 或 PowerShell cmdlet 来配置 RemoteFX vGPU 3D 图形适配器。You can use either the Hyper-V Manager UI or PowerShell cmdlets to configure the RemoteFX vGPU 3D graphics adapter.

通过 Hyper-v 管理器配置 RemoteFX vGPUConfigure RemoteFX vGPU with Hyper-V Manager

  1. 如果 VM 当前正在运行,请停止它。Stop the VM if it's currently running.

  2. 打开 "Hyper-v 管理器",导航到 " VM 设置",然后选择 "添加硬件"。Open Hyper-V Manager, navigate to VM Settings, then select Add Hardware.

  3. 选择 " RemoteFX 3D 图形适配器",然后选择 "添加"。Select RemoteFX 3D Graphics Adapter, then select Add.

  4. 设置最大监视器数、最大监视器分辨率和专用视频内存,或保留默认值。Set the maximum number of monitors, maximum monitor resolution, and dedicated video memory, or leave the default values.

    备注

    • 为这些选项中的任何一个设置较高的值会影响服务规模,因此,只需设置所需的值。Setting higher values for any of these options will impact your service scale, so you should only set what is necessary.
    • 如果需要使用 1 GB 专用 VRAM,请使用64位来宾 VM,而不是32位 (x86) 以获得最佳结果。When you need to use 1 GB of dedicated VRAM, use a 64-bit guest VM instead of 32-bit (x86) for best results.
  5. 选择 "确定" 完成配置。Select OK to finish the configuration.

通过 PowerShell cmdlet 配置 RemoteFX vGPUConfigure RemoteFX vGPU with PowerShell cmdlets

使用以下 PowerShell cmdlet 来添加、查看和配置适配器:Use the following PowerShell cmdlets to add, review, and configure the adapter:

监视性能Monitor performance

支持 RemoteFX vGPU 的服务的性能和规模由各种因素决定,如系统上的 Gpu 数、总的 GPU 内存、系统内存和内存速度、CPU 内核数和 CPU 时钟频率、存储速度和 NUMA 实现。The performance and scale of a RemoteFX vGPU-enabled service are determined by a variety of factors such as number of GPUs on your system, total GPU memory, amount of system memory and memory speed, number of CPU cores and CPU clock frequency, storage speed, and NUMA implementation.

主机系统内存Host system memory

对于使用 vGPU 启用的每个 VM,RemoteFX 在来宾操作系统和主机服务器中都使用系统内存。For every VM enabled with a vGPU, RemoteFX uses system memory both in the guest operating system and in the host server. 虚拟机监控程序保证来宾操作系统的系统内存可用性。The hypervisor guarantees the availability of system memory for a guest operating system. 在主机上,每个启用了 vGPU 的虚拟桌面都需要将其系统内存要求播发到虚拟机监控程序。On the host, each vGPU-enabled virtual desktop needs to advertise its system memory requirement to the hypervisor. 当启用了 vGPU 的虚拟机启动时,虚拟机监控程序会在主机中保留额外的系统内存。When the vGPU-enabled virtual desktop starts, the hypervisor reserves additional system memory in the host.

启用 RemoteFX 的服务器的内存要求是动态的,因为启用了 RemoteFX 的服务器上使用的内存量取决于与启用了 vGPU 的虚拟机关联的监视器数量,以及这些监视器的最大分辨率。The memory requirement for the RemoteFX-enabled server is dynamic because the amount of memory consumed on the RemoteFX-enabled server is dependent on the number of monitors that are associated with the vGPU-enabled virtual desktops and the maximum resolution for those monitors.

主机 GPU 视频内存Host GPU video memory

每个启用了 vGPU 的虚拟桌面都使用主机服务器上的 GPU 硬件视频内存来呈现桌面。Every vGPU-enabled virtual desktop uses the GPU hardware video memory on the host server to render the desktop. 此外,编解码器使用视频内存来压缩呈现的屏幕。In addition, a codec uses the video memory to compress the rendered screen. 呈现和压缩所需的内存量直接基于预配到虚拟机的监视器数量。The amount of memory needed for rendering and compression is directly based on the number of monitors provisioned to the virtual machine. 保留的视频内存量因系统屏幕分辨率和监视器数量而异。The amount of reserved video memory varies based on the system screen resolution and how many monitors there are. 某些用户需要较高的屏幕分辨率来执行特定任务,但如果所有其他设置保持不变,则分辨率设置的伸缩性将更高。Some users require a higher screen resolution for specific tasks, but there's greater scalability with lower resolution settings if all other settings remain constant.

主机 CPUHost CPU

虚拟机监控程序计划 CPU 上的主机和 Vm。The hypervisor schedules the host and VMs on the CPU. 启用 RemoteFX 的主机上的开销会增加,因为系统会对每个启用了 vGPU 的虚拟机 ( # A0) 。The overhead is increased on a RemoteFX-enabled host because the system runs an additional process (rdvgm.exe) per vGPU-enabled virtual desktop. 此过程使用图形设备驱动程序在 GPU 上运行命令。This process uses the graphics device driver to run commands on the GPU. 编解码器还使用 CPU 压缩需要发送回客户端的屏幕数据。The codec also uses the CPU to compress screen data that needs to be sent back to the client.

更多虚拟处理器意味着更好的用户体验。More virtual processors mean a better user experience. 建议为每个启用了 vGPU 的虚拟机分配至少两个虚拟 Cpu。We recommend allocating at least two virtual CPUs per vGPU-enabled virtual desktop. 我们还建议为启用了 vGPU 的虚拟桌面使用 x64 体系结构,因为与 x86 虚拟机相比,x64 虚拟机上的性能更好。We also recommend using the x64 architecture for vGPU-enabled virtual desktops because the performance on x64 virtual machines is better compared to x86 virtual machines.

GPU 处理能力GPU processing power

每个启用了 vGPU 的虚拟桌面都有一个在主机服务器上运行的相应 DirectX 进程。Every vGPU-enabled virtual desktop has a corresponding DirectX process that runs on the host server. 此过程会将其从 RemoteFX 虚拟桌面接收的所有图形命令重播到物理 GPU。This process replays all graphics commands it receives from the RemoteFX virtual desktop onto the physical GPU. 这就像在同一物理 GPU 上同时运行多个 DirectX 应用程序。This is like running multiple DirectX applications at the same time on the same physical GPU.

通常,图形设备和驱动程序会经过优化,以便一次只在桌面上运行几个应用程序,而 RemoteFX 会拉伸 Gpu 以进一步进行。Usually, graphics devices and drivers are tuned to run only a few applications on the desktop at a time, but RemoteFX stretches the GPUs to go even further. vGPUs 附带了性能计数器,用于测量 RemoteFX 请求的 GPU 响应,并有助于确保 Gpu 不会延伸到太远。vGPUs come with performance counters that measure the GPU response to RemoteFX requests and help you make sure the GPUs aren't stretched too far.

当 GPU 资源不足时,读取和写入操作需要很长时间才能完成。When a GPU is low on resources, read and write operations take a long time to complete. 管理员可以使用性能计数器来了解何时调整资源并防止用户停机。Administrators can use performance counters to know when to adjust resources and prevent downtime for users.

详细了解在远程桌面诊断图形性能问题时用于监视 RemoteFX vGPU 行为的性能计数器。Learn more about performance counters for monitoring RemoteFX vGPU behavior at Diagnose graphics performance issues in Remote Desktop.