Remote Desktop (VNC) in a batch job
Creating a VNC server inside a batch job
Available queues: general_vnc
The preferred method is to start an interactive job on a GPU node and then once your job starts, you can start the VNC server.
On Mac, you will need the TurboVNC Viewer client (https://sourceforge.net/projects/turbovnc/)
On Windows, you will need the TurboVNC Viewer client (https://sourceforge.net/projects/turbovnc/) and PuTTY (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
Starting the VNC server
First, load the TurboVNC and VirtualGL modules:
module load turbovnc
module load virtualgl
Next, submit an interactive job to the cluster by using the salloc command and specifying the designated VNC queue: general_vnc
salloc --partition=general_vnc --cpus-per-task=2 srun --pty /bin/bash
Once you are granted the job allocation, start your VNC server:
vncserver
On the first time that you run the vncserver command, you will be prompted to enter a VNC password to secure your VNC session. This password can be set to any strong password as desired.
The output of the vncserver command is important: it tells you where to point your client to access your desktop in format hostName:displayNumber
Desktop 'TurboVNC: ssrde-c-404:1 (sscf-silas)' started on display ssrde-c-404:1
In this above example, the hostName is ssrde-c-404 and the displayNumber is 1
Because the compute nodes of our cluster is not directly accessible, you must log in to the headnode (SSRDE) and allow your VNC client to "tunnel" through SSH to the compute node. We will use the obtained hostName and port number (5900 + displayNumber) to create the SSH tunnel.
Creating an SSH tunnel
On Mac, use Terminal to create the SSH tunnel by following this format:
ssh -L <port>:<hostName>.ucsd.edu:<port> <username>@ssrde.ucsd.edu
Using the above example, the command would be:
ssh -L 5901:ssrde-c-404.ucsd.edu:5901 sscf-silas@ssrde.ucsd.edu
On Windows, open PuTTY. For hostname, enter: ssrde.ucsd.edu
Navigate to Connection->SSH->Tunnels
Source port: <port>
Destination: <hostName>.ucsd.edu:<port>
Using the above example, the source port would be 5901 and the destination would be ssrde-c-404.ucsd.edu:5901
Connecting to VNC desktop session
Open the TurboVNC Viewer client, and connect to localhost:<displayNumber>, which will tunnel to the correct node on the SSRDE cluster. The TurboVNC viewer client will prompt you for your VNC password.
Running a batch job
Once you've opened up the vnc session, go back to the terminal where you originally started the vncserver. Your path should look like username@ssrde-c-404. Submit your jobs via this terminal and the GUI output will show up on the vnc session.
Closing VNC desktop session
After you are done using the VNC desktop and before relinquishing the compute node, close the VNC session:
vncserver -kill :<displayNumber>