[lxc-users] DRI in LXD

Pete Osborne pete at pwo.ca
Wed Mar 2 01:07:01 UTC 2016


I was able to get OpenGL functioning withing my LXD container by running
these commands from outside my container:

lxc config device add qt5-development /dev/nvidia0 unix-char
path=/dev/nvidia0
lxc config device add qt5-development /dev/nvidiactl unix-char
path=/dev/nvidiactl
lxc config device add qt5-development /dev/nvidia-uvm unix-char
path=/dev/nvidia-uvm
lxc config device add qt5-development /dev/video0 unix-char
path=/dev/video0
lxc config device add qt5-development /dev/tty0 unix-char path=/dev/tty0

lxc config device add qt5-development /dev/tty7 unix-char path=/dev/tty7
lxc config device add qt5-development /dev/tty8 unix-char path=/dev/tty8
lxc config device add qt5-development /dev/fb0 unix-char path=/dev/fb0
lxc config device add qt5-development /dev/dri unix-char path=/dev/dri
lxc config device add qt5-development /dev/dri/card0 unix-char
path=/dev/dri/card0

(some of these may be overkill)

I also needed to install the same NVIDIA drivers that are installed in teh
host, using the NVIDIA installer I needed to pass --no-kernel-module to the
installer, in my case this resulted in:

./NVIDIA-Linux-x86_64-340.96.run --no-kernel-module

I was able to test the implementation by running glxinfo from within my
container.

I can now compile and test Qt5 applications within my container with full
hardware acceleration,

Thanks again,
Pete


On Tue, Mar 1, 2016 at 11:31 AM, Pete Osborne <pete at pwo.ca> wrote:

> Yes, this is what I am looking for, thanks.
>
> Pete
>
> On Tue, Mar 1, 2016 at 11:26 AM, Tycho Andersen <
> tycho.andersen at canonical.com> wrote:
>
>> On Tue, Mar 01, 2016 at 08:58:16AM -0500, Pete Osborne wrote:
>> > Hi,
>> >
>> > I've been using LXD for a few months now and really like how it's
>> shaping
>> > up. I would like to know if it's possible to run opengl applications
>> within
>> > an LXD container sharing the hosts' X server? The primary function is to
>> > build and test Qt5 based applications that use open gl.
>> >
>> > I've found several guides on how to set it up in an LXC container but
>> i'd
>> > prefer to use LXD. I'm using a privielged container, and I attempted
>> > creating all the device files (/dev/dri/card0, /dev/video0, dev/nvidia*,
>> > /dev/fb0, dev/tty* ) from withing my container using mknod, but I think
>> I
>> > need some way of using a bind mount.
>> >
>> > Can anyone provide some advice?
>>
>> You probably want LXD's device configuration, it is detailed here:
>>
>>
>> https://github.com/lxc/lxd/blob/master/specs/configuration.md#devices-configuration
>>
>> Tycho
>> _______________________________________________
>> lxc-users mailing list
>> lxc-users at lists.linuxcontainers.org
>> http://lists.linuxcontainers.org/listinfo/lxc-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160301/ea791c10/attachment.html>


More information about the lxc-users mailing list