<p dir="ltr">I was able to do it like this:</p>
<p dir="ltr">I was able to get OpenGL functioning withing my LXD container by running these commands from outside my container:<br></p>
<p dir="ltr">lxc config device add qt5-development /dev/nvidia0 unix-char path=/dev/nvidia0 <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</p>
<p dir="ltr">(some of these may be overkill)<br></p>
<p dir="ltr">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:<br></p>
<p dir="ltr">./NVIDIA-Linux-x86_64-340.96.run --no-kernel-module<br></p>
<p dir="ltr">I was able to test the implementation by running glxinfo from within my container.<br></p>
<p dir="ltr">I can now compile and test Qt5 applications within my container with full hardware acceleration,<br></p>
<p dir="ltr">Thanks again,</p>
<p dir="ltr">Pete<br></p>
<div class="gmail_quote">On Mar 11, 2016 2:02 PM,  <<a href="mailto:zztest@openmailbox.org">zztest@openmailbox.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
A couple of years ago, Graber wrote a neat article about how to run a GUI app in LXC (<a href="https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/" rel="noreferrer" target="_blank">https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/</a>). I would like to do this in LXD, but have no idea how to translate those LXC settings to LXD. Is it even possible?<br>
<br>
Please point me to a doc or tutorial if one exists.  If not, please explain how to convert each of the "lxc.mount.entry" settings (from the article) listed below to their LXD equivalents.<br>
<br>
lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir<br>
lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir<br>
lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,optional,create=dir<br>
lxc.mount.entry = /dev/video0 dev/video0 none bind,optional,create=file<br>
lxc.hook.pre-start = /home/USERNAME/.local/share/lxc/precise-gui/setup-pulse.sh<br>
<br>
Thank you!<br>
zamzing.<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>