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:
- 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.
- 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.
- 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.