Hprc banner tamu.png

Terra:Remote-Viz

From TAMU HPRC
Jump to: navigation, search

Remote Visualization

Introduction

Running applications with graphic user interface (GUI) on Terra can be done through X11 forwarding. However, applications that require OpenGL 3D rendering will experience big delays since large amount of graphic data need to be sent over the network to be rendered on your local machine. It is especially problematic if you connect to Terra through TAMU VPN.

An alternative way of running such applications is through remote visualization, an approach that utilizes VNC and VirtualGL to run graphic applications remotely. Remote visualization is made simple by launching a VNC job through the TAMU OnDemand web portal.

TAMU OnDemand

TAMU OnDemand is a web platform through which users can access HPRC clusters and services with a web browser (Chrome, Firefox, IE, and Safari). Its intuitive and easy-to-use interface allows new users to be instantly productive at using the HPRC resources for their research, and at the same time, provides an alternative convenient way for experienced users to access the HPRC resources. The portal has a flexible and extensible design that makes it easy to deploy new services as needed.

Access the TAMU OnDemand for Remote Visualization

All active users have access to TAMU OnDemand, you will be able to shell access all 3 clusters from there. Login with your NetID and password at the address:

     https://portal.hprc.tamu.edu

Select the cluster that you want to work on. You will be taken to the portal's homepage, then at the top, select 'Interactive Apps' and then 'VNC'. Fill in the appropriate job parameters and then launch the job.

If accessing from a network other than the TAMU network, the VPN is needed.

Alternative Method: vncjob.submit

In this approach, you first start a remote visualization job running on one of the compute nodes with a Graphic Processing Unit (GPU). The job will start a VNC server on the compute node. You then create an SSH tunnel between your local machine and the VNC server on the compute node, via an Terra login node. Lastly, you connect to the compute node with a VNC client and launch the GUI application with vglrun. This approach is much faster since VirtualGL redirects all OpenGL commands and graphic data to be processed on the GPU with 3D acceleration, and only the rendered images (which are much smaller in size) are transferred and displayed at the client side.

All remote visualization jobs need to be submitted to the 'vnc' queue. Our staff has created three wrapper scripts to ease the work for our users. The three scripts are listed in the table below.

Command Synopsis Description
vncjob.submit vncjob.submit [-h] [-g MxN] [-m MEM]

[-t type] [-n cores] [-W hours] [-P acct]

Submit a vnc job. Use vncjob.submit -h for help
vncjob.kill vncjob.kill JOBID Kill a vnc job whose id is JOBID
vncjob.list vncjob.list List all your vnc jobs currently in the batch system

Setting Up Remote Visualization Using VNC Script

