keylase / nvidia-patch

This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs.
3.49k stars 272 forks source link

Question: Remote Desktop NVENC sessions? #561

Open AlmightyJojo opened 2 years ago

AlmightyJojo commented 2 years ago

Hi,

Server 2022 RDS session server. GTX 1650 - Windows 10 516.93 Studio driver Patch tested with - https://github.com/keylase/nvidia-patch/wiki/Verify-NVENC-patch#windows

nvidia-smi.exe --query-gpu=encoder.stats.sessionCount --format=csv,noheader -i 0" Output = 4

RDP still appears to cap out at 3 sessions - 4th RDP client not accelerated. Any ideas? RDP utilizing NVENC in an alternative way to still hit 3 session cap?

Thanks for everyone's work on this NVENC project!

jailuthra commented 2 years ago

Hmm not sure, do you know if windows RDP server code is open source?

I'm guessing it has an extra condition somewhere, limiting to accelerate only 3 sessions and falling back to software encoding on 4th.

AlmightyJojo commented 2 years ago

Its closed source. Yeah it appears the NVENC is being called upon indirectly by RDSH server. I've seen it mentioned around that NVENC can be accessed directly or indirectly via DX12? Or other APIs?

What I do know is that the patch does appear to work. I've spun up 8 NVENC sessions simultaneously with ffmpeg. I've also used nvidia-smi.exe --query-gpu=encoder.stats.sessionCount --format=csv,noheader -i 0" ' after connecting each RDP session. It will increment 1,2,3 but then the forth RDP client the query output will still remain 3.

Dunno, if patch devs don't have any "Windows" suggestions I'll probably get this RDSH server a RTX A2000 card. It shows to have no arbitrary encoder restriction. https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new#Encoder

AlmightyJojo commented 2 years ago

https://enterprise-support.nvidia.com/s/article/Lower-2D-graphics-performance-on-Windows-Server-2019-when-compared-to-Windows-Server-2016

_When hardware acceleration is enabled on Windows Server 2016, RDP does not use NVIDIA hardware-based video encoder (NVENC). Use of NVENC was introduced with Windows Server 2019.

When NVENC is in use, the NVIDIA graphics driver uses the Copy engine and 3D graphics engine to preprocess the frames before submitting the frames to NVENC. The Passmark 2D graphics benchmark scores are lower on Windows Server 2019 because the GPU has the additional responsibility to encode the frames._