How do I get NVIDIA GPU support in Hyper-V virtual machine?

Make sure the nvidia drivers are installed on the Hyper-V host. Disable snapshots and shut down the virtual machine. You can then mount the VM disk (just double-click) on the host, which makes the following steps easier.

Step 1: Copy the nvidia drivers from the host to the virtual machine.

Copy the nv*.* files from C:\Windows\System32\ on the Hyper-V host to C:\Windows\System32\ on the virtual machine.

Create the HostDriverStore folder and the FileRepository subfolder in the virtual machine as below: C:\Windows\System32\HostDriverStore\FileRepository

Copy all files and folders from C:\Windows\System32\DriverStore\FileRepository on the host to the folder you just created in your virtual machine: C:\Windows\System32\HostDriverStore\FileRepository

Step 2: Give virtual machine access to host GPU.

Disable snapshots and shut down the virtual machine. Open powershell in admin mode. Change the name of the VM in the first line to your virtual machine name before copying/pasting this code.

Then copy/paste this code and press enter for the last line:

$vm = "VM11"
if (Get-VMGpuPartitionAdapter -VMName $vm) {Remove-VMGpuPartitionAdapter -VMName $vm}
Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
Set-VM -HighMemoryMappedIoSpace 16Gb -VMName $vm
Add-VMGpuPartitionAdapter -VMName $vm

Result:

User