Graphic Environment

From HLRS Dgrid
Jump to: navigation, search

For graphical pre- and post-processing purposes there are 8 visualisation nodes installed in the BW-Grid cluster. The nodes are equipped with a nVIDIA Quadro 5800 FX and have 8 GB memory each. Access to the nodes is possible via the special bw-vis queue.

qsub -q bw-vis [other options]

To use the graphic hardware for remote rendering there are currently two ways possible. The first is via VNC which works easily for Windows and Linux.

The second one is via VirtualGL which also works very easy for Linux. For Windows Clients this technique hasn't been tested though it should also work but requires an X-Server running on the Windows client.

VNC Client setup

If you want to use the BW-Grid Graphic Hardware e.g. for graphical pre- and post-processing, on way to do it is via a vnc-connection. For that purpose you have to install the vnc-viewer on your local machine.

VNC Client Installation

Linux

On current Linux distributions it comes as a pre-compiled package. Additionally to the dedicated vnc viewers, e.g. KDE konqueror also offers a vnc viewer, if installed, accessible through an URL like e.g. "vnc:/localhost:10000".

Fedora
Fedora users should install e.g. "vnc" (Version 9) or "tigervnc" (Version 12) through
yum install tigervnc
OpenSuSE
OpenSUSE users should install a package like "tightvnc", "vinagre", "kdenetwork3-vnc", etc. (Version 11.1) through yast.

Windows

To use the vnc-viewer on windows you have to establish a ssh-tunnel to the visualisation nodes. This can easily be done with Putty which is downloadable from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and can be directly executed without installation.

There are two well known vnc-viewers available for Windows, RealVNC and TightVNC, from which we recommend TightVNC 2.0 Beta 1 since it works well with Windows 7 and is available for free also for Windows Vista and Windows 7. (The tests for this manual were made with TightVNC 2.0 Beta 1 on a 64 Bit Windows 7). It can be downloaded from http://www.tightvnc.com/download-beta.php.

Downloads

Running x0vnc-server

VNC Preparation

Before using vnc for the first time you have to log on to the BW-Grid frontend and run

vncpasswd

which creates you a .vnc directory in your home containing a passwd file.

Starting x0vnc-server

Now that you are ready to use vnc load the virtualgl module

module load system/glx/virtualgl

and execute the vis_via_vnc script:

vis_via_vnc.sh XX:XX:XX

where XX:XX:XX is the walltime the visualisation job should be running. If not specified the walltime is set to 1 hour.

The first script vis_via_vnc.sh submits a second one called startvncenv.sh to the BW-Grid bw-vis queue. This may take some time (at least 30 sec.) so please be patient.

The scripts start a x0vnc-server on the compute node and return the IP-address of the node which we need in a moment to set up a ssh-tunnel for the vnc-connection.

Connecting to the x0vnc-server

When the queue job is actually running the IP-address and hostname of the node which is reserved for you are returned by vis_via_vnc.sh

Linux

If you copy the script below to your local machine and execute it with the node name as first argument, it will set up the ssh-tunnel and start the vncviewer with correct arguments. After executing the script you should be asked for your vnc password. Enter it and a vncviewer will come up running a Gnome session.

When the vncviewer terminates, the script will automatically kill the ssh-tunnel process which otherwise has to be done by hand.

bwvnc

#!/bin/bash
#
if [ -z "$1" ]; then
   echo "================================================================================"
   echo "No IP address or node name specified as argument 1 !"
   echo "exit ... "
   exit 1
fi
#
if [ -z "$2" ]; then
   port="10000"
   echo "================================================================================"
   echo "Set port to default = 10000"
   echo " "
else
   port=$2
   echo "================================================================================"
   echo "Set port to non-default = "$2
   echo " "
fi
#
ip_node=$1
#
nodes="n120101:172.30.202.118\nn120102:172.30.202.119\nn120103:172.30.202.120\nn120104:172.30.202.121\nn120105:172.30.202.122\nn120106:172.30.202.123\nn120107:172.30.202.124\nn120108:172.30.202.125"
#
ip_node=`printf ${nodes} | grep "$1:" | sed -e "s/$1://"`
#
echo "================================================================================"
echo "Set IP-address of node $1 to $ip_node"
echo " "
#
# Set up ssh tunnel ------------------------------------------------------------
ssh -N -L${port}:${ip_node}:5900 frbw.dgrid.hlrs.de &
#
sleep 3
#
vncviewer localhost:${port}
#
ssh_proc=`ps ax -o pid= -o cmd= | grep "ssh -N -L${port}:${ip_node}:5900" | awk '{print $1}'`
#
ssh_proc=`echo $ssh_proc | awk '{print $1}'`
#
kill $ssh_proc
#

Alternatively two commands are returned by vis_via_vnc.sh which you can execute on your local machine manually. If you use gsissh and connect to gridway, replace all calls to ssh by gsissh and frbw by gridway.

The first command sets up a ssh-tunnel to the compute node via the frbw or gridway frontend and should look something like this

ssh -N -L10000:172.30.202.125:5900 frbw.dgrid.hlrs.de &

or:

gsissh -N -L10000:172.30.202.124:5900 -p 2222 gridway.dgrid.hlrs.de &

The ip is the one returned by the vis_via_vnc.sh script.

The second command starts the vnc-viewer with a connection to the tunneled local port.

vncviewer localhost:10000

After executing the vncviewer command you should be asked for your vnc password. Enter it and a vncviewer will come up running a Gnome session.

Windows

First of all a ssh-tunnel has to be established to the reserved visualisation node via the BW-Grid frontend. If you use gridway.dgrid.hlrs.de you can establish a connection using the GSISSH-Term. Once you have connected to gridway, you can add a tunnel in the Menu Tools under Secure Tunneling.

