Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

The native interactive mode mechanism of the job scheduler does not work. Do NOT try commands like ‘qrsh’, ‘qlogin’.

VS Code

VS Code stores data in the user home directory, which is shared across the CSE infrastructure (VLAB, HPC, etc.). Therefore, ensure that you do not run multiple instances of VS Code in different locations simultaneously. If you are or have been running VS Code on VLAB or the login nodes, make sure to exit cleanly and stop all existing processes before proceeding.

While VS Code supports normal Microsoft account, UNSW SSO is NOT supported. To void confusion, here we cover GitHub only.

To establish a remote tunnel session on a compute node, submit the following job:

#!/bin/bash -l

# PLEASE MAKE SURE YOU CHANGE THE FOLLOWING QSUB SETTINGS TO SUIT YOUR NEEDS
#
#$ -j y
#$ -e $JOB_ID_$JOB_NAME.out
#$ -o $JOB_ID_$JOB_NAME.out
#$ -cwd
#$ -N vscode-tunnel
#$ -l mem=15G,jobfs=10G
#$ -V
#

module load vscode/vscode-cli

launch_tunnel

The vscode CLI prints out the instruction in the job’s output file, like below, simply follow the link to get authenticated.

A GitHub account is required for authentication to access the established Remote Tunnels.

$ cat 534_vscode-tunnel.out
Loading vscode - vscode-cli
spawn -ignore HUP /share/apps/noarch/vscode/vscode-cli/code tunnel
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
✔ How would you like to log in to Visual Studio Code? · GitHub Account
To grant access to the server, please log into https://github.com/login/device and use code EFFF-CE86

Open this link in your browser https://vscode.dev/tunnel/wolfpack_zxxxxxx/import/xxxx/x/zxxxxxx/

Once the job prints out the URL, it is ready for connection. Open the vscode on the local computer, and follow these steps.

Reset VS Code

In case thing is broken, please try full reset:

  • qdel the job which is running the VS Code

  • Delete any old processes on other CSE systems (VLAB, lab computer etc)

  • Unregister the broken tunnel

  • Delete the corrupted user data: rm -rf ~/.vscode*

X11 VNC

This process essentially uses SSH tunneling. If you're unfamiliar with SSH tunneling, this resource may be helpful: https://blog.mobatek.net/post/ssh-tunnels-and-port-forwarding/

A graphical interactive session can be obtained by running an x11vnc container. The session can be accessed via the web browser (or VNC client) on the user's local computer, with support for NVIDIA CUDA.

Please use the following submission script as a starting point:

#!/bin/bash -l
#
# PLEASE MAKE SURE YOU CHANGE THE FOLLOWING QSUB SETTINGS TO SUIT YOUR NEEDS
#
#$ -j y
#$ -e $JOB_ID_$JOB_NAME.out
#$ -o $JOB_ID_$JOB_NAME.out
#$ -cwd
#$ -N x11_vnc
#$ -l mem=15G,jobfs=180G # adding more for GPGPU etc etc
#$ -V
#$ -P project_name

module load vnc/x11vnc-nvidia

# By default (if IMAGE_FILE_NAME is not provided), the newest cuda image is used. Other images are available at
#     /share/apps/sif/x11vnc/
# Just provide the image file name as the first argument ($1)
start-vncserver [IMAGE_FILE_NAME]

Submit this script via qsub. The VNC connection information will be available in the job output log and will look like this:

$ cat 295_x11_vnc.out
Loading vnc - x11vnc-nvidia

  ******** SSH TUNNEL INFO ********
  You must setup SSH tunneling on your local computer for connecting.

  For Windows:
  https://blog.mobatek.net/post/ssh-tunnels-and-port-forwarding/

  For Linux or macOS, sample ssh below:

    ssh -L PORT:wp-delta-f03.cse.unsw.edu.au:PORT login.cse.unsw.edu.au

  PORT for web browser: provided by the HTTP URL below

  >>OR<<

  PORT for VNC client: 59xx (see VNC viewer below)

Running: apptainer run  -B /import/reed/8/z3155686 -B /scratch_local/295.1.all.q /share/apps/sif/x11vnc/12.6.1-cudnn-devel-ubuntu22.04-x11vnc.sif
*** Running /sbin/setuser ubuntu $DOCKER_CMD...
Open your web browser with URL:
    http://localhost:6080/vnc.html?resize=downscale&autoconnect=1&password=wxaZpA1o
or connect your VNC viewer to localhost:5900 with password wxaZpA1o

Once SSH tunnel is setup correctly, the interactive session can be accessed via browser, looks like:

Screenshot 2024-09-13 071154.png

CUDA Samples

We can run CUDA Samples for verification purpose. Run the following INSIDE the interactive session:

The compilation will not fully completed but there are enough CUDA binaries can be used for testing.

# switch to the temporary job scratch space on the compute node's local NVMe/SSD storage.
cd /scratch_local/295.1.all.q

git clone https://github.com/NVIDIA/cuda-samples.git
cd cuda-samples
make
Screenshot 2024-09-13 072226.png
  • No labels