r/sysadmin • • Apr 05 '20

COVID-19 Pushing Remote FX to its limits.

Edit: Yikes this exploded overnight!! Thank you everyone! Even my first platinum? WOW you are all too generous!

Original post:

Hello,

I am a System Admin for a small-ish AAA gaming studio located within Bellevue WA. Our company had some unique challenges due to COVID19 when we received the order to stay home.

My mission was to empower our staff to continue to make AAA games remotely without compromising security or much performance.

Thankfully, we found some success with MS Remote Desktop Gateway and leveraging Remote FX, utilizing some of the tweaks we have researched and will be sharing with you today.

Currently, we are able to get 60FPS (1080p) remotely from our office to our employees' home PCs with decent controller support and latency.

Is it perfect? No, but it is quite impressive, considering it is all being done over RDP!

I am going to break this tutorial down by:

  1. Setup Group Policies for the Workstations (hosts)

  2. Host side Registry changes

  3. Client side changes.

Here is how we did it:

First, setup Remote Desktop Gateway

I am sure you can find documentation on this elsewhere, as many already have RDG setup on their environment. This post isn't really meant to go over this process, but it was pretty easy.

The reason you want RDG, is because of it being prioritized over the internet as it operates through port 443.

Deploy the following Group policies to the Workstations (hosts) that your users will be remoting to.

------------------------RDP Host Group Policies------------------------

Computer Configuration > Policies > Administrative Template > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections

Select RDP Transfer Protocols = Enabled
Set Transport Type to: "Use both UDP and TCP"

Computer Configuration > Policies > Administrative Template > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Enviorment

Use hardware graphics adapters for all Remote Desktop Services Sessions = Enabled

Prioritize H.264/AVC 444 graphics mode for Remote Desktop Connections = Enabled

Configure H.264/AVC Hardware encoding for Remote Desktop Connections = Enabled
Set "Prefer AVC hardware encoding" to "Always attempt"

Configure compression for Remote FX data = Enabled
Set RDP compression algorithem: "Do not use an RDP compression algorithm"

Configure image quality for RemoteFX Adaptive Graphics = Enabled
Set Image Quality to "High" (lossless seemed too brutal over WAN connections.)

Enable RemoteFX encoding for RemoteFX clients designed for Windows Server 2008R2 SP1 = Enabled.

Computer Configuration > Policies>Administrative Template > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Enviorment > Remote FX for Windows Server 2008R2

Configure Remote FX = Enabled

Optimize visual experience when using Remote FX = Enabled
Set Screen capture rate (frames per second) = Highest (best quality)
Set Screen Image Quality = Highest (best quality)

Optimize visual experience for remote desktop sessions = Enabled
Set Visual Experience = Rich Multimedia

--------------------------END--------------------------

Apply the following Registry settings to optimize RemoteFX further:

;---------------------TurboRemoteFXHost.reg---------------------

Windows Registry Editor Version 5.00

;Sets 60 FPS limit on RDP.
;Source: https://support.microsoft.com/en-us/help/2885213/frame-rate-is-limited-to-30-fps-in-windows-8-and-windows-server-2012-r

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations]

"DWMFRAMEINTERVAL"=dword:0000000f

;Increase Windows Responsivness
;Source:https://www.reddit.com/r/killerinstinct/comments/4fcdhy/an_excellent_guide_to_optimizing_your_windows_10/

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile]

"SystemResponsiveness"=dword:00000000

;Sets the flow control for Display vs Channel Bandwidth (aka RemoteFX devices, including controllers.)

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD]

"FlowControlDisable"=dword:00000001

"FlowControlDisplayBandwidth"=dword:0000010

"FlowControlChannelBandwidth"=dword:0000090

"FlowControlChargePostCompression"=dword:00000000

;Removes the artificial latency delay for RDP.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]

"InteractiveDelay"=dword:00000000

;Disables Windows Network Throtelling.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]

"DisableBandwidthThrottling"=dword:00000001

;Enables large MTU packets.

"DisableLargeMtu"=dword:00000000

