== Graphical Login (VNC) [[PageOutline]] {{{#!table style="border:none; text-align:left; margin:0px" {{{#!th align=left,style="border: none" [[Image(https://upload.wikimedia.org/wikipedia/en/thumb/5/51/Virtual_Network_Computing_%28logo%29.svg/220px-Virtual_Network_Computing_%28logo%29.svg.png,100px, align=left, margin=0, link:vnc3d)]]\\ [[Image(http://www.virtualgl.org/pmwiki/uploads/Main/virtualgl.gif, 200px, align=left, margin=10, link=wiki:vnc3d)]] }}} {{{#!th align=left,style="border: none" Remote visualization, either implemented within visualization applications themselves or through server software, \\ eliminates the need for off-site file transfers and allows HPC users to run a broad range of visualization tools \\ in-place on the supercomputer where the data resides and more compute resources are available. A graphical login using Virtual Network Computing (VNC) simplifies the access to remote visualization. \\ A broad variety of Linux applications with graphical user interface and/or need for OpenGL can be used directly on the supercomputers via VNC. }}} }}} VNC provides a complete graphical and remote desktop by \\ * transmitting the keyboard and mouse events from your computer to the remote machine and \\ * relaying the graphical screen updates back in the other direction. VNC is * platform-independent (VNC viewers are available for almost any operating system) * application-independent (no need for remote visualization support inside the application) * multiple clients may connect to a VNC server at the same time sharing the same session (support, presentation, group discussions) VNC software used at the JSC: * '''[http://www.turbovnc.org TurboVNC]''' * JSC will focus on TurboVNC 2.x as it is optimized for use with VirtualGL. * '''For best performance''' do not use any other VNC viewer! * [http://tigervnc.org TigerVNC] * Software (unaccelerated) OpenGL support (TurboVNC requires VirtualGL in order to run OpenGL applications) * multi-display (Xinerama) support (slated for TurboVNC 2.1) == ... using VNC VNC follows a very general approach, where a remote graphical desktop on one node of the remote cluster is started. \\ On the user's workstation only a lightweight VNC viewer has to be installed. \\ The graphical screen of the remote desktop is send as an image from the cluster to the viewer on the fly. The user can work with this remote graphical desktop in the usual way, just by interacting with keyboard and mouse. \\ This is a very convenient way to work on a remote machine, not only for data visualization. ==== hardware accelerated rendering (OpenGL) [[Image(https://upload.wikimedia.org/wikipedia/commons/thumb/6/67/X11transport.png/600px-X11transport.png, 100px, align=right, margin=0)]] Whenever an OpenGL capable visualization software, like !VisIt, is started on the remote cluster node, \\ OpenGL commands can be redirected to the GPU of this node with the help of [http://www.virtualgl.org VirtualGL] (using the command '''vglrun'''). \\ This way the hardware accelerated rendering capabilities of a cluster node (if available) can be exploit for remote rendering. \\ (attention: __without__ VirtualGL software, rendering using the CPU instead of the GPU must be used (if available), which is much slower). [[Image(Trac_Setup_VNC.png, 640px)]]\\ The following steps are necessary to start a VNC session for remote rendering with !VisIt on JURECA. Please notice that the VNC server is only available on vis-nodes! ==== prerequisite: Create a VNC password and a startup script on JURECA This step is a prerequisite for using VNC and has only to be done '''once'''. The aim of this step is to create a VNC password and a very small (one line) VNC startup script to start the [http://www.xfce.org/?lang=en Xfce] desktop environment. \\ As all VNC related commands are only available on a vis-node, one has to allocate a vis-node first and then start an interactive shell and execute the necessary commands there. \\ It works as follows: {{{ #!sh # request allocation on visualization node ('vncpasswd' only available on vis-nodes) salloc -N 1 -p vis --gres=gpu:0 # spawn interactive application 'bash' on the visualization node srun -n 1 --pty /bin/bash -i # create .vnc directory in HOME mkdir ~/.vnc cd ~/.vnc # create VNC password for later authentication when connecting VNC viewer with VNC server vncpasswd # -> type in your VNC password (which will be stored in ~/.vnc/passwd) # create/overwrite xstartup-script echo "exec startxfce4" > ~/.vnc/xstartup # exit job and release allocation exit exit }}} === 1. Start VNC server on a vis node Open an ssh shell on a login node of JURECA the usual way.\\ salloc is used to request an allocation. When the job is started, a shell (or other program specified on the command line) is started on the submission host (login node). From the shell srun can be used to interactively spawn parallel applications. The allocation is released when the user exits the shell. To allocate a vis node with 512 GByte main memory for one hour, use: {{{ #!sh # request allocation and spawn VNC server on visualization node salloc -N 1 -p vis --gres=mem512,gpu:1 --start-xserver --time=1:00:00 srun -n 1 --cpu_bind=none --gres=gpu:1 vncserver -fg -geometry 1920x1080 }}} * -N 1 -> Set number of requested nodes. * -p vis -> Limit request to nodes from the visualization partition. * --gres=mem512 -> Set the size of main memory per node (mem512 or mem1024). * --gres=gpu:2 -> Set the number of requested GPUs in the range of 0-2. * --start-xserver -> Start an Xserver for usage with VirtualGL. * --time=1:00:00 -> Set the default wallclock time to 1 hour (the maximum is 24 hours). * Please check 'salloc --help' and 'srun --help' for more details. In case the VNC server could successfully be started, you will get an output like: {{{ #!ShellExample > New 'jrc1391:1 ()' desktop is jrc1391:1 > > Starting applications specified in ${HOME}/.vnc/xstartup > Log file is ${HOME}/.vnc/jrc1391:1.log }}} As you have to setup an ssh tunnel (with the correct network port) to the allocated node in step 2, \\ two important informations have to be taken from this output: 1. The allocated node is '''jrc1391''' 1. The number of the VNC display is ''':1''' It is very important to know that the network port of the VNC server depends on this display number. \\ The actual port number is 5900+, therefore port '''5901''' must be tunneled in this case. === 2. Tunnel VNC traffic to workstation Now you have to open an ssh tunnel from your workstation to this node. \\ The steps to be done depend strongly on your operating system and your setup. '''Linux:'''\\ If your operating system is Linux, just use: {{{ #!ShellExample ssh -4 -N -L 5901:jrc1391:5901 jureca.fz-juelich.de }}} '''Windows:'''\\ In case your operating system is Windows, the setup of the tunnel depends on your ssh client. \\ Here a short overview on how-to setup a tunnel with [http://www.putty.org/ PuTTY] is given. It is assumed that PuTTY is already configured in a way that a general ssh connection to JURECA is possible. \\ That means that host name, user name and the private ssh key (using PuTTY's Pageant) are correctly set. To establish the ssh tunnel, enter the "SSH-->tunnels" tab in the PuTTY configuration window. \\ You have to enter the source port (in this case 5901) and the destination (in this case jrc1391:5901) and than press add. \\ After pressing add, the tunnel should appear in the list of forwarded ports and you can establish the tunnel by pressing the open button: [[Image(putty2.jpg, 320px)]] [[Image(putty3.jpg, 320px)]] === 3. Connect to the VNC server If you are using Linux, a vncviewer typically is already part of the distribution or can be installed from a repository. \\ For Windows, a VNC viewer can be downloaded for example [http://sourceforge.net/projects/turbovnc/files/ here]. Start your local VNC client and connect to localhost:1, e.g.: {{{ #!ShellExample vncviewer localhost:1 }}} After typing in your VNC password, you will have access to the remote graphical desktop running on the visualization node of JURECA. === 4. Use hardware acceleration in your VNC session Any OpenGL application running in your VNC session should be started with '''vglrun''' to use the hardware acceleration provided by the visualization nodes. ==== e.g. ParaView Open a terminal in your VNC session and: {{{ #!sh # What versions of ParaView are available? module spider ParaView # load ParaView dependency module load intel-para/2015.07 # load ParaView module load ParaView/4.3.1 }}} {{{ #!sh # start ParaView using VirtualGL for hardware acceleration vglrun ParaView }}} ---- any feedback welcomed - [mailto:h.zilken@fz.juelich.de], [mailto:j.goebbert@fz-juelich.de]