Intel® DevCloud for oneAPI

Overview Get Started Documentation Forum external link

Using Visual Studio Code* with DevCloud

To get started with Microsoft Visual Studio Code* and establishing a connection to Intel® DevCloud follow the instructions below.

Connect to DevCloud with Visual Studio Code

  1. Setup your SSH Config

    Option 1: Automated Configuration (Recommended)

    The easiest method to set up an SSH connection to is by downloading and running an automated installer. The installer will add SSH configuration entries to ~/.ssh/config and create a private SSH key file inside ~/.ssh.

    1. Download and save the automatic installer script customized for your account
    2. Execute this script in a terminal window (you may need to adjust the command according to your download location and the downloaded file name):
      bash ~/Downloads/setup-devcloud-access-<user>.txt
    3. Clean up for security:
      rm ~/Downloads/setup-devcloud-access-<user>.txt

    Option 2: Manual Configuration

    1. Download and save the SSH access key for Linux/macOS to the folder ~/Downloads/ on your computer
      * Sign In to see the download link.
    2. Create the directory ~/.ssh, unless it already exists and move the private SSH key into permanent storage in ~/.ssh:
      mkdir -p ~/.ssh
      mv ~/Downloads/devcloud-access-key-<user>.txt ~/.ssh/
      If you saved your key in a location other than ~/Downloads/, insert the correct path.
      * Sign In to see the value of <user> for your account.
    3. Add the following lines to file ~/.ssh/config (if you do not have this file, simply create one):
      Host devcloud
      User  <user>
      IdentityFile ~/.ssh/devcloud-access-key-<user>.txt
      ProxyCommand ssh -T -i ~/.ssh/devcloud-access-key-<user>.txt
      Note: if you have multiple accounts on the Intel DevCloud, you can change the hostname devcloud to any other identifier to differentiate between your accounts. This is the hostname that you will use in the ssh and scp commands.
      * Sign In to see the value of <user> for your account.
    4. Set the correct restrictive permissions on it and on the SSH client config file. To do this, run the following commands in a terminal:
      chmod 600 ~/.ssh/devcloud-access-key-<user>.txt
      chmod 600 ~/.ssh/config
      * Sign In to see the value of <user> for your account.
    Note : If you Are Behind an SSH Proxy

    In the interest of security, some business networks require that all outgoing connections are established via a corporate proxy. If you followed the instructions above but are getting the error "Connection timed out", you are likely on such a business network. To comply with the security rules of your company, modify ~/.ssh/config as below:

    Host devcloud
    User  <user>
    Port 4022
    IdentityFile ~/.ssh/devcloud-access-key-<user>.txt
    ProxyCommand ssh -T devcloud-via-proxy
    Host devcloud-via-proxy
    User guest
    IdentityFile ~/.ssh/devcloud-access-key-<user>.txt
    LocalForward 4022 c009:22
    ProxyCommand nc -x <proxy_name>:<port> %h %p

    Here, <proxy_name> and <port> are, respectively, the hostname and port of the corporate proxy. It is usually provided to you by your IT department.

  2. Download, install, and launch Visual Studio Code* (VS Code*). If you already have installed you can skip this step.
  3. Install Remote – SSH Extensions from the Visual Studio Marketplace*
    • Click the left menu icon for Extensions
    • Search for Remote — SSH
    • Install the Remote — SSH Extension SSH extension installation
  4. Set Remote Connection Panel to SSH Targets
    1. Go to icon on the left side bar for Remote Connections
    2. Remote Explorer should be set to SSH Targets SSH targets setting
  5. Configure SSH Connection for VS Code* for your OS:
    • Windows — Cygwin*
      • Set SSH Config Path
        • Hover over SSH Targets and click the gear icon
        • Click Settings to select SSH Config
        • Find your SSH Config in open menu. The Cygwin default location is located at: C:\cygwin64\home\<user>\.ssh\config
        • Click Refresh icon on SSH Targets Bar
      • Set SSH Executable
        • Go to VS Code* File -> Preferences -> Settings
        • Search Settings for ssh.path and locate Remote.SSH: Path
        • Set this value to your Cygwin executable. Default value will be C:\cygwin64\bin\ssh.exe
    • Linux and macOS
      • Set SSH Config Path
        • By default, it should already be pointing to ~/.ssh/config. If not, follow the below instructions.
        • Hover over SSH Targets and click the gear icon
        • Select your SSH Config location from default locations
        • If you have a custom location, click Settings, and find your configuration, then click the refresh icon
  6. Request a compute node
    • Open a new terminal and SSH to devcloud
    • Enter the following command qsub -I to acquire a compute node as shown below. Tip: If you need a specific hardware type look at our other documentation for specifying a hardware type using qsub
    • Copy your compute node name indicated on the command line prompt, shown below, as this will be used in the next step for port forwarding requesting a compute node
  7. Port Forwarding
    • Open a new terminal
    • Execute the following command:
      ssh <compute-node-name>.aidevcloud
      Example: If your compute node hostname is s001-n059, you would execute the following command:
      ssh s001-n059.aidevcloud
      Port Forwarding
  8. Connect VS Code* to Intel DevCloud
    • Hover over the devcloud-vscode server entry (as shown below) and on the far right of the highlighted entry there should be an icon that will allow you to connect to the server clicking the connect icon
    • Click the icon to connect. By Default, a new VS Code* Instance should open and connect you to the server
  9. Connected to Intel DevCloud
    • You are now connected to the login node of the DevCloud. You can verify this by checking for the SSH Config name, SSH:devcloud-vscode, in the lower-left corner.

Sample Browser for Intel® OneAPI Toolkit Extension on DevCloud

The Sample Browser for Intel OneAPI Toolkits Extension allows you to view code samples directly in Visual Studio Code*. Learn how to install the extension and download your first sample below.

  1. In the Extensions Panel, search for OneAPI and you will find several extensions
  2. Install the Sample Browser for Intel OneAPI Toolkits extension by clicking the Install button
  3. This extension requires a reload of VS Code*, you can do this by clicking on the Reload Required button that appeared next to the install button
  4. Click on the OneAPI extension icon on the left sidebar shown below: clicking the OneAPI extension icon
  5. Download your first sample
    Let’s choose Get Started -> Vector Add sample by following the sequence 1 and 2 shown below
    1. Hover over the sample name and on the far right of the name you will see a plus button appear.
    2. Click on the plus button and you will see a prompt for where you want the sample to be located in.
    Tip: Whichever folder you select, the files will be placed directly in that folder. It is helpful to create a folder with a relevant folder name before selecting a sample so your home directory doesn’t become cluttered. choosing location of sample
Disconnect Visual Studio Code* from DevCloud

Once completed working on DevCloud you can close the remote connection by selecting File -> Close Remote Connection from the VS Code* menu. Alternatively, click the remote-ssh notification in the lower-left corner of the VS Code* window that says SSH:devcloud-vscode and select Close Remote Connection from the list of Remote-SSH commands