Difference between revisions of "GUI Programs"

From UFRC
Jump to navigation Jump to search
Line 9: Line 9:
 
: [[Xpra Linux Installation|Linux]].
 
: [[Xpra Linux Installation|Linux]].
  
=Start a GUI session on HiPerGator=
+
=Start a GUI Session on HiPerGator=
 
==Single command, no job script==
 
==Single command, no job script==
 
There are two classes of applications that can be started with just one command from the gui environment module and do not require you to provide a job script.
 
There are two classes of applications that can be started with just one command from the gui environment module and do not require you to provide a job script.
  
;Preset applications
+
===Preset applications===
 
+
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
 +
''Expand this section to view instructions for starting preset applications without a job script.''
 +
<div class="mw-collapsible-content" style="padding: 5px;">
 
To list applications presets load the gui module and run launch_gui_session -l
 
To list applications presets load the gui module and run launch_gui_session -l
 
  module load gui
 
  module load gui
Line 21: Line 23:
 
To launch a pre-approved application:
 
To launch a pre-approved application:
  
* Load the gui module if not already loaded
+
* Load the gui module if not already loaded:
 
  module load gui
 
  module load gui
* Launch the application
+
* Launch the application:
 
  launch_<application>_gui
 
  launch_<application>_gui
 +
 +
 
For example:
 
For example:
 
  launch_mzmine_gui
 
  launch_mzmine_gui
or
+
or:
 
  launch_rstudio_gui
 
  launch_rstudio_gui
  
Line 33: Line 37:
 
For MATLAB options, please see the [[matlab|MATLAB Help Page]].
 
For MATLAB options, please see the [[matlab|MATLAB Help Page]].
  
;Simple applications
+
</div>
 +
</div>
 +
 
 +
===Simple applications===
 +
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
 +
''Expand this section to view instructions for starting a simple application without a job script.''
 +
<div class="mw-collapsible-content" style="padding: 5px;">
 
If you want to run a simple application in which either the environment module name matches the name of the program you want to run or you've already loaded the environment module and know the name of the executable then the process is about as simple as launching a preset application
 
If you want to run a simple application in which either the environment module name matches the name of the program you want to run or you've already loaded the environment module and know the name of the executable then the process is about as simple as launching a preset application
  
Line 39: Line 49:
 
  module load <application>/<version>
 
  module load <application>/<version>
  
Launch the executable in a GUI session
+
Launch the executable in a GUI session:
 
  module load gui
 
  module load gui
 
  launch_gui_session -e <application>
 
  launch_gui_session -e <application>
  
For example
+
 
 +
For example:
 
  launch_gui_session -e molden
 
  launch_gui_session -e molden
  
or
+
or:
 
  module load gaussian gui
 
  module load gaussian gui
 
  launch_gui_session gv
 
  launch_gui_session gv
  
==Provided Job Script==
+
</div>
<div class="mw-collapsible mw-collapsed ">
+
</div>
 +
 
 +
==Provided job script==
 
If you need to pass custom arguments to the application, load pre-requisite environment modules and so on you can provide a simple script (linux format text file) with the required commands as an argument to launch_gui_session.  
 
If you need to pass custom arguments to the application, load pre-requisite environment modules and so on you can provide a simple script (linux format text file) with the required commands as an argument to launch_gui_session.  
<div class="mw-collapsible-content">
+
 
 
Make sure to prepend the command that starts the program with xpra_start. For example, a following job script named '''my_molden.sh''' will use the molden/5.0 environment module and start molden with a particular model file:
 
Make sure to prepend the command that starts the program with xpra_start. For example, a following job script named '''my_molden.sh''' will use the molden/5.0 environment module and start molden with a particular model file:
 
  module load molden/5.0
 
  module load molden/5.0
 
  xpra_start 'molden /ufrc/data/tests/molden/boc-iso-1t.gjf'
 
  xpra_start 'molden /ufrc/data/tests/molden/boc-iso-1t.gjf'
  
Now, to launch molden with the above script run
+
Now, to launch molden with the above script run:
 
  launch_gui_session -e molden -f my_molden.sh
 
  launch_gui_session -e molden -f my_molden.sh
</div></div>
+
 
 
==Manual launch==
 
