Remote accelerated graphics with VirtualGL and TurboVNC

In this short blog I would like to do something useful. My supervisor Gábor encouraged me to write a short Quick Start Guide to remote connections. The task we’ll discuss is pretty common – you want to connect to another computer (assuming *NIX server) and see a nice graphical output e.g. form 3D visualization app. A typical scenario in HPC is running visualizations on specialized nodes equipped with high performance graphics hardware and direct connection to a supercomputer’s storage.
There are many options. I will just briefly mention some commercial solutions, like Microsoft Remote Desktop Protocol which works great for connecting to Windows machines (form almost any platform), but lacks accelerated graphics on forks for other platforms servers. Well known TeamViewer doesn’t support 3D graphics at all, Chrome Remote Desktop still needs development and my favorite NoMachine uses protocol that I will describe below.
We will concentrate on session forwarding using VirtualGL and TurboVNC.
How it works:
Normal X-forwarding sends all X rendering instructions and the client does all the rendering on a CPU. VirtualGL overrides this protocol and renders 3D graphics at the host’s GPU and then send only the rendered 2D images to the client (the scheme is much more complicated).
Or you can utilize this and render everything at host and transfer the image of the desktop via VNC protocol. The Turbo stands for using turbo fast SIMD libraries for jpeg encoding.
For more information and inspiration see links 1, 2, 3.
How to run it example:
Installing VGL on a remote server
on the remote visualization station (needs root):
- get and install packages VirtualGL and TurboVNC from SourceForge
- configure the VGL server and modify the X-server trough command line
sudo vglserver_config
- restart display manager (xdm or lightdm) or just reboot server
sudo /etc/init.d/xdm restart
Installing on your local client
On your local client install the very same packages (needs root):
1. Get and install packages VirtualGL and TurboVNC from SourceForge .
Scenario A – Making VirtualGL connection
This is the easiest choice if you want to run only certain application remotely.
- Establish connection (type in terminal)
vglconnect -s user@graphics-server
e.g.
vglconnect -s jano@vserver.debrecen.hpc.niif.hu
This will make a connection with ssh-encrypted X-forwarding and VGL Image transport. For more detail about options see VirtualGL Reference.
- Run your OpenGL application with
vglrun
commandvglrun application
e.g.
vglrun glxinfo | more
to see OpenGL status or ParaViewvglrun paraview
Scenario B – Making a TurboVNC connection
This is more a complex (and a bit faster) solution for forwarding whole X sessions. More people can collaborate on the same session and it will last even after you close your connection, so you can continue with your work.
- Start a VNC server session on the remote visualization station using the command
vncserver
You will be prompted to set (and confirm) a password. If it was successful, you will obtain something like this
Desktop 'TurboVNC: login:1 (jano)' started on display login:1 Starting applications specified in /home/jano/.vnc/xstartup.turbovnc Log file is /home/jano/.vnc/login:1.log
the important thing here is the last number in the first line (after the colon i.e. login:1) – the display number (
1
in this case), by adding 5900 to it we’ll obtain the port number of the VNC (in this case1 + 5900 = 5901
).You can always check this by using the command
vncserver -list
.You can disconnect now.
- On your local machine, create an ssh tunnel for encrypting the VNC stream by typing
bash
shh -N -q -L 1047:localhost:<display_number> user@serverwhere1047
is the arbitrary free port number and<display_number>
is obtained from previous the paragraph, e.g.ssh -N -q -L 1047:localhost:5902 jano@vserver.debrecen.hpc.niif.hu
. - Now you can start the TurboVNC client on your local machine e.g. running command
vncviewer localhost:1047
If you cannot find the
vncviewer
command, this might help/opt/TurboVNC/bin/vncviewer localhost:1047
Now you just need to type your chosen password for VNC and start the X-session,
- Start the 3D accelerated application with
vglrun
commandvglrun application
e.g.
vglrun glxinfo | more
to see OpenGL status or ParaViewvglrun paraview
. (same as in the Scenario A)
- Start a VNC server session on the remote visualization station using the command
Great information! I am using VirtualGL, but it is hard to find any documents about it.