Does this post match what you’ve tried?
https://mu0.cc/2020/08/25/hyperv-gpupv/
" TL; DR;
To enable GPU virtualization (GPU-PV) on arbitrary Hyper-V Windows 10 virtual machines, do the following:
- Ensure that both the host and the guest meet the system requirements, and use the generation 2 virtual machines.
- The following commands are to be done in PowerShell. Check that GPU-PV is available by executing the
Get-VMPartitionableGpu. If more than one GPUs are available, the first one listed will be used. Currently, the only way to “select” GPU in use is by disabling other GPUs until the wanted GPU resides at the top of the output of the said command. - Copy the appropriate GPU driver from host to guest. Copying has to be done manually. Installing the GPU driver from an installation package will not work.
- From the host, find out the correct driver package path. Open Windows Device Manager, open the GPU to be used for GPU-PV, go to the “Driver” tab, click “Driver Details”, and scroll down until you find a file with the following pattern:
(filename.inf)_amd64_(random_hex_number)\(somefiles.dll). - On host, go to
C:\Windows\System32\DriverStore\FileRepository. There should be a folder with the same name as above. - Copy that folder to guest under
C:\Windows\System32\HostDriverStore\FileRepository. If the folder is not there, create it. - Enable write-combining and enlarge MMIO address spaces on the guest (see here for details). The following example sets the 32-bit MMIO to 3 GB and above 32-bit MMIO to 30 GB.
Set-VM -VMName $vmname -GuestControlledCacheTypes $true -LowMemoryMappedIoSpace 3072MB -HighMemoryMappedIoSpace 30720MB
- Mark the virtual machine to use GPU-PV.
Set-VMGpuPartitionAdapter -VMName $vmname
- If everything works, the virtual machine should start with GPU acceleration. Enjoy! However, if it does not work, it is likely that you are partitioning a render only GPU. GPU-PV on such GPUs seems broken under Windows 10 version 2004 but seems to be fixed as well for the next version of Windows 10. See this section for details."