Remote development with Visual Studio Code (VSCode) empowers users to tap into the immense computational capabilities of GPU resources located on remote machines, all while benefiting from the familiar and feature-rich environment that VSCode provides on their local workstations. This setup is especially advantageous for tasks such as coding, debugging, and training machine learning models that demand substantial computational prowess.
Getting started is a seamless process. Follow these steps to set up your environment:
- Install Visual Studio Code: Download and install Visual Studio Code. Install Remote-SSH Extension:
- Enhance VSCode functionality by installing the Remote-SSH extension. Optional: Install Remote Development Extension Pack:
If collaboration with other remote extensions within VSCode is anticipated, consider installing the Remote Development extension pack.
- Utilize the quick guide available at https://www.cmc.ca/qsg-fpga-gpu-cluster/ to reserve and access a GPU node.
- Refer to the example below to configure VSCode for accessing the reserved GPU node:
In the example above, you can ssh to the node using the following command:
ssh [email protected] -p 49872
Where yourregisteredcmcemail is your user name and 49872 is the port number of the reserved node allocated to the ssh trafic.
- Upon successful GPU node reservation and SSH access, open VSCode.
- Click on the SSH icon at the bottom left of the VSCode window.
- Select "Connect to Host" from the dropdown menu:
- Choose "Configure SSH Hosts":
- Select your local SSH configuration file to update:
- Edit the file by adding information for the reserved node (e.g., Host, HostName, User, Port):
Host GPUNode
HostName uwaccel.cmc.ca
User yourregisteredcmcemail
Port 49872
Save and close the file C:\Users\yassine.ssh\config
- Click again on the SSH icon at the bottom left of the VSCode window:
Notice the appearance of "GPUNode" in the dropdown menu of SSH hosts:
- Click on the "GPUNode" host. This will connect you to the reserved GPU node:
- Enter your password:
Congratulations! You now have access to the reserved GPU node. Begin your machine learning development on the server:
The Remote VSCode session is structured into three integral components. Firstly, a sophisticated code editor tailored to your language of choice offers a seamless coding experience. Secondly, a dedicated terminal window facilitates tasks such as repository cloning, Anaconda virtual environment activation, and the execution of accelerated GPU-based training. The third component is the Remote Explorer, providing remote access to your files and directories, enhancing overall flexibility and productivity in managing your development environment.
By following these comprehensive steps, you've seamlessly configured VSCode for remote development with GPU resources, unlocking the potential for high-performance tasks such as machine learning development.