This article applies to NoMachine server v. 6.4.x or later running on Red Hat Enterprise Linux (or CentOS) 7.5 or later.
For NoMachine versions older than v. 6.4.x and RHEL versions previous than 7.5, please refer to: https://www.nomachine.com/AR10N00907 and: https://www.nomachine.com/AR12L00831.
This article is intended to address performance issues that could arise when the following conditions are all met:
1. A NoMachine virtual desktop session is running on Red Hat Enterprise Linux (or CentOS)
2. GNOME 3 desktop is running in the NoMachine virtual desktop
3. Proprietary NVIDIA drivers are installed on the system
GNOME 3 provides 3D desktop effects (e.g. shadows, animations, fading menu etc..) that are realized by using the software rendering when the graphics hardware is not available. This is the case of NoMachine virtual desktop sessions.
In this case it's necessary to adopt the OpenGL direct rendering with LLVMpipe software rasterizer in order to get a software rendering with proper performance.
In RHEL/CentOS, LLVMpipe is often enabled out-of-the-box and GNOME 3 works flawlessly in the NoMachine virtual desktops.
However, performance issues could arise if NVIDIA proprietary software package is installed. Along with the video card driver, NVIDIA-specific OpenGL libraries are installed and the library search order used by the system is modified. The LLVMpipe rasterizer is switched off; as a consequence NoMachine virtual desktops use indirect rendering for OpenGL. This often produces noticeable effects on performance, for example less responsiveness to keyboard and mouse input.
There are two possible alternative solutions to restore proper performance without removing the NVIDIA package:
1. Change the OpenGL library configuration to turn LLVMpipe on so that it can be used in the NoMachine virtual desktops or
2. Benefit of the NVIDIA card to accelerate OpenGL applications in the NoMachine virtual desktop through VirtualGL
First solution - turn LLVMpipe ON
In the latest RHEL 7 releases (7.5 and later), multiple OpenGL API implementations are arbitrated by a vendor-neutral dispatch layer called libglvnd.
In order to get llvmpipe working in virtual desktops, ensure that Mesa GL dispatch is used as fallback.
In a terminal, change directory to /usr/lib64 and list the GLX libraries by running:
ls -l libGLX_*
Search in the list the symbolic link 'libGLX_indirect.so.0'. Usually it points to the NVIDIA libGLX library. Change the link to point to the Mesa library:
Verify if libGLX_mesa library exists:
ls -l libGLX_mesa.so.0
Move the link to the Mesa library:
ln -snf libGLX_mesa.so.0 libGLX_indirect.so.0
Check if variable
__GLX_VENDOR_LIBRARY_NAME is set in the environment:
env | grep GLX_VENDOR
If variable is set to "nvidia" you need to edit file /usr/NX/node.cfg and change the NoMachine desktop startup command in order to clear variable or force it to "mesa":
DefaultDesktopCommand "/etc/gdm/Xsession 'env __GLX_VENDOR_LIBRARY_NAME=mesa XDG_SESSION_TYPE=x11 gnome-session --session=gnome'"
Second solution - Enable VirtualGL
By enabling the VirtualGL support, it's possible to use the graphics card (GPU) for rendering the desktop.
More details are available here: https://www.nomachine.com/AR05P00982
Execute the following procedure from a terminal.
1)Setup VirtualGL on the system:
sudo /etc/NX/nxserver --virtualgl-install
2) Restart the display manager:
systemctl restart gdm
3) Edit /usr/NX/etc/node.cfg and change DefaultDesktopCommand and CommandStartGnome keys to have:
DefaultDesktopCommand "/etc/gdm/Xsession 'env XDG_SESSION_TYPE=x11 /usr/NX/scripts/vgl/vglrun gnome-session --session=gnome'"
CommandStartGnome "/etc/gdm/Xsession 'env XDG_SESSION_TYPE=x11 /usr/NX/scripts/vgl/vglrun gnome-session --session=gnome'"
4) Keep the EnableVirtualGLSupport key disabled (default):
A: How to find which renderer is in use
In the NoMachine virtual desktop session, open a terminal and launch the command:
$ glxinfo | grep -i "direct rendering|opengl renderer"
If LLVMpipe and direct rendering are enabled, you'll get this:
direct rendering: Yes
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
B: How to check if libglvnd is installed
Use the command:
yum list installed libglvnd*
rpm -qa libglvnd*
C: How to check if GNOME is accelerated by VirtualGL
In the remote session, open a terminal and launch the command:
you should get a result similar to:
To check that acceleration is effective, run
glxinfo | grep -i "direct rendering|opengl renderer"
It is expected that the OpenGL renderer string reports the name of the graphics card, e.g.:
direct rendering: Yes
OpenGL renderer string: Quadro K600/PCIe/SSE2