Hprc banner tamu.png

Ada:Remote-Viz

From TAMU HPRC
Jump to: navigation, search

Remote Visualization

Introduction

Running applications with graphic user interface (GUI) on Ada 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 Ada through VPN.

An alternative way of running such applications is through remote visualization, an approach that utilizes VNC and VirtualGL to run graphic applications remotely. 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 Ada 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

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 ada and submit a remote visualization job with the vncjob.submit command. If this is the first time you have run a VNC job on ada, 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.    [user1@ada5 ~]$ vncjob.submit 
       WARNING: No /home/user1/.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 939439 has been started, you will see output in the file /home/user1/vncjob.939439.
       You can view the output with the following command when your job starts running:
       
           cat /home/user1/vncjob.939439
       
       For more information about remote visualization on Ada, please visit:
       
           https://hprc.tamu.edu/wiki/Ada:Remote-Viz
    
  3. Check to see if the job has started by using bjobs. In the example below, job 939439 has started running and job 939440 is still pending.
  4.     [user1@ada5 ~]$ bjobs
        JOBID      STAT  USER             QUEUE      JOB_NAME             NEXEC_HOST SLOTS RUN_TIME        TIME_LEFT  
        939439     RUN   user1            vnc        vncjob               1          1     85 second(s)    5:58 L      
        939440     PEND  user1            vnc        vncjob                    -       -   0 second(s)          -     
        [user1@ada5 ~]$ 
    
  5. 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 gpu256-3004 and port number is 5903.
  6. [user1@ada5 ~]$ cat /home/user1/vncjob.939439
       Please wait until the VNC job is started by the batch system..
       Using settings in ~/.vnc/xstartup.turbovnc to start /opt/TurboVNC/bin/vncserver
       VNC batch job id is 939439
       VNC server arguments will be '-geometry 1024x768'
       VNC server started with display gpu256-3004:3
       
       VirtualGL Client 64-bit v2.3.3 (Build 20131014)
       Listening for unencrypted connections on port 4243
       
       
       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 user1@ada.tamu.edu gpu256-3004:3
       
       To access from Windows:
       
           1) Setup a tunnel from your machine to gpu256-3004:5903
       
              1.1) If you use MobaXterm, run the following command in the MobaXterm terminal:
       
                  ssh -f -N -L 10000:gpu256-3004:5903 user1@ada.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 'gpu256-3004:5903'
           
           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 939439
    
  7. Setup an SSH tunnel from your machine and start your VNC client. This is done differently on different operating systems.
  8. 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 Ada. A tunnel will be created between your local host and the remote host on Ada. Keep mobaXterm open until you finish working on the GUI application.
    3.     [local-machine ~]$ ssh -f -N -L 10000:gpu256-3004:5903 user1@ada.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.
          
          user1@ada.tamu.edu's password: 
          [local-machine  ~]$ 
      
    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: gpu256-3004:5903).
    9. Vnc-putty-1.png
    10. Click 'Add'. The tunnel that forwards local port 10000 to the remote node's port (5903 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 'ada.tamu.edu' in 'Host Name'. Login to Ada 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 Ada. A tunnel will be created between your local host and the remote host on Ada. Keep the terminal open until you finish working on the GUI application.
    3.     [local-machine ~]$ ssh -f -N -L 10000:gpu256-3004:5903 user1@ada.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.
          
          user1@ada.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 user1@ada.tamu.edu gpu256-3004:3
          
          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.
          
          user1@ada.tamu.edu's password: 
          [local-machine ~]$ 
      
    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 Ada. 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 Ada. 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 Ada.
    • 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.

Alternative Method: 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. Currently, TAMU OnDemand provides online services to Ada only. In the future, TAMU OnDemand will be developed into a single access point to all TAMU HPRC clusters.

Access the TAMU OnDemand

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

Login with your NetID and password.

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

Advanced Features

Instructions on checking active jobs, composing jobs, and launching Interactive Apps can be found here