Home > Blogs > VMware VROOM! Blog


GPGPU Computing in a VM

Periodically on forums I see people asking whether GPGPU computing is supported by ESX, prompting me to write a brief post on the subject:

YES! VMware ESX supports GPGPU computing. Applications can access GPGPUs via CUDA or OpenCL in exactly the same way as when running natively — no changes are required to the application.

Recent versions of ESX (4.0 onwards) support a feature termed VMDirectPath IO. VMDirectPath IO allows guest operating systems to directly access PCI devices & this feature can be used to achieve GPGPU computing in a VM.  As one would expect with direct communication, the performance overheads are minimal, providing close to native performance.

The process for setting-up access to a GPU from a VM is fairly simple:

(1)    Requires a VT-d capable system (or system with AMD IOMMU)

-          Nehalem class processor or later

-          VT-d performs the remapping of I/O DMA transfers and device-generated interrupts needed for safe operation in the virtualized environment

-          Ensures guest isolation

(2)    Requires a “direct passthrough” capable GPGPU

-          Most NVIDIA Quadro cards are passthrough capable

-          Recent AMD cards are also passthrough capable

(3)    Ensure I/O MMU is enabled in system BIOS

(4)    VMDirectPath IO can be enabled via vSphere client or ESX command line

-          Enable GPGPU as a passthrough device

-          Add GPGPU to chosen VM

(5)    Install vendors latest graphics drivers in the VM

(6)    Download GPGPU SDK

(7)    Run your CUDA/OpenCL apps!

[N.B. See VMware KB1010789 for more configuration details]

I’ve personally undertaken some testing prior to this post:

-          Successfully tested with both Windows and Linux VMs (32 and 64-bit VMs)

-          Successfully tested both CUDA and OpenCL frameworks on Nvidia Quadro GPUs

-          Successfully tested OpenCL on AMD GPUs

Additionally, I spent some time investigating the performance overheads associated with performing GPGPU computing from within a VM. Given that once the data has been loaded into the GPU’s local memory and the processing operation initiated the GPU operates largely independently of the OS, if we expect to see any performance overheads, they are likely to be most significant when moving data back and forth between the VM and the GPU and initiating commands. Accordingly, I’ve spent time looking at these scenarios and found the following:

-          Data transfer back and forth between host and GPU is close to native performance

  • Found to be true even for small  data chunks (e.g. 1KB)

-          Tested a number of short-duration microkernels from a wide range of application spaces and found no noticeable performance impact

  • DSP to financial to computational fluid dynamics  (and beyond)

-           VM performance observed at typically 98%+ of native performance

Operation close to native performance is not unexpected, as the direct communication been VM and GPU provided by VMDirectPath IO ensures the hypervisor doesn’t get involved in each and every interaction (which would add overhead), allowing even short duration operations to run close to native performance.

So, in summary, ESX supports GPGPU computing in a VM, at extremely close to native performance!

23 thoughts on “GPGPU Computing in a VM

  1. kswail

    Can multiple VMs share access to the same physical GPU resources at the same time, as one can do with Hyper-V, or does VMware force the need for each VM to have their own GPU chip dedicated?

    Reply
  2. Brian

    This works great for most cards however it seems ESX isn’t properly mapping the dependent parents for multi-GPU cards. I have a Radeon 5970 working in KVM using VT-d but on ESXi 5.0 my 5870 works however ESXi isn’t properly stepping up to the PCIe bus, rather the local PCIe on the GPU itself so passthrough isn’t working.

    Reply
  3. Vinzz

    Can you please let me know the hardware specs of the system that you used. I used hp z800 workstation which has broadcom NIC card. So when I enable passthrough to c2050 GPU card and reboot the system vsphere server 5 hangs at cnic_registry. I even tried with vsphere4.1. I get error with NIC.

    Reply
  4. HP La

    how/where i can check is Geforce 9600gt is Is passthrough capable?
    Should i install some Nvidia drivers in Esxi (im with 5.0)

    Reply
  5. Pingback: Office of the CTO | GPU Computing (GPGPU) in a Virtual Environment

  6. stebriz

    Can VMWare take profit of GPGPU computing virtualizing more available CPU cores and running the CPU threads on the GPU?

    Reply
  7. nusch

    Does it mean If i have two GPUs can I assign one to ESXi and second directly to Windows 7 Guest to play games from time to time?

    Reply
  8. Damaris

    I think the admin of this website is genuinely working hard in support of
    his web page, because here every information is quality based information.

    Take a look at my homepage … Free Dark
    Souls 2 PC Download, Damaris,

    Reply
  9. online jobs for stay at home moms

    If you want to get an online job, your best bet is probably going to be looking on these sites.
    They need to have so much subject material that they can’t possibly
    create it all by themselves. At this time, with the uncertainties
    of our economic scenario and the massive quantity of folks losing jobs and organizations closing their doors, jobs
    for stay at home moms are becoming essential.

    Reply
  10. playhouse plans

    In order to avoid any unnecessary accident, in my personal opinion, it will
    be cost-saving for you to get solar-powered accent lights to make
    the playhouse brighter in the evenings. Tom Cooch who played Curly, had a powerful voice that filled the theatre.
    Sky supertelly (with included supertelly service pack) gives you hundreds of channels to choose from,
    all sorted into category packages, so you only pay for the channels that you want to watch.

    Reply
  11. Coleman

    Wow, fantastic blog layout! How lengthy have you been blogging for?
    you make blogging glance easy. The whole glance of
    your website is great, let alone the content material!

    Reply
  12. vegetarian recipes

    Generally I don’t read post on blogs, however I would like to say that this write-up very compelled me to check out and do it!
    Your writing taste has been surprised me. Thanks,
    quite great article.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>