==Manual launch==
<div class="mw-collapsible mw-collapsed ">
+
If you prefer to talk directly to SLURM you can write a full job script complete with resource requirements, job name, output file, etc in the #SBATCH section and submit the script to SLURM manually.  
Of course, if you prefer to talk directly to SLURM you can write a full job script complete with resource requirements, job name, output file, etc in the #SBATCH section you can submit the script to SLURM manually.  
+
 
<div class="mw-collapsible-content">
+
Make sure you use the gui partition:
Make sure you use the gui partition
 
 
  <nowiki>#</nowiki>SBATCH --partition=gui
 
  <nowiki>#</nowiki>SBATCH --partition=gui
 
and wrap your command with xpra_start as shown above.
 
and wrap your command with xpra_start as shown above.
  
 
You can use a job script for one of the application presets found in the '$HPC_GUI_JOB' directory once the 'gui' environment module is loaded as the base of your own job script.
 
You can use a job script for one of the application presets found in the '$HPC_GUI_JOB' directory once the 'gui' environment module is loaded as the base of your own job script.
</div></div>
+
 
 
=List GUI Sessions=
 
=List GUI Sessions=
 
If you performed a manual launch or used the '-w' argument to the automated launcher command you'll have to manually check on your gui job. Check the job status with 'squeue -u $USER'. When the job starts you have to list the available xpra sessions using xpra_list_sessions command in the gui module. This command will refresh the Xpra session list and provide a convenient list of live Xpra sessions as well as client commands that can be copied and pasted into a terminal on the client machine.
 
If you performed a manual launch or used the '-w' argument to the automated launcher command you'll have to manually check on your gui job. Check the job status with 'squeue -u $USER'. When the job starts you have to list the available xpra sessions using xpra_list_sessions command in the gui module. This command will refresh the Xpra session list and provide a convenient list of live Xpra sessions as well as client commands that can be copied and pasted into a terminal on the client machine.
  
;Example
+
;Example:
 
  $ module load gui
 
  $ module load gui
 
  $ xpra_list_sessions  
 
  $ xpra_list_sessions  
Line 92: Line 104:
  
 
=Connect From a Client Computer=
 
=Connect From a Client Computer=
Click [expand] on the right side of a section to open a section specific to the operating system you are running on your local computer.
+
<span style="color:red">'''Servers in the SLURM gui partition are accessible only within the UF campus network.'''</span>
==Connecting from outside of UF campus==
+
 
