使用 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 支援之客體作業系統的 VM。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. 瀏覽至 Hyper-V 管理員中的 Hyper-V 設定。Navigate to the Hyper-V settings in Hyper-V Manager.
  2. 選取 [Hyper-v 設定] 中的 [實體 gpu ]。Select Physical GPUs in Hyper-V Settings.
  3. 選取您不想要使用的 GPU,然後清除 [使用含有 RemoteFX 的這個 GPU]****。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

虛擬程式會將主機和 Vm 排定在 CPU 上。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. 我們也建議將 x64 架構用於已啟用 vGPU 的虛擬桌面,因為與 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.