Difference between revisions of "GUI Programs"

From UFRC
Jump to navigation Jump to search
 
(74 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Software]]
+
[[Category:Software]][[Category:GUI]]
__TOC__
+
'''The module gui/2 is no longer available. Use this page to know how to use GUI applications on Hipergator.
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 is not as easy as simply running them locally. We try to make the process as smooth as possible. However, we welcome and will listen to feedback. The most difficult part is making sure a remotely running program can be displayed on your local computer as if it were running there and making the interface sufficiently responsive, so you could do your work. We accomplish this task with [https://xpra.org Xpra software] - an open-source multi-platform persistent remote display server and client for forwarding applications and desktop screens. You can read the original [https://xpra.org/trac/wiki/Usage basic usage documentation] and the [https://xpra.org/manual.html full Xpra manual] if necessary.
+
'''
=Install Xpra Software on the Client Computer=
+
__NOTOC__
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:
 
: [[Xpra Windows Installation|Windows]]
 
: [[Xpra MacOS X Installation|MacOS X]]
 
: [[Xpra Linux Installation|Linux]].
 
  
=Start a GUI session on HiPerGator=
+
Here you will find the information necessary to configure and run graphical user interface (GUI) applications on HiPerGator. The process is not complicated, but running a GUI on a remote server and displaying the windows on your local client computer with a sufficiently responsive interface is not as easy as simply running the application locally. We'd like to acknowledge an Open Source [https://xpra.org Xpra Project] for creating software we built our GUI sessions on top of.
==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
+
==X11 Forwarding==
 +
For the simplest case of running a lightweight GUI application for a very short time you can log into HiPerGator with
 +
ssh -Y MYUSER@hpg.rc.ufl.edu
 +
load the environment module your application is in and run it. Do not analyze data this way, but running a text editor, a web browser to log in and get an api token from a remote service or some other very short and lightweight operations are fine.
  
To list applications presets load the gui module and run launch_gui_session -l
+
==Open OnDemand==
module load gui
+
Normally the X11 DISPLAY variable is set once the X11 server is started.  This can be done manually, as described above, but an easier method is to use [https://help.rc.ufl.edu/doc/Open_OnDemand#Display_Environment_on_the_Console Open OnDemand] since that will start an X11 server and allocate the frame buffer automatically.
launch_gui_session -l
 
  
To launch a pre-approved application:
+
[https://openondemand.org/ Open OnDemand] provides a web-only interface to starting and attaching to GUI programs with seamless connections through web browsers. This service is available at the following URL:
  
* Load the gui module if not already loaded
+
https://ondemand.rc.ufl.edu
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|RSTudio Help Page]].
+
{{Note|Many applications have their own interfaces, but other can also be launched by launching a HiPerGator Desktop and then opening the application with the desktop interface.|info}}
For MATLAB options, please see the [[matlab|MATLAB Help Page]].
 
  
;Simple applications
+
===[https://mediasite.video.ufl.edu/Mediasite/Play/4654bfa838624de894085bf54678848f1d Using Open on Demand on HiPerGator]===
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
+
[[File:Play_icon.png|frameless|30px|link=https://mediasite.video.ufl.edu/Mediasite/Play/4654bfa838624de894085bf54678848f1d]] [5 min, 11 sec]
 
+
This video covers the use of Open on Demand https://openondemand.org/ on HiPerGator via https://ood.rc.ufl.edu/.
Load the application environment module if its name is different from the executable name
+
* Connect to https://ood.rc.ufl.edu/
<module load application/version>
+
* Launch a terminal
 
+
* Launch many graphical applications like Rstudio, Matlab and Freeview
Launch the executable in a GUI session
+
* Manage job submission
module load gui
+
* Upload, download and edit files via your browser
launch_gui_session -e <application>
 
 
 
For example
 
launch_gui_session -e molden
 
 
 
or
 
module load gaussian gui
 
launch_gui_session gv
 
 
 
==Provided Job Script==
 
<div class="mw-collapsible mw-collapsed ">
 
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:
 
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
 
</div></div>
 
==Manual launch==
 
<div class="mw-collapsible mw-collapsed ">
 
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
 
<nowiki>#</nowiki>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.
 
</div></div>
 
=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:
 
<pre>
 
Refreshing the session list for jdoe to remove stale sessions
 
 
 
List of active Xpra sessions for jdoe:
 
 
 
Session: i111a-s222.rc.ufl.edu:3713
 
    Job ID: 123456, Name: RStudio
 
    Client command:
 
        xpra attach ssh:jdoe@i111a-s222.rc.ufl.edu:3713
 
        or (downloaded script):
 
        ./xpra attach ssh:jdoe@i111a-s222.rc.ufl.edu:3713
 
 
 
</pre>
 
 
 
See the respective application pages for details and sample job scripts.
 
 
 
=Connect From a Client Computer=
 
Click [expand] on the right side of a section to open that section.
 
==Connecting from outside of UF campus via VPN==
 
<div class="mw-collapsible mw-collapsed ">
 
<div class="mw-collapsible-content">
 
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.
 
</div>
 
</div>
 
==Connecting from Linux==
 
<div class="mw-collapsible mw-collapsed ">
 
<div class="mw-collapsible-content">
 
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
 
    --desktop-scaling=on
 
Resolution, dpi (dots per inch)
 
    --dpi=96
 
 
 
;Manual syntax
 
:$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:
 
testuser@jr-physics:~$ xpra attach ssh:testuser@i21a-s3.rc.ufl.edu:143 --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.
 
</div>
 
</div>
 
 
 
==Connecting from MacOS X==
 
<div class="mw-collapsible mw-collapsed ">
 
<div class="mw-collapsible-content">
 
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
 
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
 
:--desktop-scaling=on
 
;Resolution, dpi (dots per inch)
 
:--dpi=96
 
 
 
Example:
 
./Xpra attach ssh:test-user@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
 
or with the wrapper script in place
 
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.
 
</div>
 
</div>
 
==Connecting from Microsoft Windows==
 
<div class="mw-collapsible mw-collapsed ">
 
<div class="mw-collapsible-content">
 
'''Note:''' this is done '''ON YOUR PERSONAL COMPUTER''' since you will be connecting from it to 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 during [[Xpra_Windows_Installation|client software installation]].
 
 
 
;Example:
 
./xpra attach ssh:test-user@i21a-s3.rc.ufl.edu:143 --desktop-scaling=on --dpi=96
 
or with the wrapper script in place
 
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.
 
</div>
 
</div>
 
=Application Scaling=
 
Xpra applications can encounter scaling issues for may reasons given the complexity of different connections.  If your GUI application's fonts look small, large, or distorted, here are a couple of options that might be helpful.
 
==Desktop Scaling==
 
You can enable desktop scaling on your client by adding a parameter to your local client command.  This command is "desktop-scaling=" and can be set to: on, off, auto, or a fixed value.
 
 
 
;Example:
 
Start a MATLAB GUI session:
 
<pre>
 
$launch_matlab_gui
 
</pre>
 
 
 
From the output copy the client command to your local machine and add the desktop scaling parameter:
 
 
 
<pre>
 
$xpra attach ssh:$USER@i21a-s3.rc.ufl.edu:11764 --desktop-scaling=on
 
</pre>
 
 
 
==DPI==
 
In order to help with font scaling issues, you can pass this parameter to your local installation by adding the dpi= option to your connection command.  This forces a particular DPI to be used if it is supported by both server and client.
 
 
 
;Example:
 
Start a MATLAB GUI session for some high-dpi screens:
 
<pre>
 
$launch_matlab_gui -r 100
 
</pre>
 
 
 
From the output copy the client command to your local machine and add the desktop scaling parameter:
 
 
 
<pre>
 
$xpra attach ssh:$USER@i21a-s3.rc.ufl.edu:11764 --dpi=100
 
</pre>
 
 
 
It can also help to match the client and server dpi settings for some applications.  The -r parameter in the launch_<application>_gui script allows you to set the dpi setting on the server side and then you can connect using the same dpi from the client.
 
 
 
=Problems=
 
==No active Xpra sessions found==
 
If you run into an issue where you get an error such as this when initiating the Xpra session:
 
<pre>
 
Waiting for the job to start as '-n' (nowait) argument was not specified.
 
 
 
The xcrysden job '251751' has started. Listing all active xpra sessions.
 
 
 
Refreshing the session list for USERNAME to remove stale sessions
 
 
 
No active Xpra sessions found for 'USERNAME'
 
</pre>
 
Check to be sure that you are not loading in a different version of python. This will break Xpra as above.
 

Latest revision as of 14:42, 30 January 2023

The module gui/2 is no longer available. Use this page to know how to use GUI applications on Hipergator.


Here you will find the information necessary to configure and run graphical user interface (GUI) applications on HiPerGator. The process is not complicated, but running a GUI on a remote server and displaying the windows on your local client computer with a sufficiently responsive interface is not as easy as simply running the application locally. We'd like to acknowledge an Open Source Xpra Project for creating software we built our GUI sessions on top of.

X11 Forwarding

For the simplest case of running a lightweight GUI application for a very short time you can log into HiPerGator with

ssh -Y MYUSER@hpg.rc.ufl.edu

load the environment module your application is in and run it. Do not analyze data this way, but running a text editor, a web browser to log in and get an api token from a remote service or some other very short and lightweight operations are fine.

Open OnDemand

Normally the X11 DISPLAY variable is set once the X11 server is started. This can be done manually, as described above, but an easier method is to use Open OnDemand since that will start an X11 server and allocate the frame buffer automatically.

Open OnDemand provides a web-only interface to starting and attaching to GUI programs with seamless connections through web browsers. This service is available at the following URL:

https://ondemand.rc.ufl.edu

Many applications have their own interfaces, but other can also be launched by launching a HiPerGator Desktop and then opening the application with the desktop interface.

Using Open on Demand on HiPerGator

Play icon.png [5 min, 11 sec] This video covers the use of Open on Demand https://openondemand.org/ on HiPerGator via https://ood.rc.ufl.edu/.

  • Connect to https://ood.rc.ufl.edu/
  • Launch a terminal
  • Launch many graphical applications like Rstudio, Matlab and Freeview
  • Manage job submission
  • Upload, download and edit files via your browser