use nvidia docker as provider

47 views
Skip to first unread message

Nimrod Morag

unread,
Dec 7, 2017, 7:50:32 AM12/7/17
to Vagrant
I'm part of a team developing a machine learning application.

currently we're using Vagrant with a Docker provider as a uniform dev environment.

We want to utilize the GPUs on our computers when we play around during development, and I found that Nvidia released nvidia-docker to enable that without needing to map the devices seperately in each host.

How can I use nvidia-docker as a provider for Vagrant?

If not possible, how can I dynamically retreive the device names on the host when running `vagrant up`?


(didn't specify versions because I will change to whatever version the solution requires)

Alvaro Miranda Aguilera

unread,
Dec 8, 2017, 4:47:04 AM12/8/17
to vagra...@googlegroups.com
helllo

more info please.

are you on a Linux host with docker installed?

Can you share a sample minimal Vagrantfile you use?

Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/90d488ac-897b-41cb-ae95-e56025e0fdb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Nimrod Morag

unread,
Dec 10, 2017, 12:35:27 AM12/10/17
to Vagrant


On Friday, December 8, 2017 at 11:47:04 AM UTC+2, Alvaro Miranda Aguilera wrote:
helllo

more info please.

are you on a Linux host with docker installed?
Yes. Ubuntu 16 


Can you share a sample minimal Vagrantfile you use?

Vagrant.configure(2) do |config|
    config.vm.provider "docker" do |d|
         d.image = "aia/dev"
         d.has_ssh = true
         d.name = "vagrant_aia_dev"
         d.create_args = ["-dit"]
    end

    config.vm.network "public_network"
    config.ssh.forward_x11 = true
end






 
Alvaro

On Thu, Dec 7, 2017 at 1:50 PM, Nimrod Morag <nimrod...@gmail.com> wrote:
I'm part of a team developing a machine learning application.

currently we're using Vagrant with a Docker provider as a uniform dev environment.

We want to utilize the GPUs on our computers when we play around during development, and I found that Nvidia released nvidia-docker to enable that without needing to map the devices seperately in each host.

How can I use nvidia-docker as a provider for Vagrant?

If not possible, how can I dynamically retreive the device names on the host when running `vagrant up`?


(didn't specify versions because I will change to whatever version the solution requires)

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Dec 10, 2017, 5:30:08 AM12/10/17
to vagra...@googlegroups.com
what happens if you replace

d.image = "aia/dev"

to the docker image you want to use?

Alvaro.

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/5bfe8b6c-f36b-4fa8-be6d-bee8208b72a1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Dec 10, 2017, 5:32:10 AM12/10/17
to vagra...@googlegroups.com
to give the docker container access to devices like /dev/<..> you may need to use flags

so try to get that the comman line you need then you can tell vagrant to use that.


Alvaro
--
Alvaro

Nimrod Morag

unread,
Dec 10, 2017, 6:30:17 AM12/10/17
to Vagrant
The vagrantfile i posted in my last reply works fine with docker.

I am looking for a way to map to GPUs of the host without passing the `--device` argument
Since it needs the name of the device (eg /dev/nvidia0) on the host, and I want it entirely portable between different hosts



--
Alvaro

Reply all
Reply to author
Forward
0 new messages