CUDA / OpenCL within a Virtual Machine / Hypervisor
Solution 1
NVIDIA announced GPU virtualization on the new Kepler cards this summer at GTC.
http://www.nvidia.com/object/vgx-boards.html
http://www.gputechconf.com/page/home.html
They not only announced it, they demonstrated it live
Solution 2
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.
Solution 3
VirtualBox has PCI-passthrough, which allows you to use CUDA or OpenCL inside a Virtual Machine.
Related videos on Youtube
Bolster
I'm a PhD student of Electronics & Software Engineering at Queen's University Belfast's Institute of Electronics, Comminucations, and Information Technology (ECIT). I want to get more involved in FOSS (as I've been using FOSS for years now). I try to document my experiments and experiences on my blog so check it out. Also an active founder of QUESTS (Queen's University, Engineering, Science, and Technology Society) and Farset Labs in Belfast, Northern Ireland
Updated on July 09, 2022Comments
-
Bolster almost 2 years
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.
-
Martin Beckett over 13 yearsVery much doubt it - even virtualbox which does have openGL hardware acceleration doesn't
-
user57368 over 13 yearsThis isn't possible yet, but will be eventually: in November 2008, VMWare bought Tungsten Graphics, the leading corporate developer of open-source 3d drivers and related stuff, such as the cross-platform Gallium driver infrastructure. Since then, they've started work on an OpenCL state tracker for gallium, and released a gallium back-end for their virtual GPU. It will be a while before the whole stack is production-ready, but most of the required pieces have already been started and are under active development.
-
Bolster about 13 yearsLeaving this question open as it might change.
-
James over 12 yearsYou might want to clarify, although it's pretty obvious, that you are interested CUDA/OpenCL on the GPU via virtualization. Today, you can use the OpenCL CPU compute device in a VM.
-
-
talonmies about 13 yearsCUDA certainly doesn't work with Xen at the moment.
-
alarouche about 13 yearsJust tested the "Design Garage" demo from NVIDIA featuring CUDA with the setup mentioned above and it works fine.
-
talonmies about 13 yearsWhich distro is this with? None of the Redhat release Xen kernels works with CUDA.
-
alarouche about 13 yearsIt's a Ubuntu 10.10 Dom0 kernel with Xen 4.1 compiled from sources. As I said in my answer, it's not straightforward to get VGA passthrough working.
-
Bolster about 13 yearsAnd this is why questions get left :D When I get back and can test this out I'll mark as answered. @Talonmies, I'd also be interested in your findings this.
-
user1111929 about 12 yearsSo @Bolster have you tested it? Nearly a year has passed and it's still not been confirmed?
-
Bolster almost 12 yearsGlad to see that over a year on, I can finally look forward to this! I'll count that as an answer.
-
fche about 11 yearsAny recent work on this project?
-
John Thompson almost 11 yearsDoes it work with SLI? Can I SLI two cards together at the hypervisor level so that a VM sees one card?
-
steve cook over 10 yearsOnly on Linux hosts though
-
steve cook over 10 yearsBut 18 months later, still no sign of this on consumer cards.
-
steve cook about 10 yearsLooks like a dead project...
-
Sergei Krivonos over 6 yearsSupports GPU OpenCL?
-
Arockia almost 4 yearsI attempted to enable pci-passthrough using vboxmanage modifyvm command. I am getting "VBoxManage: error: Unknown option: --pciattach" error. any idea?
-
inf3rno over 3 years@Arockia I guess that the nvidia driver notices that it is running on a VM and raises an error. Some hypervisors can fool it to think it runs on normal hardware, not sure if VirtualBox has this kind of feature, probably not. As of the error you are trying to do something that is not supported by your VirtualBox. Not sure if this PCI attach is version dependent, but I would check it if I were you.