Changes

Jump to: navigation, search

LXD/GPU Acceleration (NVIDIA)

1,197 bytes added, 8 months ago
LXD Setup for Container
The {{c|mygpu}} part automatically configures access to the NVIDIA graphics card on your system. Thanks to {{c|libnvidia-container}}, you don't need to have any drivers installed at all.
Now=== LXD Setup Inside Container === Once the LXD container is configured properly, you we can do a bare-bones test of GPU acceleration using glxgearsnow enter the container to complete configuration:
{{console|body=
###i## lxc exec nvidia-test -- su --login
%nvidia-test%}} You will need to emerge {{c|nvidia-drivers}} and {{c|xorg-server}} to provide a basic environment for accelerated NVIDIA drivers to function. The following setup is suggested: {{console|body=%nvidia-test% ##i##ego syncepro flavor desktop%nvidia-test% ##i##ego profile flavor desktopemerge -auDN @world --jobs%nvidia-test% ##i##emerge --jobs xorg-server nvidia-drivers mesa}} Now, you can perform a quick investigation of your GL environment. Try running {{c|glxinfo}} inside your container, as root. You should see output that looks like this: {{console|body=%nvidia-progstest% ##i##glxinfoname of display: :1display: :1 screen: 0direct rendering: Yesserver glx vendor string: NVIDIA Corporationserver glx version string: 1.4}} You should also be able to run {{c|glxgears}} and have it open an X window on your host's X display :1, using full GPU acceleration: {{console|body=
%nvidia-test% ##i##glxgears
}}
You should be greeted with the glxgears application running in an X window. === Conclusion === We've successfully set up a Funtoo Linux container to run GPU-accelerated apps on the host's X session. You should be able to replicate this setup with any other Linux distributions, running using GPU accelerationprovided that you are able to install the NVIDIA drivers inside the container. Remember to run {{c|xhost +local:}} after every reboot, or to add this to your {{c|~/.xprofile}} file so it is run every time your X session starts.
Bureaucrats, Administrators, wiki-admins, wiki-staff
6,372
edits

Navigation menu