GPU acceleration on Vagrant + Virtual box

3,042 views
Skip to first unread message

Shaunak De

unread,
Apr 11, 2015, 4:17:18 AM4/11/15
to caffe...@googlegroups.com
Hello,

I am trying to set up caffe on a Vagrant+Virtualbox set up.
An answer on stack overflow [1] indicates that GPU acceleration
is not possible on a virtual machine.

I just wanted to confirm if this was the case.

Secondly, I am also trying to set up a VM PLayer + Ubuntu instance
(with what I think is support for GPU). Is that also futile to set up?

Thanks.
Shaunak
shaunakde at gmail




[1] http://stackoverflow.com/a/28979649/894903

Dennis Mungai

unread,
Apr 11, 2015, 7:54:09 AM4/11/15
to Shaunak De, caffe...@googlegroups.com
Hello Shaunak,

You may have more luck with KVM-GT (KVM with Graphics Virtualization
passthrough) or Xen-GT (Xen with Virtualization Passthrough).

See this for more information and to bring yourself up to speed:

1. http://www.phoronix.com/scan.php?page=news_item&px=MTg1MzQ
2. https://github.com/01org/KVMGT-kernel
3. https://01.org/kvm/blogs/albcamus/2014/kvmgt-first-release
4. http://www.linux-kvm.org/wiki/images/f/f3/01x08b-KVMGT-a.pdf
5. http://www.linux-kvm.org/wiki/images/b/b3/01x09b-VFIOandYou-small.pdf


TL: DR > You'll need a motherboard, BIOS, chipset and processor that
supports VT-d with IOMMU (Intel) or an AMD equivalents' AMD I/O
Virtualization technology, a compatible virtualization layer (see
above), and PCIe devices that support the FLR+ (Function Level Reset
flag), confirmed via lspci -vv run as root on Linux.


There's an excellent discussion on the Arch forums about the same
here https://bbs.archlinux.org/viewtopic.php?id=162768&p=120 that may
also interest you.

This is a bit of an unchartered ground, so expect breakages and
hardware incompatibilities if one of these requirements is either not
met or your BIOS vendor breaks the feature with a shoddy BIOS
requiring workarounds (as is often the case). Your mileage may vary.

Good luck.
> --
> You received this message because you are subscribed to the Google Groups
> "Caffe Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to caffe-users...@googlegroups.com.
> To post to this group, send email to caffe...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/caffe-users/44067654-3ad7-4892-bc3c-c3d63f79dbbf%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

revspooner

unread,
Apr 11, 2015, 6:56:22 PM4/11/15
to Dennis Mungai, Shaunak De, caffe...@googlegroups.com
There is a caffe dockerfile that will allow you to run GPU accelerated caffe in a container.

DOCKER_NVIDIA_DEVICES="--device /dev/nvidia0:/dev/nvidia0 --device /dev/nvidiactl:/dev/nvidiactl --device /dev/nvidia-uvm:/dev/nvidia-uvm"
sudo docker run -ti $DOCKER_NVIDIA_DEVICES tleyden5iwx/caffe-gpu-master /bin/bash

Should you want to use this on an amazon GPU instance there is also an AMI with the drivers configured

Shaunak De

unread,
Apr 13, 2015, 3:38:28 AM4/13/15
to revspooner, Dennis Mungai, caffe...@googlegroups.com
Thank you for your responses. I do understand now that there are ways of doing this, and it is probably easier for me to write models in CPU only mode and then test / run them on another machine / AWS
--
Reply all
Reply to author
Forward
0 new messages