CUDA / OpenCL within a Virtual Machine / Hypervisor

Bolster picture Bolster · Mar 14, 2011 · Viewed 28.9k times · Source

Anyone know of any virtualisation solutions that either allow CUDA/OpenCL access directly or implement CUDA/OpenCL abstraction.

UPDATE: Thank you those who commented. While classical 'desktop' virtualization would be nice, I suspect the likes of Xen would be closer to the mark.

Answer

alarouche picture alarouche · Jun 1, 2011

You can use Xen VGA passthrough to have full access and control over your graphic card inside a VM. You can find more information about this here: http://vfio.blogspot.com/ (look for VFIO GPU How To series parts 1-5).

I did it a few times, it's not very easy to setup, but it gives very good results (almost native). Here is a video of an experimentation I made that shows a dual VGA passthrough using Xen: http://www.youtube.com/watch?v=Gtmwnx-k2qg

I haven't tested OpenCL or CUDA, but I'm pretty sure it would work.