How to add video card in Hyper-V virtual machine?

Márcio Augusto 20 Reputation points
2023-06-19T21:55:46.9033333+00:00

My hardware > Ryzer 5 5600. RX 570 4GB. 16 GB RAM. Windows 10 pro, original. The virtual machine is with Windows 10 pro, too.

I followed instructions from this video https://youtu.be/tWp0_K05axU

I tried using these two commands:

1 - Prepare virtual machine to access hardware caches:

Set-VM -VMName "Máquina Virtual 1" -GuestControlledCacheTypes $true -LowMemoryMappedIoSpace 8GB -HighMemoryMappedIoSpace 32GB

2 - Attach graphics card to virtual machine:

Add-VMGpuPartitionAdapter -VMName "Máquina Virtual 1"

The same error appears when I use any of the two commands:

Erro do comando

I would like to know how to solve it, or if there is another way.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,588 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,021 Reputation points
    2023-06-20T16:29:04.8233333+00:00

    Hello Márcio,

    Thank you for your question and for reaching out with your question today.

    Adding a physical video card to a Hyper-V virtual machine is not supported in the traditional sense. Hyper-V uses a virtual graphics adapter for display purposes, and it doesn't provide direct access to physical GPUs.

    The commands you mentioned in your question (Set-VM and Add-VMGpuPartitionAdapter) are not meant for attaching a physical GPU to a virtual machine but rather for configuring the virtual machine's access to hardware caches and enabling the virtual GPU partition adapter, respectively.

    If you need to utilize GPU capabilities within a virtual machine, you have a few alternative options:

    1. RemoteFX: Hyper-V provides RemoteFX, which allows you to use the GPU on the host machine to accelerate graphics-intensive workloads in virtual machines. However, please note that RemoteFX has been deprecated by Microsoft, starting with Windows Server 2019. It is still available in older versions, but it's not recommended for new deployments.
    2. GPU passthrough: If you have a specific use case that requires direct access to the physical GPU, you might consider using other virtualization platforms like VMware ESXi or Citrix XenServer, which offer GPU passthrough functionality. This feature allows you to assign a physical GPU directly to a virtual machine, providing near-native performance. However, this approach may have hardware and software compatibility requirements.
    3. Cloud-based GPU instances: If your primary objective is to leverage GPU resources for tasks like machine learning or graphical rendering, you can consider using cloud providers that offer GPU instances, such as Amazon EC2, Microsoft Azure, or Google Cloud Platform. These services provide virtual machines with dedicated GPU resources and specialized GPU-accelerated instances.

    It's important to evaluate your specific requirements and constraints before deciding on the best approach for utilizing GPU resources within a virtual machine.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    Best regards.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful