Hey there!

So, Microsoft has deprecated the RemoteFX adapter for Hyper-V, highly discouraging you from using a Virtual GPU with your VMs. The rumor is that there's some kind of security flaw with RemoteFX. That may be true, but as things stand right now, the only "approved" way to share a GPU with a VM is through Discrete Device Assignment, or DDA. Unfortunately, your hardware has to support DDA, and only a handful of rather new and expensive servers have that feature.
If you're trying to run a little home lab or even a small business server of some kind, that's probably not an option.

I don't know how long this will keep working, but here's how you can enable RemoteFX for now. Of course, do this at your own risk: It's not supported or recommended by Microsoft.

Enable "Remote Desktop Virtualization Host"

  1. Open Powershell (As Admin)
  2. Import-Module ServerManager
  3. Add-WindowsFeature RDS-Virtualization
  4. Reboot

Disable Licensing Manager 120-day nag screen

  1. Open Powershell (As Admin)
  2. $obj = gwmi -namespace “Root/CIMV2/TerminalServices” Win32_TerminalServiceSetting
  3. $obj.ChangeMode(2)
  4. $obj.SetSpecifiedLicenseServerList($env:computername)

Add RemoteFX GPU device to VM

  1. Add-VMRemoteFx3dVideoAdapter -VMName "NameOfYourVM"

Set Group Policy on Guest

When I attempted to connect to my guest using Remote Desktop, I got an error message that said "The graphics display components in the remote session failed to start up". Then the session would immediately close. I was ble to fix that with a Group Policy setting on the (Windows 10) Guest:

  1. Open Group Policy Editor (gpedit.msc)
  2. Navigate to:
    -> Computer Configuration
    -> Administrative Templates
    -> Windows Components
    -> Remote Desktop Services
    -> Remote Desktop Session Host
    -> Remote Session Environment
  3. Open setting: Use WDDM graphics display driver for Remote Desktop Connections
  4. Set it to "Disabled".
  5. Click Ok and reboot guest OS.

That's it!

Here's a pic of Device Manager from one of my Windows 10 VMs, after following the procedure above:

Of course, if anyone has a better way to use a GPU in Hyper-V, I'd love to hear about it!

References:
https://glennopedia.com/2016/04/07/how-to-properly-deploy-remote-desktop-services-in-a-workgroup/

https://aventistech.com/2018/12/27/deploy-windows-2019-rds-in-workgroup-without-ad/

https://docs.microsoft.com/en-us/powershell/module/hyper-v/add-vmremotefx3dvideoadapter?view=win10-ps