GSISSHTunnel.png

To add a new tunnel click on new tunnel and choose outgoing. Choose a free port (in our example 10000 on your local computer), insert the ip address returned by the job started and use 5900 as destination port.

GSISSHTunnel2.png

click on Ok and the channel should be established.

If you connect via frbw.dgrid.hlrs.de you can do the tunnelling with putty as follows:

In the Session category as Host Name specify frbw.dgrid.hlrs.de.

Putty-Session.png

In the Connection -- SSH -- Tunnels category as Source port specify the desired free port on your client over which the connection should be established (e.g. 10000). As Destination specify the IP-address of the visualitsation node outputted by vis_via_vnc.sh trailed with a colon and the port number 5900.

Putty-Connection 3.png

Klick the Add Button to transfer your specification to the list of forwarded ports and select the checkboxes Local ports accept connections from other hosts and Remote ports do the same.Finally select the Open Button to establish the tunnel-connection.

Putty-Connection 2.png

Now the ssh-tunnel should be established and you can run the VNC-Viewer with the Server-connection to localhost:10000.

VNC Viewer 1.png

Click Connect and enter your VNC password

VNC Viewer 2.png

Now your VNC-Viewer should by up running a Gnome session.

Disable screensaver

Inside the vnc window go to system | preferences | screensaver and uncheck the box Activate screensaver when computer is idle.

Ending the vnc-session

If you end your X-session correctly via system ==> log out

VNC Logout.png

the gnome session is shut down and your settings are saved to your BW-Grid home directory. To end your queue job you have to issue the command

qdel your_jobid

if the walltime you specified when calling vis_via_vnc.sh isn't expired already, since the queue job waits for the x0vncserver to terminate. If you haven't been using the bwvnc script on your local client you should also close the ssh-tunnel to the node by killing the corresponding ssh-process.

VirtualGL Setup

To use VirtualGL you have to install it on your local client. It is available in the form of pre-compiled packages at http://www.virtualgl.org/Downloads/VirtualGL. For windows there is a version for cygwin and a binary version for exceed, which can also be used together with Xming.

Linux

After the installation of VirtualGL you can connect to the frontends of bwGRiD via the vglconnect command:

vglconnect -g -s gridway.dgrid.hlrs.de -p 2222

or:

vglconnect -s frbw.dgrid.hlrs.de

Then reserve a visualisation node via the vis_via_vgl.sh script

module load system/glx/virtualgl
vis_via_vgl.sh XX:XX:XX

where XX:XX:XX is the walltime the visualisation job should be running.

For Virtual GL to work with 32Bit applications, /opt/VirtualGL/lib/ has to be in your LD_LIBRARY_PATH, for 64bit applications /opt/VirtualGL/lib64/ has to be in your LD_LIBRARY_PATH. In both cases /opt/VirtualGL/bin has to be in your PATH.

The script vis_via_vgl.sh submits a second one called startvglenv.sh to the BW-Grid bw-vis queue. This may take some time so please be patient.

The scripts return the name of the node reserved for you which is needed to login to the reserved node via vglconnect.

vglconnect -s < node_name >

when you are logged into the node, again load the virtualgl-Module:

module load system/glx

To execute an application you have to start it on the node with the VirtualGL wrapper vglrun. E.g. the FEM pre-processor ANSA

module load cae/beta
vglrun ansa64.sh

If vglrun fails to start, try with the option "-c proxy"

Windows

You need an X server running on your local computer. There is an X-Server package included in cygwin, but if you don't use cygwin, it is probably more comfortable to install Xming or the commercial variant "exceed".

Next, you install either the cygwin version (if you use cygwin) the exceed version otherwise of virtualGL.

If you connect to gridway using GSISSH-Term or to frbw using putty, make sure, you have X-Forwarding enabled (and your X-Server running, of course). Connect to one of the frontends using putty or GSISSH-Term and from there on follow the description for Linux above.

HLRS Stud-Pool

On the HLRS Stud-pool PCs Ubuntu-Linux is provided via a Terminal-Server on which VirtualGL is installed. The procedure to reserve and login onto a visualisation node is the same as described above.

To execute an application with the VirtualGL wrapper vglrun it is necessary to provide the option -c proxy

vglrun -c proxy <application_command>

since otherwise the routing of the X and GL data can't be done correctly by VirtualGL.

Using VirtualGL with TurboVNC

If you want to use VirtualGL in connection with TurboVNC you have to install the TurboVNC-viewer on your local machine. It is available in the form of pre-compiled packages at http://www.virtualgl.org/Downloads/TurboVNC. To start a TurboVNC session go to frbw.dgrid.hlrs.de

ssh frbw.dgrid.hlrs.de

Load the VirtualGL module and reserve a visualisation node for usage of VirtualGL

module load system/glx/virtualgl
vis_via_vgl.sh hh:mm:ss

Where hh:mm:ss is the walltime you want to reserve the visualisation node. Go to the node which was reserved

ssh <node_no>

Where <node_no> is the name of the reserved node issued by vis_via_vgl.sh. On this node you have to start a TurboVNC server which can be done with

module load system/glx/virtualgl
turbovncserver

From your client connect to the TurboVNC server with your TurboVNC viewer with

/opt/TurboVNC/bin/vncviewer -via frbw.dgrid.hlrs.de <node_no>:<display_no>

If you have installed TurboVNC in the standard path. Where <node_no> is again the name of the reserved node issued by vis_via_vgl.sh and <display_no> is the number of the Display returned by the TurboVNC server. Within the opend TurboVNC session you can then start GL applications with the VirtualGL wrapper. In a terminal within the TurboVNC session issue the commands

module load system/glx/virtualgl
vglrun <your_application>