規劃 Windows Server 中的 GPU 加速Plan for GPU acceleration in Windows Server

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

本文介紹 Windows Server 中可用的圖形虛擬化功能。This article introduces the graphics virtualization capabilities available in Windows Server.

使用 GPU 加速的時機When to use GPU acceleration

根據您的工作負載,您可能會想要考慮 GPU 加速。Depending on your workload, you may want to consider GPU acceleration. 選擇 GPU 加速之前,您應該考慮下列事項:Here's what you should consider before choosing GPU acceleration:

  • 應用程式與桌面遠端 (VDI/DaaS) 工作負載:如果您要使用 Windows Server 建立應用程式或桌面遠端服務,請考慮您希望使用者執行的應用程式目錄。App and desktop remoting (VDI/DaaS) workloads: If you're building an app or desktop remoting service with Windows Server, consider the catalogue of apps you expect your users to run. 某些類型的應用程式(例如 CAD/CAM 應用程式、模擬應用程式、遊戲和轉譯/視覺效果應用程式)主要依賴3D 轉譯來提供順暢且回應性的互動性。Some types of apps, such as CAD/CAM apps, simulation apps, games, and rendering/visualization apps, rely heavily on 3D rendering to deliver smooth and responsive interactivity. 大部分的客戶會考慮使用 Gpu,以提供這類應用程式合理的使用者體驗。Most customers consider GPUs a necessity for a reasonable user experience with these kinds of apps.
  • 遠端轉譯、編碼和視覺效果工作負載:這些以圖形為導向的工作負載通常會依賴 GPU 的特殊功能(例如有效率的3d 轉譯和幀編碼/解碼),以達成成本效益和輸送量目標。Remote rendering, encoding, and visualization workloads: These graphics-oriented workloads tend to rely heavily on a GPU's specialized capabilities, such as efficient 3D rendering and frame encoding/decoding, in order to achieve cost-effectiveness and throughput goals. 針對這類型的工作負載,已啟用 GPU 的單一 VM 可以符合許多僅限 CPU 的 Vm 的輸送量。For this kind of workload, a single GPU-enabled VM may be able to match the throughput of many CPU-only VMs.
  • HPC 和 ML 工作負載:針對高度資料平行計算工作負載(例如高效能計算和機器學習模型定型或推斷),gpu 可大幅縮短產生的時間、推斷的時間,以及定型時間。HPC and ML workloads: For highly data-parallel computational workloads, such as high-performance compute and machine learning model training or inference, GPUs can dramatically shorten time to result, time to inference, and training time. 或者,它們可能會比僅限 CPU 的架構提供更佳的成本效益,以符合效能等級。Alternatively, they may offer better cost-effectiveness than a CPU-only architecture at a comparable performance level. 許多 HPC 和機器學習架構都有啟用 GPU 加速的選項;請考慮這是否可讓您的特定工作負載受益。Many HPC and machine learning frameworks have an option to enable GPU acceleration; consider whether this might benefit your specific workload.

Windows Server 中的 GPU 虛擬化GPU virtualization in Windows Server

GPU 虛擬化技術在虛擬化環境中啟用 GPU 加速,通常是在虛擬機器中。GPU virtualization technologies enable GPU acceleration in a virtualized environment, typically within virtual machines. 如果您的工作負載是使用 Hyper-v 進行虛擬化,則您必須採用圖形虛擬化,才能提供從實體 GPU 到虛擬化應用程式或服務的 GPU 加速。If your workload is virtualized with Hyper-V, then you'll need to employ graphics virtualization in order to provide GPU acceleration from the physical GPU to your virtualized apps or services. 但是,如果您的工作負載直接在實體 Windows Server 主機上執行,您就不需要進行圖形虛擬化;您的應用程式和服務已經有 Windows Server 原生支援的 GPU 功能和 Api 的存取權。However, if your workload runs directly on physical Windows Server hosts, then you have no need for graphics virtualization; your apps and services already have access to the GPU capabilities and APIs natively supported in Windows Server.

下列圖形虛擬化技術適用于 Windows Server 中的 Hyper-v Vm:The following graphics virtualization technologies are available to Hyper-V VMs in Windows Server:

除了 VM 工作負載,Windows Server 也支援在 Windows 容器內的容器化工作負載的 GPU 加速。In addition to VM workloads, Windows Server also supports GPU acceleration of containerized workloads within Windows Containers. 如需詳細資訊,請參閱 Windows 容器中的 GPU 加速For more information, see GPU Acceleration in Windows containers.

離散裝置指派 (DDA) Discrete Device Assignment (DDA)

離散裝置指派 (DDA) (也稱為 GPU 傳遞)可讓您將一或多個實體 Gpu 專用於虛擬機器。Discrete Device Assignment (DDA), also known as GPU pass-through, allows you to dedicate one or more physical GPUs to a virtual machine. 在 DDA 部署中,虛擬化工作負載是在原生驅動程式上執行,而且通常具有 GPU 功能的完整存取權。In a DDA deployment, virtualized workloads run on the native driver and typically have full access to the GPU's functionality. DDA 提供最高層級的應用程式相容性和可能的效能。DDA offers the highest level of app compatibility and potential performance. DDA 也可以提供 GPU 加速給 Linux Vm (受支援)。DDA can also provide GPU acceleration to Linux VMs, subject to support.

