How to enable VirtualGL support on Linux in NoMachine v. 6.2 or later |
|
Added on: 2018-05-30 | Last Modified: 2020-11-30 |
ID: AR05P00982 | Applies To: NoMachine Server |
This article applies to NoMachine v. 6.2 or later and to servers for Linux supporting virtual desktops (e.g. NoMachine Workstation, Terminal Server etc ...) and Terminal Server Node. For previous NoMachine versions, please refer to: https://www.nomachine.com/AR11K00737.
Warning
As first step, it's necessary to configure the X server on the system for giving VirtualGL access to the GPU. All users with a connection to the X server will be allowed to use the VirtualGL direct rendering.
'VirtualGL requires access to a GPU in the application server so that it can create off-screen pixel buffers (Pbuffers) and redirect the 3D rendering from X windows into these Pbuffers. Unfortunately, accessing a GPU on Linux and Unix systems requires going through an X server.' Ref. https://cdn.rawgit.com/VirtualGL/virtualgl/2.5.2/doc/index.html#hd006001 To configure the system for using VirtualGL, execute:
a) Use VirtualGL for all applications, included the desktop. b) Use VirtualGL only for specific application(s). Option b), when possible, is preferable in order to avoid unforeseen incompatibilities between some applications and VirtualGL.
a) How to run all applications (included the desktop) under the provisioning of VirtualGL In order to use VirtualGL in NoMachine virtual desktops/custom sessions and for all applications, execute from a terminal:
(if you don't have sudo, run the command as root) This command will set in /usr/NX/etc/node.cfg: EnableVirtualGLSupport 1 The system is now ready to run all applications in NoMachine virtual desktops or custom sessions under the provisioning of VirtualGL. This can be however redundant and could lead to unforeseen behaviors, since only those applications that use OpenGL will benefit from VirtualGL rendering. To disable using VirtualGL:
This will set in /usr/NX/etc/node.cfg:
EnableVirtualGLSupport 0
NOTE for GNOME desktops
b) How to run only a specific application under the provisioning of VirtualGL Launch the OpenGL application by running in a console inside the NoMachine virtual desktop:
TIP: You may also create a wrapper script to launch the application with the command above. Multiple OpenGL applications can be launched on the desktop by specifying the command for each of them.
If you need to run the OpenGL application in a NoMachine custom session, pre-pend: /usr/NX/scripts/vgl/vglrun to the command specified in the 'Run the following command' field of the client User's Interface.
A specific case
The example below is almost equivalent to set in /usr/NX/etc/node.cfg: EnableVirtualGLSupport 1.
For example, for RHEL-based Operating Systems:
DefaultDesktopCommand "/etc/gdm/Xsession 'env XDG_SESSION_TYPE=x11 /usr/NX/scripts/vgl/vglrun gnome-session --session=gnome'" or:
DefaultDesktopCommand "env XDG_SESSION_TYPE=x11 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=gnome"
When using this method, disable the VirtualGL support:
This will set in /usr/NX/etc/node.cfg: EnableVirtualGLSupport 0
A further example: run Firefox in custom session with hardware OpenGL acceleration How to check if VirtualGL is in use
Launch the NoMachine virtual desktop and open a terminal inside the session.
glxinfo | grep -i "renderer\|vendor" verify that EnableVirtualGL=1 is set in node.cfg, if you have followed instructions of a) How to run all applications under the provisioning of VirtualGL. If instead you followed instructions for the specific case, 'Solving slowness problems when running the GNOME desktop', it's likely the Xsession script is cleaning up the environment variables. In this case verify the desktop command set in the DefaultDesktopCommand key in node.cfg.
Some references: The NoMachine server commands to enable VirtualGL support: https://www.nomachine.com/FR10N03215 More on OpenGL support: https://www.nomachine.com/AR01P00960 How VirtualGL works: https://www.nomachine.com/AR12K00764 Using VirtualGL to improve performance of GNOME 3 virtual desktops on RHEL 7/CentOS 7: https://www.nomachine.com/AR01Q01012
Using VirtualGL on headless machines, provided that you can configure the X server to run on the headless video card. See VirtualGL docs: |