27

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.

Bolster
  • 7,460
  • 13
  • 61
  • 96
  • 1
    Very much doubt it - even virtualbox which does have openGL hardware acceleration doesn't – Martin Beckett Mar 14 '11 at 16:29
  • 1
    This 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. – user57368 Mar 22 '11 at 06:28
  • Leaving this question open as it might change. – Bolster Apr 08 '11 at 12:53
  • You 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. – James Nov 08 '11 at 03:49

5 Answers5

11

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.

Aleksandr Dubinsky
  • 22,436
  • 15
  • 82
  • 99
alarouche
  • 441
  • 3
  • 4
  • 1
    CUDA certainly doesn't work with Xen at the moment. – talonmies Jun 01 '11 at 05:30
  • 1
    Just tested the "Design Garage" demo from NVIDIA featuring CUDA with the setup mentioned above and it works fine. – alarouche Jun 01 '11 at 14:47
  • Which distro is this with? None of the Redhat release Xen kernels works with CUDA. – talonmies Jun 01 '11 at 15:00
  • 1
    It'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. – alarouche Jun 01 '11 at 15:59
  • And 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. – Bolster Jun 02 '11 at 13:28
  • So @Bolster have you tested it? Nearly a year has passed and it's still not been confirmed? – user1111929 May 05 '12 at 13:46
  • Does it work with SLI? Can I SLI two cards together at the hypervisor level so that a VM sees one card? – John Thompson Aug 21 '13 at 02:46
10

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

talonmies
  • 70,661
  • 34
  • 192
  • 269
ccook
  • 5,869
  • 6
  • 56
  • 81
3

VirtualBox has PCI-passthrough, which allows you to use CUDA or OpenCL inside a Virtual Machine.

Maestro
  • 9,046
  • 15
  • 83
  • 116
  • 1
    Only on Linux hosts though – steve cook Mar 13 '14 at 04:04
  • I attempted to enable pci-passthrough using vboxmanage modifyvm command. I am getting "VBoxManage: error: Unknown option: --pciattach" error. any idea? – Arockia Jun 29 '20 at 04:08
  • @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. – inf3rno Jan 05 '21 at 19:45
-3

Disclaimer: vGPU is one of the projects that I was working on...

If you want to access GPU through CUDA or OpenCL APIs, I suggest you to take a look at http://www.zillians.com/vgpu

By simply implementing SR-IOV on GPU is not going to work not only because of the lack of support in hardware but also the feasibility of using virtualized GPU resources under hypervisor. Simple question: how many GPUs can you fit into your chassis? and share them for each VM instance, which will much degrade the performance and have huge bandwidth requirements on the PCI-E switch...does that make any sense?

That's why Amazon EC2 only provides dedicated GPU instances and also the reason we choose to implement VGPU to make GPU a shared and scalable computing unit.

-5

Parallels Workstation Extreme.

bubbadoughball
  • 193
  • 2
  • 11