GPU device in lxc profile ignored?

Bug #1690822 reported by Konstantinos Tsakalozos
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I am trying to add the gpu device in an profile so that new containers come up with gpu available.

Even though the gpu device is in the profile it seems it is ignored. In this pastebin http://pastebin.ubuntu.com/24579662/ you can see the profile with the gpu device. We add a new container (juju add-unit) and we check if the device is there. It is not, so we add it (lxc config device add) after the container comes up.

Revision history for this message
Christian Brauner (cbrauner) wrote :

I couldn't reproduce this behavior locally.
- We'd need the logs for the daemon and the corresponding containers in question from /var/log/lxd/*, please.
- Please also show

cat /proc/1/mountinfo

from inside one of those containers that doesn't mount the gpu device.

Revision history for this message
Konstantinos Tsakalozos (kos.tsakalozos) wrote :

Attaching mountinfo

Revision history for this message
Konstantinos Tsakalozos (kos.tsakalozos) wrote :

Attaching lxd logs

Revision history for this message
Konstantinos Tsakalozos (kos.tsakalozos) wrote :

Attaching container logs

Revision history for this message
Konstantinos Tsakalozos (kos.tsakalozos) wrote :

Christian, can you share the profile you used and it worked? I already showed you how my profile looks like but it might be something I am missing. Should I try yours?

Thanks for taking a look.

Revision history for this message
Christian Brauner (cbrauner) wrote :

chb@conventiont|~
> lxc profile show dummy
config:
  security.nesting: "true"
  security.privileged: "true"
description: ""
devices:
  gpu:
    type: gpu
name: dummy
used_by:
- /1.0/containers/alp1
- /1.0/containers/alpgpu

Revision history for this message
Christian Brauner (cbrauner) wrote :

I've used your exact profile now:

https://paste.ubuntu.com/24586449/

Revision history for this message
Konstantinos Tsakalozos (kos.tsakalozos) wrote :

I can confirm that "ls -al /dev/dri/" within the lxc container shows the devices you expect. However, "lxc config show xen2" shows the devices section being empty.

Revision history for this message
Christian Brauner (cbrauner) wrote : Re: [Bug 1690822] Re: GPU device in lxc profile ignored?

On Thu, May 18, 2017 at 08:09:05AM -0000, Konstantinos Tsakalozos wrote:
> I can confirm that "ls -al /dev/dri/" within the lxc container shows the
> devices you expect. However, "lxc config show xen2" shows the devices
> section being empty.

This isn't a bug at all. :) You're adding a device to a profile the container is
attached to. By definition it will thus not be in the container's config file.
The container will just gather all the devices it needs to create and setup from
the profile it is attached to. It will never show up in the container's config
file unless you explicitly add it.

Changed in lxc (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.