Hprc banner tamu.png

Ada:Remote-Viz

From TAMU HPRC
Revision as of 09:18, 29 June 2016 by Cryssb818 (talk | contribs) (MacOSX)
Jump to: navigation, search

Remote Visualization

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. Type '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


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://sc.tamu.edu/wiki/index.php/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' as shown in the figure below. Fill in 'Source port' with 10000, and 'Destination' with 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 is added, as shown in the figure below.
    11. Vnc-putty-2.png
    12. Click 'Session' 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 port 5903 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)