Skip to content

VSCode#

Do not run VSCode on the login nodes

Do not run code or vscode-server on the login nodes. The additional processes can overload these shared resources, leading to slow response times and potential system instability.

SSH extension#

You may already be used to working with VSCode on your local computer while connected to our cluster via VSCode's SSH extension. Please do not connect your VSCode to the clusters' login nodes. VSCode was not designed for shared login nodes. Its behaviour, multiplied by the number of VSCode users on each login node, causes noticeable slowdowns for all users.

We recommend that you connect your VSCode to a compute node using a Slurm allocation instead. You will have access to more resources — login nodes limit each user to a single CPU core and 8 GB of RAM. Processes that VSCode leaves running in the background will be automatically terminated at the end of your allocation. And this will spread the load of supporting the thousands of VSCode processes that used to run on our login nodes onto many compute nodes.

Start VSCode on a compute node#

VSCode SSH timeout

You should increase VSCode's SSH timeout to give Slurm enough time to grant you an allocation on a compute node. We recommend a value of 5 minutes.

Open VSCode's SSH settings

You can configure SSH on your local machine (~/.ssh/config) to enable VSCode to connect directly to a compute node.

Host vscode.jed.cluster
    ProxyCommand ssh jed.hpc.epfl.ch "salloc --nodes=1 --mem=8G --cpus-per-task=2 --ntasks-per-node=1 --job-name=vscode --time=8:00:00 --deadline=now+485minutes bash -c 'exec 3<>/dev/tcp/\$SLURM_NODELIST/22; cat <&3 & cat >&3'"

Host vscode-h100.kuma.cluster
    ProxyCommand ssh kuma.hpc.epfl.ch "salloc --nodes=1 --mem=8G --cpus-per-task=2 --ntasks-per-node=1 --gres=gpu:1 --partition=h100 --job-name=vscode --time=8:00:00 --deadline=now+485minutes bash -c 'exec 3<>/dev/tcp/\$SLURM_NODELIST/22; cat <&3 & cat >&3'"

Host vscode-l40s.kuma.cluster
    ProxyCommand ssh kuma.hpc.epfl.ch "salloc --nodes=1 --mem=8G --cpus-per-task=2 --ntasks-per-node=1 --gres=gpu:1 --partition=l40s --job-name=vscode --time=8:00:00 --deadline=now+485minutes bash -c 'exec 3<>/dev/tcp/\$SLURM_NODELIST/22; cat <&3 & cat >&3'"

Host *.hpc.epfl.ch *.cluster
    User YOUR_EPFL_USERNAME
    ServerAliveCountMax 3
    ServerAliveInterval 30

Passwordless SSH required

The ProxyCommand forwards your local SSH connection to the compute node, which only accepts public-key authentication. If you do not have an SSH key set up, VS Code will fail with Permission denied (publickey,hostbased). Please follow the dedicated documentation to generate a key and copy it to the cluster before connecting. The key must be generated on your local machine, not on the cluster.

You can then ask VSCode to connect to vscode.jed.cluster, vscode-h100.kuma.cluster, or vscode-l40s.kuma.cluster to connect to a compute node from Jed, Kuma's h100 partition, or Kuma's l40s partition respectively. The ProxyCommand will request an allocation and forward VSCode's connection request to the allocated node.

Resources

Please note that the ProxyCommands above request a small amount of resources for 8 hours. You may adjust the parameters to the salloc command according to your needs.

Ending your session

To avoid paying for resources you no longer need, you should cancel your vscode jobs once you no longer need them. You can use the following command on a login node to cancel all your VSCode jobs on this node's cluster.

scancel --me --ctld --name=vscode

OnDemand app#

A VSCode server app is available on our OnDemand service.

Sync Settings

It is currently not possible to synchronise your VSCode settings when using the OnDemand app. We are aware of the issue and working towards a fix.