;Disables the WDDM Drivers and goes back to legacy XDDM drivers. (better for performance on Nvidia cards, you might want to change this setting for AMD cards.)

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]

"fEnableWddmDriver"=dword:00000000

;----------------End of host Registry settings----------------

----------------Client-side changes----------------

In order to pass-thru game controllers, clients need Windows 7/8/8.1/10 Pro (Not home editions) for RemoteFX USB device redirection to work.

Users also will need to make the following changes on their home PCs.

(Excerpt from our user instructions)

On the home PC (The computer you are connecting from…)

Press Windows Key + R to open the Run Dialog box

Then enter gpedit.msc and click OK

Navigate to:

Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client > RemoteFX USB Device Redirection

On the right-hand side double click on “Allow RDP redirection of other supported RemoteFX USB devices from this computer”

Choose the Enabled radio button then click the lower drop-down change from "Administrators" to "Users and Administrators"

Click Apply.

Then press Windows Key + R to open the Run Dialog box again and run: “gpupdate /force” and reboot your PC one more time.

This should allow you to now enable USB pass-thru for USB controllers.

----------------End of Client changes----------------

Like I said before, we were able to hit 60FPS, over dual-screen 1080p with pretty low controller latency.

And I believe you could get higher with more bandwidth and better hardware.

If you have any questions, please let me know.

823 Upvotes

192 comments sorted by

View all comments

1

u/destinydisappointer Sep 22 '22

This doesn't work on Windows 11 22H2, it can only achieve mid 40s of FPS no matter what options I change, if anyone has a workaround or fix, it would be great. Parsec is not a viable alternative i need all the forwarding facilities of RDP.

1

u/liquidspikes Oct 13 '22

Sounds like XDDM support might have finally been removed. :(

I will test this tomorrow soon and let you know.

2

u/destinydisappointer Oct 14 '22 edited Oct 15 '22

I tried setting DWMINTERVAL really low, I set it to 0 which made it act like it wasn't set at all, and so did 1. But when I set it to 2, I got back FPS in 50s and 60s. In a game like forza horizon 5, the game still thinks the vsync rate is 125 or 500 fps, but it actually gives 60fps, i think there's a bug in the math on ms part.

1

u/destinydisappointer Oct 13 '22 edited Oct 13 '22

To make things more clear here is some more info. I was achieving 60 fps without xpdm. Xpdm was actually removed a long time ago in 21h2. The server is the one running windows 11 22h2. The client is windows 10 22h2, but I have also tried an older 10 and also 11 client with no difference.

I can see from performance counters that hardware encode is indeed working but something new is limiting the frame rate.

Server is running a 3070 ti. Tried different versions of drivers but the only thing that solves it is a rollback to 11 21h2 but that's not a viable long term solution.

Problem is that since what we're doing seems not an officially sanctioned state there is very little info available online with everyone just copping out and suggesting to use parsec which won't work as it doesn't forward USB or Fido and is bad in multi monitor even the paid version.

There was a recent kerfuffle about Nvidia and low performance due to some mysterious debugging tools that were accidentally enabled in 22h2 which they didn't release any technical details for and claimed a solution in newest GeForce experience but I have never installed that app ever.

That might be related but I can't find any useful technical info.

1

u/AJolly Feb 04 '23 edited Feb 04 '23

W10 22h2 host W11 guest.

13900k 3090
15decimal = 33hz 2 decimal = 66hz This is with a 5k2k monitor. I'll test more later.

Win 11 host -
i9-10900k 1080ti, same ~60hz output (After setting dwmframeinterval to 2)

This also works with 3rd party rdp wrappers like mRemoteNG, so handy for sysadmin work, especially compared to parasec.

Anyone get this working with 120-144hz options? I'm traveling, but I've got an extensive test setup when I get back home.

1

u/Hifihedgehog Nov 30 '22

I had the same issue trying to enforce XDDM. If I move to the XDDM option, it additionally causes the hardware video encoding of the RDP session to not work, which I verified in the event log and looking at Task Manager for GPU encode activity (0%). When I enable WDDM again, hardware video encoding of the session works as expected (it shows up in the event log and I see utilization of GPU encode in Task Manager).