The servers in SLURM gui partition are accessible only within the UF campus network. If you are working off campus, you will need to use the VPN to connect to the UF campus network using [https://connect.ufl.edu/it/wiki/Pages/glvpn-anyconnect-install.aspx AnyConnect VPN] or similar software. Please see: [https://vpn.ufl.edu https://vpn.ufl.edu] for additional information.
+
If you are working off campus, you will need to use the VPN to connect to the UF campus network using [https://connect.ufl.edu/it/wiki/Pages/glvpn-anyconnect-install.aspx AnyConnect VPN] or similar software. Please see: [https://vpn.ufl.edu https://vpn.ufl.edu] for additional information.
  
==Connecting from Linux==
+
===Connecting from Linux===
<div class="mw-collapsible mw-collapsed ">
+
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
<div class="mw-collapsible-content">
+
''Expand this section to view connection instructions for Linux/Unix.''
 +
<div class="mw-collapsible-content" style="padding: 5px;">
 
Use the client command provided by 'xpra_list_sessions' to connect while adding any local options you need to improve the viewing experience like desktop scaling with <code>--desktop-scaling=on</code> or resolution, dpi (dots per inch) with <code>--dpi=96</code>
 
Use the client command provided by 'xpra_list_sessions' to connect while adding any local options you need to improve the viewing experience like desktop scaling with <code>--desktop-scaling=on</code> or resolution, dpi (dots per inch) with <code>--dpi=96</code>
  
Line 112: Line 125:
 
</div>
 
</div>
  
==Connecting from MacOS X==
+
===Connecting from MacOS X===
<div class="mw-collapsible mw-collapsed ">
+
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
<div class="mw-collapsible-content">
+
''Expand this section to view connection instructions for MacOS X.''
 +
<div class="mw-collapsible-content" style="padding: 5px;">
 
Simply execute the xpra shell script you downloaded during [[Xpra_MacOS_X_Installation|client software installation]]. If not installed, change into the Xpra installation directory before running Xpra executable.
 
Simply execute the xpra shell script you downloaded during [[Xpra_MacOS_X_Installation|client software installation]]. If not installed, change into the Xpra installation directory before running Xpra executable.
 
  cd /Applications/Xpra.app/Contents/MacOS
 
  cd /Applications/Xpra.app/Contents/MacOS
Line 125: Line 139:
 
</div>
 
</div>
 
</div>
 
</div>
==Connecting from Microsoft Windows==
+
 
<div class="mw-collapsible mw-collapsed ">
+
===Connecting from Microsoft Windows===
<div class="mw-collapsible-content">
+
<div class="mw-collapsible mw-collapsed" style="width:70%; padding: 5px; border: 1px solid gray;">
'''Note:''' this is done '''ON YOUR PERSONAL COMPUTER''' since you will be connecting from it to HiPerGator. Do '''not''' run this command on HiPerGator.
+
''Expand this section to view instructions for logging in with Microsoft Windows.''
 +
<div class="mw-collapsible-content" style="padding: 5px;">
 +
'''Note:''' This is done '''ON YOUR PERSONAL COMPUTER''' since you will be connecting from it to HiPerGator. Do '''not''' run this command on HiPerGator.
  
 
Navigate to the install location of xpra (normally C:\Program Files (x86)\Xpra\) .   
 
Navigate to the install location of xpra (normally C:\Program Files (x86)\Xpra\) .   
Line 143: Line 159:
 
</div>
 
</div>
  
==Special Cases (GUI Scaling, Font Issues, etc)==
+
==Special cases (GUI scaling, font issues, etc)==
 
See the [[GUI_Programs_Special_Cases|Special Cases page for GUI Programs]] if you run a program or a local system that requires special care compared to the normal usage.  Some examples of special cases include desktop scaling and DPI issues.
 
See the [[GUI_Programs_Special_Cases|Special Cases page for GUI Programs]] if you run a program or a local system that requires special care compared to the normal usage.  Some examples of special cases include desktop scaling and DPI issues.

Revision as of 21:54, 2 November 2016

You can run GUI Programs on HiPerGator, but running such applications on a remote server within a supercomputer and displaying them on your local client computer as if it were running there and making the interface sufficiently responsive is not as easy as simply running them locally. To accomplish this task we use Xpra software - an open-source multi-platform persistent remote display server and client for forwarding applications and desktop screens. Full information on Xpra can be found in its basic usage documentation and the Xpra manual. Below we show the parts of Xpra documentation relevant to its function of running GUI Programs on HiPerGator.

Install Xpra Software on the Client Computer

Since Xpra is required on both ends of the connection you will have to have it installed on your local computer. Xpra client installation depends on the operating system running on your local machine and may require assistance of a system administrator if you do not have the authority to install new software. Once Xpra is installed on your client computer feel free to skip this step. Installation instructions are specific to the operating system running on your local computer:

Windows
MacOS X
Linux.

Start a GUI Session on HiPerGator

Single command, no job script

There are two classes of applications that can be started with just one command from the gui environment module and do not require you to provide a job script.

Preset applications

Expand this section to view instructions for starting preset applications without a job script.

To list applications presets load the gui module and run launch_gui_session -l

module load gui
launch_gui_session -l

To launch a pre-approved application:

  • Load the gui module if not already loaded:
module load gui
  • Launch the application:
launch_<application>_gui


For example:

launch_mzmine_gui

or:

launch_rstudio_gui

See a full example on the RSTudio Help Page. For MATLAB options, please see the MATLAB Help Page.

Simple applications

Expand this section to view instructions for starting a simple application without a job script.

If you want to run a simple application in which either the environment module name matches the name of the program you want to run or you've already loaded the environment module and know the name of the executable then the process is about as simple as launching a preset application

Load the application environment module if its name is different from the executable name

module load <application>/<version>

Launch the executable in a GUI session:

module load gui
launch_gui_session -e <application>


For example:

launch_gui_session -e molden

or:

module load gaussian gui
launch_gui_session gv

Provided job script

If you need to pass custom arguments to the application, load pre-requisite environment modules and so on you can provide a simple script (linux format text file) with the required commands as an argument to launch_gui_session.

Make sure to prepend the command that starts the program with xpra_start. For example, a following job script named my_molden.sh will use the molden/5.0 environment module and start molden with a particular model file:

module load molden/5.0
xpra_start 'molden /ufrc/data/tests/molden/boc-iso-1t.gjf'

Now, to launch molden with the above script run:

launch_gui_session -e molden -f my_molden.sh

Manual launch

If you prefer to talk directly to SLURM you can write a full job script complete with resource requirements, job name, output file, etc in the #SBATCH section and submit the script to SLURM manually.

Make sure you use the gui partition:

#SBATCH --partition=gui

and wrap your command with xpra_start as shown above.

You can use a job script for one of the application presets found in the '$HPC_GUI_JOB' directory once the 'gui' environment module is loaded as the base of your own job script.

List GUI Sessions

If you performed a manual launch or used the '-w' argument to the automated launcher command you'll have to manually check on your gui job. Check the job status with 'squeue -u $USER'. When the job starts you have to list the available xpra sessions using xpra_list_sessions command in the gui module. This command will refresh the Xpra session list and provide a convenient list of live Xpra sessions as well as client commands that can be copied and pasted into a terminal on the client machine.

Example
$ module load gui
$ xpra_list_sessions 

Output:

Refreshing Xpra session list for jdoe. This could take a while.....

List of active Xpra sessions for jdoe:

Session: i21a-s33.rc.ufl.edu:9626 for RStudio job 2852284
    Client command:
         xpra attach ssh:jdoe@i21a-s33.rc.ufl.edu:9626

See the respective application pages for details and sample job scripts.

Connect From a Client Computer

Servers in the SLURM gui partition are accessible only within the UF campus network.

If you are working off campus, you will need to use the VPN to connect to the UF campus network using AnyConnect VPN or similar software. Please see: https://vpn.ufl.edu for additional information.

Connecting from Linux

Expand this section to view connection instructions for Linux/Unix.

Use the client command provided by 'xpra_list_sessions' to connect while adding any local options you need to improve the viewing experience like desktop scaling with --desktop-scaling=on or resolution, dpi (dots per inch) with --dpi=96

Command
$USERNAME is your UF GatorLink username, $SERVERNAME is the GUI server address, and $PORT is the X11 port.
xpra attach ssh:$USERNAME@$SERVERNAME:$PORT

Example: jdoe@local_computer:~$ xpra attach ssh:testuser@i21a-s33.rc.ufl.edu:12345 --desktop-scaling=on --dpi=96

Note
if you close the application window using the close button in the top right (or left) corner, this will exit your application and terminate your SLURM gui session. Use 'Ctrl+c' key combination in the terminal windows where you ran the xpra attach command to disconnect the session if you plan to reconnect later.

Connecting from MacOS X

Expand this section to view connection instructions for MacOS X.

Simply execute the xpra shell script you downloaded during client software installation. If not installed, change into the Xpra installation directory before running Xpra executable.

cd /Applications/Xpra.app/Contents/MacOS

Use the client command provided by 'xpra_list_sessions' to connect while adding any local options you need to improve the viewing experience like desktop scaling with --desktop-scaling=on or resolution, dpi (dots per inch) with --dpi=96

Example:

xpra attach ssh:test-user@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96

Once the GUI application windows is displayed on your local computer if you close the window using the close button both the application and SLURM gui session will close. If you want to simply detach the session and come back later click on the terminal window where you ran the client command and use the 'Ctrl+c' key combination to detach the session.

Connecting from Microsoft Windows

Expand this section to view instructions for logging in with Microsoft Windows.

Note: This is done ON YOUR PERSONAL COMPUTER since you will be connecting from it to HiPerGator. Do not run this command on HiPerGator.

Navigate to the install location of xpra (normally C:\Program Files (x86)\Xpra\) .

In MobaXterm
cd "/drives/c/Program\ Files\ \(x86\)/Xpra/"

Alternatively, call the xpra shell script you downloaded and installed during client software installation.

Example
xpra attach ssh:test-user@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96

Once the GUI application windows is displayed on your local computer if you close the window using the close button both the application and SLURM gui session will close. If you want to simply detach the session and come back later click on the terminal window where you ran the client command and use the 'Ctrl+c' key combination to detach the session.

Special cases (GUI scaling, font issues, etc)

See the Special Cases page for GUI Programs if you run a program or a local system that requires special care compared to the normal usage. Some examples of special cases include desktop scaling and DPI issues.