Abstract
Let’s assume there is a linux-box settled in a corner of a room, with-no screen, keyboard, starting-up towards the level 3 (or 5) – console mode. The machine is equipped with a GTX-graphics and lasts for our home-server. Time to time we’d like to run an OpenGL-application e.g. Blender 3D or Sheepit which requires GPU-access.
The challenge is that X-system can’t be run with no display. A solution –
Xvfb misses a hardware acceleration support.
That is why we need VirtualGL. The below exercise was performed on Slackware 14.2.
Installation
Begin with downloading sources from https://sourceforge.net/projects/virtualgl/files/.
The file BUILDING.md inside the package is an instruction how to build a solution for a system. It’ll be a version of the command:
# make # as root or sudo
optionally predicted by setting of system variables, and
# make install
which accordingly to default settings will settle VGL in /opt/VirtualGL_n.nn
Configuring X.org
First you shall check-out if the kernel uses Nvidia’s modules and unload it in such case.
# lsmod | grep nvidia <…> nvidia_modeset 1100086 1 nvidia_drm nvidia 14350281 2 nvidia_modeset,nvidia_uvm <…>
# rmmod nvidia_drm nvidia_modeset nvidia_uvm nvidia # usunięcie (rmmod: ERROR: Module nvidia_uvm is not currently loaded)
# lsmod |grep nvidi # sprawdzenie
Next – I’ve found three versions how-to create xorg.conf for headless-PC
- https://virtualgl.org/Documentation/HeadlessNV
# nvidia-xconfig --query-gpu-info … GPU #0: Name : GeForce GTX 1080 Ti UUID : GPU-195b6ff9-64c2-c24d-62ab-132dcf1b80df PCI BusID : PCI:nn:n:n # nvidia-xconfig -a \ --allow-empty-initial-configuration \ --use-display-device=None \ --virtual=1920x1080 \ --busid PCI:nn:n:n # wpisz to co otrzymales
- https://www.mail-archive.com/virtualgl-users@lists.sourceforge.net/msg00484.html
# nvidia-xconfig -a \ --connected-monitor=DFP \ --virtual=1920x1080
- http://comments.gmane.org/gmane.comp.video.opengl.virtualgl.user/477
# nvidia-xconfig -a \ --use-display-device=None \ --virtual=1920x1080
and the last I recommend to you.
Konfiguracja VGL
# /opt/VirtualGL_*/bin/vglserver_config 1) Configure server for use with VirtualGL 2) Unconfigure server for use with VirtualGL X) Exit Choose: 1 Restrict 3D X server access to vglusers group (recommended)? [Y/n] Y Restrict framebuffer device access to vglusers group (recommended)? [Y/n] Y Disable XTEST extension (recommended)? [Y/n] Y <…>
A try to remote run X by a user will end-up with an error:
“/usr/libexec/Xorg.wrap: Only console users are allowed to run the X server”
Therefore we implement a modification (see man Xwrapper.config)
# mv -iv /etc/X11/Xwrapper.config /etc/X11/Xwrapper.config.old # echo "allowed_users = anybody" > /etc/X11/Xwrapper.config
Testing
At this stage it should be possible to start an X.org from ssh-session.
$ startx # a user activity
Now, If you start a VNC-server for DISPLAY :0 (command x0vncserver), it’ll be possible to see the X-session.
A verification of running X:
$ xdpyinfo | head name of display: :0.0 version number: 11.0 vendor string: The X.Org Foundation vendor release number: 11803000 X.Org version: 1.18.3 maximum request size: 16777212 bytes motion buffer size: 256 bitmap unit, bit order, padding: 32, LSBFirst, 32 image byte order: LSBFirst number of supported pixmap formats: 7
$ /opt/VirtualGL/bin/glxinfo | head name of display: :0 display: :0 screen: 0 direct rendering: Yes server glx vendor string: NVIDIA Corporation server glx version string: 1.4 server glx extensions: GLX_ARB_context_flush_control, GLX_ARB_create_context, GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile, GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, GLX_ARB_multisample, GLX_EXT_buffer_age,
In common situation glxgears creates frames accordingly to display’s frequency, eg. 60FPS. But headless-PC with VGL reports higher values.
$ export VGL_LOGO=1 #opcjonalnie $ /opt/VirtualGL/bin/vglrun glxgears 7554 frames in 5.0 seconds = 1510.679 FPS 7628 frames in 5.0 seconds = 1525.555 FPS 7720 frames in 5.0 seconds = 1543.959 FPS ^C
In the end
There is no need to turn-off, bringong-back a settingss, when you’d like to work with a phisical screen.
LinuxQuestions thread: headless server with VirtualGL but glxinfo complains