# Connecting to CSD3 via TurboVNC (3D Visualisation)¶

Important

The current graphical visualisation nodes, login-gfx1 and login-gfx2, will retire at close of play on Tuesday 18th May 2021.

The function of providing 3D visualisation-capable remote desktops will move to a subset of Wilkes2 (NVIDIA P100) nodes. This is available now - please see the section below describing startgfx.

Non-graphical desktops (i.e. not requiring hardware-accelerated 3D) will continue to be possible on the login, login-cpu and login-gpu nodes.

## Starting a new VNC session¶

The recommended form of remote desktop uses the freely downloadable software TurboVNC. This is because TurboVNC, which is centrally installed on CSD3, contains an improved codec for better transmission of rapidly varying 3D images. Hardware accelerated 3D (see below) will still work with other forms of VNC (or e.g. X2Go), although in these cases the performance may be decreased depending on the codecs available for compressing and decompressing the desktop images.

Since 3D visualisation-capable graphics cards are only attached to a subset of nodes, in order to use 3D the TurboVNC server should be started on one of these nodes. Please see the startgfx section for instructions for launching and managing these specialised remote desktops, however the general descriptions of first-time password setting and the SSH-tunnel method of connecting to the remote desktop that follow remain applicable in the 3D case. You will probably wish to try creating a non-graphical remote desktop initially.

If you don’t plan to make use of 3D graphics, then you should launch a VNC session on an ordinary login node as follows.

To start a VNC session, first ssh/PuTTY in your usual way to a CSD3 login node. Obviously it is best to choose a relatively non-busy node (the commands top or w will display current system load). Then do:

vncserver


(where in the default environment this will refer to the correct version of VNC).

The vncserver command will start a VNC session on the next available display number. The name of the display will be reported by the vncserver command in the form hostname:N where N is the display number. You will need to note the display number, and also remember the hostname in order to connect to the correct desktop later.

Note that vncserver -list will list active sessions belonging to you which are running on the same node, and -kill can be used to terminate a specified display number (for the 3D desktops, the showgfx and killgfx special commands make this easy).

Having launched a VNC session on a login node, it is possible to log out of CSD3 while leaving the session, and applications within the session, running and to reconnect to it later, perhaps from a different location. Please try not to create multiple sessions on different nodes by accident - there is no reason for anyone to have more than one operating at a time since a single virtual desktop can display applications running on any CSD3 node (like any X windows display).

## Connecting to an existing VNC session¶

This subsection deals with connecting to a pre-existing VNC session from your local client machine. The client software can be downloaded from the web site (.deb and .rpm files for Debian or RedHat-style Linux distributions respectively, .exe for MS Windows, .dmg for MacOSX). For example, to connect to VNC display :N on login-e-10 as user abc123, one might do from Linux:

/opt/TurboVNC/bin/vncviewer -via abc123@login-e-10.hpc.cam.ac.uk localhost:N


where this assumes that the TurboVNC executables have been installed in their default location. This should first prompt for the normal login password to establish an SSH connection to CSD3, then prompt for the VNC password. The VNC connection is being tunnelled automatically through the initial SSH connection.

In the 3D desktop case, the localhost in the above should be replaced by the name of the graphical node running the desktop, and the choice of login node in the specification of the tunnel becomes irrelevant.

## Manually creating a SSH tunnel¶

Some alternative VNC clients also support automatic tunnelling - the role of the login node in these cases may be described as the gateway or jump host.

If automatic tunnelling is not supported by the VNC client, it becomes necessary to perform an additional step in order to manually forward local port 5900+N (where N is the VNC display number) to the same port number at the VNC server host (in the above example, assuming the display number is 1, this would be from local client port 5901 to localhost port 5901 on login-e-10). On the Cygwin or Windows command line (similarly on MacOSX, and indeed on Linux if you wish to avoid the -via option) this tunnel can be created by doing:

ssh -L 5901:localhost:5901 abc123@login-e-10.hpc.cam.ac.uk


(effectively this is what the Linux vncviewer -via option does internally). The equivalent step is also possible with PuTTY. Keeping the login session which this creates open, in the general case with display number N you would then connect your local TurboVNC client to localhost:N. The SSH tunnel ensures that the connection is actually made (securely) to the correct VNC session.

Once again, in the 3D desktop case, the localhost in the above should be replaced by the name of the graphical node running the desktop, and the choice of login node in the specification of the tunnel becomes irrelevant.

If connection is successful, an XFCE desktop session should then appear inside a window on your local machine.

## Using 3D graphics¶

Post-processing of large data sets may require interactive visualisation software using 3D graphics hardware. Such applications are frequently written using the graphics programming standard OpenGL and for usable interactive performance require the services of a real GPU in order to generate images sufficiently quickly. Furthermore, this GPU typically needs to be on the machine running the application - a high quality GPU on your local machine is usually no help. The HPC clusters have a set of graphical nodes, each equipped with multiple NVIDIA GPUs, for this purpose.

In order to use 3D graphics, first establish a VNC session as described in the section startgfx. Then on the remote desktop, launch the graphical application with vglrun, e.g.

vglrun glxgears &


will launch a simple 3D application showing rotating gears. Note that starting such an application without vglrun leads to an error, because the remote desktop by itself cannot process the OpenGL 3D drawing instructions, but the vglrun (which is part of VirtualGL) will intercept and redirect the 3D instructions to the GPU, and paint the rendered images back to the remote desktop.

Note that when using TurboVNC, F8 brings up a useful control panel, including a way to change the level of image compression on the fly which can increase the responsiveness of 3D applications by trading off image quality (the default is tight + perceptually lossless JPEG which is probably fine for the CUDN; from home broadband I generally find tight + medium quality JPEG works better if I am running 3D applications). Note also the Request lossless refresh option which forces an instant update of the desktop without compression (thereby removing any imperfections due to lossy compression). On the Windows client these features are accessed from the top menu bar.

## startgfx¶

The 3D visualisation-capable nodes are now a subset of Wilkes2 P100 nodes. This means that the remote desktop in this case is now running on a non-login node, which changes some details of launching and connecting. Once connected to the remote desktop, usage proceeds as described above in Using 3D graphics.

To simplify launching, locating and terminating 3D remote desktops, there are three commands which can be run from any login node:

startgfx

showgfx

killgfx nodename:displaynumber


As suggested by the names, startgfx will launch a new remote desktop on a random member of the 3D-capable set of nodes, and print out helpful information such how to connect to and how to terminate the desktop.

Note that if this is the first time VNC has been launched by the user, they will be prompted to set one or more VNC passwords, as described in Starting a new VNC session. startfx will also print the version of the vncviewer command line required to connect from Linux or MacOS as described above in Connecting to an existing VNC session, but if using other clients manual configuration of a jump host or SSH tunnel will be necessary as described in Manually creating a SSH tunnel.

startgfx will complain and decline to start a second desktop if it detects that the same node is already running one for the same user, as this is usually wasteful and unintentional.

showgfx will find and list any 3D desktops owned by the same user.

killgfx (or equivalently, stopgfx) will terminate the 3D desktop specified by its node name and display number.