The following instructions show you how to setup remote visualization in detail. Depending on what kind of operating system is used on your local machine, the procedure of setting up the SSH tunnel is different.

  1. Login to Terra and submit a remote visualization job with the vncjob.submit command. If this is the first time you have run a VNC job on Terra, you will be prompted to enter a VNC password. After that, you you will be asked whether to enter a view-only password, and please answer 'n'.
  2. [ netID@terra ~]$ vncjob.submit 
    WARNING: No /home/netID/.vnc/passwd found.  Running vncpasswd now to set your VNC password.
    Password: 
    Verify:   
    Would you like to enter a view-only password (y/n)? n
    
    Your VNC job has been submitted.
    
    Use the vncjob.list command to list your VNC jobs.
    Use the vncjob.kill command to kill a VNC job.
     
    When VNC job 128129 has been started, you will see output in the file /home/netID/vncjob.128129.
    You can view the output with the following command when your job starts running:
    
        cat /home/netID/vncjob.128129
    
    For more information about remote visualization on Terra, please visit:
    
        https://hprc.tamu.edu/wiki/Terra:Remote-Viz
    
  3. View the output file from the job submitted in step 1. When the job starts running, the content of the output file is similar to the following. Find out the destination host name and port number that will be used to create a tunnel for the far end. In this example, the destination host name is tgpu-0301.cluster and port number is 5902.
  4. [netID@terra ~]$ cat /home/netID/vncjob.128129
    Using settings in ~/.vnc/xstartup.turbovnc to start /opt/TurboVNC/bin/vncserver
    VNC batch job id is 128129
    VNC server arguments will be '-geometry 1024x768'
    VNC server started with display tgpu-0301.cluster:2
    
    VirtualGL Client 64-bit v2.5.1 (Build 20161001)
    Listening for unencrypted connections on port 4242
    4242
    
    WARNING: You have started an interactive/VNC job.  Your job will continue 
             to run until the VNC server is stopped (up to 6 hours).
    
    To access from Mac/Linux, run from your desktop: 
    
        vncviewer -via netID@terra.tamu.edu tgpu-0301.cluster:2
    
    To access from Windows:
    
        1) Setup a tunnel from your machine to tgpu-0301.cluster:5902
      
            1.1) If you use MobaXterm, run the following command in a new MobaXterm terminal
                 (Do not run this command in an active Terra login session):
    
                ssh -f -N -L 10000:tgpu-0301.cluster:5902 netID@terra.tamu.edu
    
            1.2) If you use Putty to set up the tunnel, click SSH' and then click 'Tunnels'.
                 Fill in 'Source port' with '10000' and 'Destination' with 'tgpu-0301.cluster:5902'
    
        2) Start vncviewer on your machine
        
    When running graphical programs in this VNC job, remember to start them using vglrun:
    
        vglrun application
    
    To stop the VNC job:
    
        vncjob.kill 128129
    


  5. Setup an SSH tunnel from your machine and start your VNC client. This is done differently on different operating systems.
  6. Windows

      MobaXterm

    1. Open a NEW MobaXterm tab.
    2. Inside the new tab, copy the command line in the job output file that will be used for creating a tunnel using mobaXterm and press enter. Type your password and login to Terra. A tunnel will be created between your local host and the remote host on Terra. Keep mobaXterm open until you finish working on the GUI application.
    3. [local-machine ~]$ ssh -f -N -L 10000:tgpu-0301.cluster:5902 netID@terra.tamu.edu
      NOTICE: This computer system and data herein are available only for
      authorized purposes by authorized users. Use for any other purpose
      may result in administrative/disciplinary actions or criminal prosecution
      against the user. Usage may be subject to security testing and monitoring.
      Applicable privacy laws establish the expectations of privacy.
      
      netID@terra.tamu.edu's password: 
      
    4. Open VNC Client and enter information.
    5. VNC-Windows.png
      VNC-Windows2.png
    6. Start the GUI application with vglrun. See below for an example using abaqus cae.
    7. VNC-Windows3.png


      PuTTY

    8. Start Putty and click "SSH->Tunnel" in the left side menu as shown in the figure below. Fill in "Source port" with 10000, and 'Destination' with the node/port combination from your VNC job output file (in this case: tgpu-0301.cluster:5902).
    9. Vnc-putty-1.png
    10. Click "Add". The tunnel that forwards local port 10000 to the remote node's port (5902 in this case) is added, as shown in the figure below.
    11. Vnc-putty-2.png
    12. Click "Session" in the left side menu and type "terra.tamu.edu" in "Host Name". Login to Terra with your username and password. A tunnel is then created from port 10000 on your local machine to the port on the remote GPU node. Keep the session open until you finish working on the GUI application.
    13. Vnc-putty-3.png


    14. Open VNC Client and enter information. (Image above)
    15. Start the GUI application with vglrun. (Image above)

    MacOSX

    1. Open a NEW Terminal tab
    2. Inside the new tab, copy the command line in the job output file that will be used for creating a tunnel using MobaXterm and press enter. Type your password and login to Terra. A tunnel will be created between your local host and the remote host on Terra. Keep the terminal open until you finish working on the GUI application.
    3. [local-machine ~]$ ssh -f -N -L 10000:tgpu-0301.cluster:5902 netID@terra.tamu.edu
      NOTICE: This computer system and data herein are available only for
      authorized purposes by authorized users. Use for any other purpose
      may result in administrative/disciplinary actions or criminal prosecution
      against the user. Usage may be subject to security testing and monitoring.
      Applicable privacy laws establish the expectations of privacy.
      
      netID@terra.tamu.edu's password: 
      [local-machine  ~]$ 
      

      Note: Some VNC clients support the vncviewer -via option. If this is the case for you, as an alternative to the method described above, you may use the Linux instructions as well. To see if your VNC client supports the -via option, you can check with "man vncviewer" in your terminal.

    4. Open VNC Client and enter information. (Image above)
    5. Start the GUI application with vglrun. (Image above)


    Note: If port 10000 is already occupied on your local machine, pick another port.
    When you are done, you need to quit MobaXterm or PuTTY. This will end the tunnel and free up the port 10000. Your VNC job will be running for 6 hours. You can kill it before the 6 hours running time ends.

    Linux / Unix

    1. Connect to the VNC server from your local machine by copying the command for Linux/Mac from the output of vncjob.submit (see the sample job output). With the '-via' option, vncviewer will automatically create an ssh tunnel from your local machine to the VNC server on the remote host where your job is running. You will be prompted for the password of your netID first and then the VNC password you setup in step 1. Type in the correct passwords as requested.
    2. [local-machine ~]$ vncviewer -via netID@terra.tamu.edu tgpu-0301.cluster:2
      
      TigerVNC Viewer 64-bit v1.6.0
      Built on: 2016-01-04 15:10
      Copyright (C) 1999-2015 TigerVNC Team and many others (see README.txt)
      See http://www.tigervnc.org for information on TigerVNC.
      NOTICE: This computer system and data herein are available only for
      authorized purposes by authorized users. Use for any other purpose
      may result in administrative/disciplinary actions or criminal prosecution
      against the user. Usage may be subject to security testing and monitoring.
      Applicable privacy laws establish the expectations of privacy.
      
      netID@terra.tamu.edu's password: 
      
    3. Start the GUI application with vglrun. (Image above)

Common Problems/FAQ

Q: Do I need to use remote visualization? Do I need to use remote visualization every time I use A GUI?
A: In general, if you are going to be using (almost) any GUI for anything more than light editing, you should be using remote visualization. If you are using a GUI text editor (like gedit) or are only changing a few parameters, for example, you do not need to use remote visualization.


Q: What VNC client do I use and where do I get it?
A: You can use pretty much any VNC client, it does not matter. A few examples are RealVNC, TurboVNC, and TigerVNC, all of which can be downloaded from the appropriately linked pages.


Q: What does "bind: Address already in use" mean?
A: This error refers to port 10000 already being in use. There are two main causes of this issue.

  • You are trying to SSH to the compute node (the long SSH command to the GPU node) from Terra. This is incorrect, you need to SSH to the compute node from your computer.
    • SOLUTION: open a NEW terminal/tab and do NOT connect to Terra. From the NEW terminal/tab try to SSH again.
  • You have recently used a remote visualization session and have not fully closed your terminal/MobaXterm window so there is still a tunnel between your computer and the compute node on Terra.
    • SOLUTION: You will need to COMPLETELY close out your terminal/MobaXterm window in order to close the connection. After the connection is closed, open a new terminal/MobaXterm window and try to SSH again.