As usual, select “Connect to host” and enter the server address of HPC (or if you have it in your .ssh/config file, simply select the name you assigned to the HPC address)

Untitled

<aside> ⚠️ If you are on Mac, at this point you just need to input the OTP token in the password prompt and you’re logged in. If this does not work, continue reading.

</aside>

[SOLVED] Hanging Password Prompt

Sometimes the password prompt hangs (I’ve seen this problem on Windows). To fix this,

  1. Ignore the vscode password prompt, click “details” in the bottom left corner

    Untitled

  2. It will show you the terminal, enter your password and OTP here directly

    Untitled

  3. MOST IMPORTANTLY, the prompt will hang there forever, giving you a sense that you are not logged in. But if you just click it and press enter (without entering anything), it will disappear after a few times. If you are at this stage, you are already in, then you can select the directory you want to work in directly.

    Untitled

[Trouble Shooting] Common VSCode Errors

Sometimes your VSCode gets stuck and fails to ssh into your HPC. The best way to solve this issue is always to click on vscode ‘details’ while connecting to the HPC and keep an eye on the error code. Here are some common errors.

  1. Exit 15

    This error code means your VSCode has failed to ssh into the HPC within 15 seconds, and you will receive a timeout. This is common for people working remotely, especially when you are traveling in other continents.

    Firstly, please try to use CL or other university-maintained VPN service.

    If this doesn’t help, you can use ctrl+shift+p to search for ssh settings and manually set a longer timeout time (e.g. 60 seconds). You can follow the detailed guide in this stack overflow post https://stackoverflow.com/questions/59978826/why-ssh-connection-timed-out-in-vscode.

  2. No space left on device

    image.png

    Another typical error is shown in the figure above. VSCode attemps to write a log file at your /home directory every time you login. If your /home directory is full, you cannot use VSCode as well.

    Please refer to https://docs.hpc.cam.ac.uk/hpc/user-guide/io_management.html#disk-quotas to manage your disk quota wisely. For my dear NLP colleagues, this is commonly triggered, as pip, conda and especially huggingface caches large language models and other packages directly at /home/.cache. If you get this error, ssh into your HPC account by terminal, clear your cache, and redirect the default caching directory into your ~/rds/hpc-work and export them to ~/.bashrc.

Yeah, if you have any other questions or want to contribute to this blog feel free to contact us.