因為每個實體 GPU 最多可提供最多一部 VM 的最小值,所以 DDA 部署只可加速有限數量的虛擬機器。A DDA deployment can accelerate only a limited number of virtual machines, since each physical GPU can provide acceleration to at most one VM. 如果您要開發的服務的架構支援共用虛擬機器,請考慮為每個 VM 裝載多個加速工作負載。If you're developing a service whose architecture supports shared virtual machines, consider hosting multiple accelerated workloads per VM. 例如,如果您要使用 RDS 建立桌面遠端服務,您可以利用 Windows Server 的多會話功能,在每部 VM 上裝載多個使用者桌面,以改善使用者規模。For example, if you're building a desktop remoting service with RDS, you can improve user scale by leveraging the multi-session capabilities of Windows Server to host multiple user desktops on each VM. 這些使用者將會分享 GPU 加速的優點。These users will share the benefits of GPU acceleration.

如需詳細資訊,請參閱下列主題:For more information, see these topics:

RemoteFX vGPURemoteFX vGPU

注意

基於安全性考量,自 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。RemoteFX vGPU is a graphics virtualization technology that allows a single physical GPU to be shared among multiple virtual machines. 在 RemoteFX vGPU 部署中,虛擬化工作負載會在 Microsoft 的 RemoteFX 3D 介面卡上執行,以協調主機與來賓之間的 GPU 處理要求。In a RemoteFX vGPU deployment, virtualized workloads run on Microsoft's RemoteFX 3D adapter, which coordinates GPU processing requests between the host and guests. RemoteFX vGPU 最適用于不需要專用 GPU 資源的知識工作者和高高載工作負載。RemoteFX vGPU is most suitable for knowledge worker and high-burst workloads where dedicated GPU resources are not required. RemoteFX vGPU 只能提供 GPU 加速給 Windows Vm。RemoteFX vGPU can only provide GPU acceleration to Windows VMs.

如需詳細資訊,請參閱下列主題:For more information, see these topics:

比較 DDA 和 RemoteFX vGPUComparing DDA and RemoteFX vGPU

規劃您的部署時,請考慮下列功能,並支援圖形虛擬化技術之間的差異:Consider the following functionality and support differences between graphics virtualization technologies when planning your deployment:

描述Description RemoteFX vGPURemoteFX vGPU 離散裝置指派Discrete Device Assignment
GPU 資源模型GPU resource model 專用或共用Dedicated or shared 專用Dedicated only
VM 密度VM density 高 (一或多個 Gpu 至多個 Vm) High (one or more GPUs to many VMs) 低 (一或多個 Gpu 至一部 VM) Low (one or more GPUs to one VM)
應用程式相容性App compatibility DX 11.1、OpenGL 4.4、OpenCL 1.1DX 11.1, OpenGL 4.4, OpenCL 1.1 廠商提供的所有 GPU 功能 (DX 12、OpenGL、CUDA)All GPU capabilities provided by vendor (DX 12, OpenGL, CUDA)
AVC444AVC444 預設已啟用Enabled by default 可透過群組原則Available through Group Policy
GPU VRAMGPU VRAM 最多 1 GB 專用 VRAMUp to 1 GB dedicated VRAM 最多 GPU 支援的 VRAMUp to VRAM supported by the GPU
畫面播放速率Frame rate 最多 30 fpsUp to 30fps 最多 60 fpsUp to 60fps
客體中的 GPU 驅動程式GPU driver in guest RemoteFX 3D 介面卡顯示器驅動程式 (Microsoft)RemoteFX 3D adapter display driver (Microsoft) (NVIDIA、AMD、Intel) 的 GPU 廠商驅動程式GPU vendor driver (NVIDIA, AMD, Intel)
主機作業系統支援Host OS support Windows Server 2016Windows Server 2016 Windows Server 2016;Windows Server 2019Windows Server 2016; Windows Server 2019
客體 OS 支援Guest OS support Windows Server 2012 R2;Windows Server 2016;Windows 7 SP1;Windows 8.1;Windows 10Windows Server 2012 R2; Windows Server 2016; Windows 7 SP1; Windows 8.1; Windows 10 Windows Server 2012 R2;Windows Server 2016;Windows Server 2019;Windows 10;LinuxWindows Server 2012 R2; Windows Server 2016; Windows Server 2019; Windows 10; Linux
HypervisorHypervisor Microsoft Hyper-VMicrosoft Hyper-V Microsoft Hyper-VMicrosoft Hyper-V
GPU 硬體GPU hardware 企業 GPU (例如 Nvidia Quadro/GRID 或 AMD FirePro)Enterprise GPUs (such as Nvidia Quadro/GRID or AMD FirePro) 企業 GPU (例如 Nvidia Quadro/GRID 或 AMD FirePro)Enterprise GPUs (such as Nvidia Quadro/GRID or AMD FirePro)
伺服器硬體Server hardware 沒有特殊需求No special requirements 新式伺服器,會將 IOMMU 公開至 OS (通常為 SR-IOV 相容硬體)Modern server, exposes IOMMU to OS (usually SR-IOV compliant hardware)