[lxc-users] Recipe for running opengl apps inside LXC with proprietary nvidia driver?
dank at kegel.com
Wed Apr 23 00:36:25 UTC 2014
So here's what I've tried so far:
On Ubuntu 12.04, I created an Ubuntu 12.04 container.
lxc.cgroup.devices.allow = c 4:10 rwm # /dev/tty10 X Desktop
lxc.cgroup.devices.allow = c 195:* rwm # /dev/nvidia Graphics card
lxc.cgroup.devices.allow = c 13:* rwm # /dev/input/* input devices
to the container's config file, then started it.
Inside it, I did
apt-get install nvidia-current xinit
and then (per the web page above)
# display vt device
mknod -m 666 /dev/tty10 c 4 10
# NVIDIA graphics card devices
mknod -m 666 /dev/nvidia0 c 195 0
mknod -m 666 /dev/nvidiactl c 195 255
# input devices
chmod 755 /dev/input
mknod -m 666 /dev/input/mice c 13 63
and then finally
sudo xinit -- /usr/bin/X vt10 -novtswitch
(note the VT number has to match the one created above).
That seemed to work to the extent that I could put things in
xterm -e "sh -c 'glxinfo | grep string; sleep 10'"
and have them work. I haven't gotten input working yet.
On Tue, Apr 22, 2014 at 4:27 PM, Dan Kegel <dank at kegel.com> wrote:
> Or does one normally run a separate X in a separate virtual terminal
> for LXC, just as one does for multiple users? So ctl-alt-F7 is
> for the normal desktop, and ctl-alt-F8 could be for the X inside LXC.
> On Tue, Apr 22, 2014 at 4:20 PM, Dan Kegel <dank at kegel.com> wrote:
>> Does anyone have a recipe for running opengl apps in a container
>> on a host with an nvidia graphics card yet?
>> I know the nvidia driver has to be installed and loaded in the host's kernel
>> (of course). Where does X have to run -- can it be on the host,
>> the container, or either?
>> I can start fooling around given past posts, just wondering if anyone
>> has summed up the current state of things in an easy to use form.
>> says it just works (assuming you do a few things)
>> says it works (assuming you follow a long list of steps)
>> hints that it works with just a few tweaks
>> says libvirt does it better
>> talks about it a bit, and has similar long list of steps
>> hints at one,
>> http://www.vislab.uq.edu.au/howto/lxc/nvidia.html shows how to at
>> least build such apps in the container,
>> talks about it for vesa,
>> http://blog.mraw.org/2011/04/05/Running_X_from_LXC/ talks about it for
>> open source driver
>> talks about doing it for CUDA
More information about the lxc-users