<div dir="ltr"><div>I was able to get OpenGL functioning withing my LXD container by running these commands from outside my container:<br></div><div><br></div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">lxc config device add qt5-development /dev/nvidia0 unix-char path=/dev/nvidia0
</span><br>lxc config device add qt5-development /dev/nvidiactl unix-char path=/dev/nvidiactl <br>lxc config device add qt5-development /dev/nvidia-uvm unix-char path=/dev/nvidia-uvm <br>lxc config device add qt5-development /dev/video0 unix-char path=/dev/video0 <br>lxc config device add qt5-development /dev/tty0 unix-char path=/dev/tty0 <br>lxc config device add qt5-development /dev/tty7 unix-char path=/dev/tty7 <br>lxc config device add qt5-development /dev/tty8 unix-char path=/dev/tty8 <br>lxc config device add qt5-development /dev/fb0 unix-char path=/dev/fb0 <br>lxc config device add qt5-development /dev/dri unix-char path=/dev/dri <br>lxc config device add qt5-development /dev/dri/card0 unix-char path=/dev/dri/card0<br>
<br>(some of these may be overkill)</span><div><span style="font-family:monospace"><br></span><div>I also needed to install the same NVIDIA drivers that are installed in teh host, using the NVIDIA installer I needed to pass <span style="color:rgb(0,0,0);font-family:monospace">--no-kernel-module to the installer, in my case this resulted in:</span></div><div><span style="color:rgb(0,0,0);font-family:monospace"><br></span></div><div><span style="color:rgb(0,0,0);font-family:monospace">./NVIDIA-Linux-x86_64-340.96.run --no-kernel-module</span></div><div><br></div><div>I was able to test the implementation by running glxinfo from within my container.</div><div><br></div><div>I can now compile and test Qt5 applications within my container with full hardware acceleration,</div><div><br></div><div>Thanks again,</div><div>Pete</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 11:31 AM, Pete Osborne <span dir="ltr"><<a href="mailto:pete@pwo.ca" target="_blank">pete@pwo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, this is what I am looking for, thanks.<span class="HOEnZb"><font color="#888888"><div><br></div><div>Pete</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 11:26 AM, Tycho Andersen <span dir="ltr"><<a href="mailto:tycho.andersen@canonical.com" target="_blank">tycho.andersen@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, Mar 01, 2016 at 08:58:16AM -0500, Pete Osborne wrote:<br>
> Hi,<br>
><br>
> I've been using LXD for a few months now and really like how it's shaping<br>
> up. I would like to know if it's possible to run opengl applications within<br>
> an LXD container sharing the hosts' X server? The primary function is to<br>
> build and test Qt5 based applications that use open gl.<br>
><br>
> I've found several guides on how to set it up in an LXC container but i'd<br>
> prefer to use LXD. I'm using a privielged container, and I attempted<br>
> creating all the device files (/dev/dri/card0, /dev/video0, dev/nvidia*,<br>
> /dev/fb0, dev/tty* ) from withing my container using mknod, but I think I<br>
> need some way of using a bind mount.<br>
><br>
> Can anyone provide some advice?<br>
<br>
</span>You probably want LXD's device configuration, it is detailed here:<br>
<br>
<a href="https://github.com/lxc/lxd/blob/master/specs/configuration.md#devices-configuration" rel="noreferrer" target="_blank">https://github.com/lxc/lxd/blob/master/specs/configuration.md#devices-configuration</a><br>
<br>
Tycho<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote></div><br></div>
</div></div></blockquote></div><br></div>