10

I've recently set up a Hyper-V virtual machine that runs Windows 10 Pro 64 Bit, the host OS is also running Windows 10 Pro 64 bit

I want the VM to be able to play games, I tried to play a game but it's painfully slow, and the textures failed to load

after researching the issue, I think what I need to do is enable GPU acceleration, my GPU is AMD Radeon RX 570 4 GBs

I can't use RemoteFX 3D Adapter because apparently Microsoft doesn't support it anymore, and since this is a newer VM I can't add it, and I can't find "Physical GPUs" option in Hyper-V settings, so what do I do to enable GPU Acceleration?

Edit: I also don't want the VM to have exclusive access to the GPU, I want both host OS and VM to be able to use it

7
  • VT-d support depends on your processor
    – Ramhound
    Commented Mar 12, 2021 at 13:31
  • @Ramhound I have an intel core i5 4590 Commented Mar 12, 2021 at 13:44
  • So it supports VT-d; have you installed the hyper-v extension and installed the AMD drivers within the guest OS?
    – Ramhound
    Commented Mar 12, 2021 at 14:10
  • This requires to assign a video adapter to the VM. Meaning that it won't be available to the host. Is that acceptable (if your computer has two such adapters)?
    – harrymc
    Commented Mar 12, 2021 at 15:09
  • Use VirtualBox instead. It allows sharing the host GPU. Or just don’t use a VM.
    – Daniel B
    Commented Mar 13, 2021 at 19:23

3 Answers 3

5

By far this video is the best walkthrough of how to do exactly what you are looking to do.

https://www.youtube.com/watch?v=XLLcc29EZ_8

It basically use the following script as the meat of the process...

$vm = "MyVMsName"

Add-VMGpuPartitionAdapter -VMName $vm
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 80000000 -MaxPartitionVRAM 100000000 -OptimalPartitionVRAM 100000000 -MinPartitionEncode 80000000 -MaxPartitionEncode 100000000 -OptimalPartitionEncode 100000000 -MinPartitionDecode 80000000 -MaxPartitionDecode 100000000 -OptimalPartitionDecode 100000000 -MinPartitionCompute 80000000 -MaxPartitionCompute 100000000 -OptimalPartitionCompute 100000000

Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
Set-VM -HighMemoryMappedIoSpace 32GB -VMName $vm

Put all the above in a ps1 (powershell) script file and run it as admin then your VM will be sharing the GPU with the host system.

6
  • I followed this. I can see my 4080 in Device Manager. There's no code 43, it appears to be working. However the VM isn't using the device. I have no acceleration (GPU-Z shows me, and no GPU in task manager on the VM). This is Hyper-V on Windows 11.
    – Robinson
    Commented Aug 10, 2023 at 12:57
  • Make sure the drivers are EXACTLY the same on the host system and the guest system. Make sure you have them all in the correct folder structure as well (this is VERY important). If you have done this correctly, your device manager will show you an actual GPU rather than a generic GPU.
    – Arvo Bowen
    Commented Aug 15, 2023 at 21:42
  • I am unable to install NVidia drivers into the guest system. The installer refuses saying there's no compatible hardware. The GPU shows up in the Device Manager with code 43.
    – LOST
    Commented Aug 23, 2023 at 17:25
  • You need to disable dynamic memory and copy drivers.
    – LOST
    Commented Aug 23, 2023 at 17:51
  • Ahh yeah I always set my memory manually and stay away from dynamic memory. I can see why that would not have happened to me. Thanks for the additional info for others!
    – Arvo Bowen
    Commented Aug 24, 2023 at 13:39
0

Using Powershell:

  1. start PowerShell as Administrator

  2. run command: Get-VMRemoteFXPhysicalVideoAdapter

  3. Enabled attribute set to False

note the name of the graphic card

  1. run command: Enable-VMRemoteFXPhysicalVideoAdapter -Name “<graphic card name>”

Now try again and your virtual machine with RemoteFX adapter should be starting ok.

If you want to add new RemoteFX adapter, check out powershell command Add-VMRemoteFx3dVideoAdapter.

You can read more here

4
  • Will this give exclusive access of my video card to the VM or my PC can use it as well? Commented Mar 14, 2021 at 9:16
  • RemoteFX shares your GPU and if you want to have full access to a gpu you can use gpu passthrough
    – oMG
    Commented Mar 14, 2021 at 10:30
  • how do you 'Enabled attribute set to False'?
    – davejal
    Commented Mar 29, 2021 at 10:48
  • 9
    This answer is no longer valid as Microsoft has removed RemoteFX entirely in April 2021 :(
    – MMM
    Commented May 15, 2021 at 13:24
-2

There is no way to do exactly what you are asking for. The closest you will get is to pass the GPU as a PCI passtgrough device and give the VM exclusive access to it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .