Skip to content

Running GUI jobs

Graphical User Interface (GUI) applications can be run on CREATE HPC using X11 forwarding, allowing interraction with GUI-based software remotely. This guide will walk you through the steps to set up your SSH configuration and run GUI jobs on compute nodes.

Tip

The login-node is not intended for any memory or compute intensive processes, so the X11 software is available on compute nodes via X forwarding

First request resources from the job scheduler and take note of the compute-node your job is running on. For example:

1
2
3
4
k1234567@erc-hpc-login1:~$ srun -p interruptible_gpu --gres gpu --pty /bin/bash -l
srun: job waiting for resources...
srun: job allocated resources...
k1234567@erc-hpc-comp123:~$

Now add the following to your SSH config file ~/.ssh/config on your local machine:

Note

This assumes you have set up a standard SSH configuration for CREATE HPC as recommended in our documentation

1
2
3
4
5
6
Host erc-hpc-comp*
    HostName %h
    ProxyJump create
    User <k-number>
    PubkeyAuthentication yes
    IdentityFile <path-to-same-ssh-key>

Now execute the following command from your local machine with the noted down compute node:

1
ssh -X erc-hpc-comp123

The -X flag enables X11 forwarding for SSH

Testing Visualisation with Python

Create the Python Script

First, create your Python script python_gui_example.py using your favourite text editor:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
# Data for plotting
x = [0, 1, 2, 3, 4, 5]
y = [0, 1, 4, 9, 16, 25]
# Plotting the graph
plt.plot(x, y, marker='o')
plt.title("Simple Line Plot")
plt.xlabel("X-axis")
plt.ylabel("Y-axis")
plt.grid(True)
# Display the plot
plt.show()

Create the Conda Environment & Run the job

Tip

Please refer to our documentation on conda

1
ssh -X erc-hpc-comp123
1
2
3
k1234567@erc-hpc-comp123:~$ conda create -n py-tk python=3.11 matplotlib
k1234567@erc-hpc-comp123:~$ conda activate py-tk
(py-tk) k1234567@erc-hpc-comp123:~$ python python_gui_example.py