How to use GeForce GTX 1050 in VirtualBox

85,736

This made me wonder if I need an API.

As an end user of VirtualBox, you don't need an API.

I want to use the graphics card while running my macOS Virtual Machine.

VirtualBox PCI Passthrough support, which is required for what you want to do, is very limited and comes with specific hardware requirements.

The PCI passthrough module is shipped as a VirtualBox extension package, which must be installed separately. See Section 1.5, “Installing VirtualBox and extension packs” for more information.

Essentially this feature allows to directly use physical PCI devices on the host by the guest even if host doesn't have drivers for this particular device. Both, regular PCI and some PCI Express cards, are supported. AGP and certain PCI Express cards are not supported at the moment if they rely on GART (Graphics Address Remapping Table) unit programming for texture management as it does rather non-trivial operations with pages remapping interfering with IOMMU. This limitation may be lifted in future releases.

To be fully functional, PCI passthrough support in VirtualBox depends upon an IOMMU hardware unit which is not yet too widely available. If the device uses bus mastering (i.e. it performs DMA to the OS memory on its own), then an IOMMU is required, otherwise such DMA transactions may write to the wrong physical memory address as the device DMA engine is programmed using a device-specific protocol to perform memory transactions. The IOMMU functions as translation unit mapping physical memory access requests from the device using knowledge of the guest physical address to host physical addresses translation rules.

Intel's solution for IOMMU is marketed as "Intel Virtualization Technology for Directed I/O" (VT-d), and AMD's one is called AMD-Vi. So please check if your motherboard datasheet has appropriate technology. Even if your hardware doesn't have a IOMMU, certain PCI cards may work (such as serial PCI adapters), but the guest will show a warning on boot and the VM execution will terminate if the guest driver will attempt to enable card bus mastering.

enter image description here

PCI passthrough

I do not want to give the control of the GPU to my VM, I just want to use it in the same way that the Intel GPU is being used.

In order to accomplish what you want, you are going to have to give up control, that's just a matter of fact.

Share:
85,736

Related videos on Youtube

Antonio Vela Gartner
Author by

Antonio Vela Gartner

Updated on September 18, 2022

Comments

  • Antonio Vela Gartner
    Antonio Vela Gartner over 1 year

    I have a Surface Book 2 with a GTX 1050 GPU, I want to use that graphic card while running my macOS Virtual Machine. I have been searching a lot but didn't find a satisfactory answer. I do not want to give the control of the GPU to my VM, I just want to use it in the same way that the Intel GPU is being used. I tried to set VirtualBox in the Nvidia Control Panel but it is the only program that doesn't appear, this made me wonder if I need an API.

    Thanks for your help!

    • Ramhound
      Ramhound over 6 years
      "I just want to use it in the same way that the Intel GPU is being used." - I am not actually sure what you mean by this statement. I suspect you just want to use 3D acceleration, but I am not entirely sure, due to the fact only VT-d meets description you used
  • Ramhound
    Ramhound over 6 years
    VT-d support within alternative hypervisors isn't that much better. VMWare Workstation does not support it. Can I use VT-D with a windows host for a VM?. I do not believe, Hyper-V on Windows 10 hosts, support it either.