Intel® DevCloud for oneAPI

Overview Get Started Documentation Forum external link

Connect to DevCloud with Visual Studio Code

NOTE: Windows users must first download and install Cygwin before proceeding. Once it has been installed, return to this page to configure your connection.

Requirements:

  • Windows users install Cygwin from the installation page
  • VS Code
  • VS Code SSH extension
  • VS CodeDevCloud extension

Cygwin Installation

The Cygwin* environment offers a convenient way of connecting to the Intel® DevCloud from a local machine running Windows*, whether you have a direct connection or find yourself behind a proxy. If you already have Cygwin installed, please skip to the SSH connection instructions.

NOTE: Your Cygwin installation requires the openssh (ssh), nc and nano packages.

The following instructions will help you install a minimal version of Cygwin for accessing Intel DevCloud. For your convenience we’re providing a simple script that automates the installation of Cygwin.

Download install_cygwin.bat from the installation page. It can be run from anywhere on your disk, either by executing it from the terminal or by double clicking on it.

The script uses curl to download the Cygwin setup file. When asked to provide proxy details, you can do so by entering proxy:port when asked, or by simply hitting enter to continue without a proxy.

The default installation path is c:\cygwin64. The script will prompt you to change this if you wish to install elsewhere.

Several Cygwin packages are downloaded during the installation. The script is configured to use mirrors.kernel.org as the default download site. A full list of Cygwin mirror sites can be found on the Cygwin homepage https://www.cygwin.com/.

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.

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. Login to your oneAPI DevCloud account to download and save the installer script customized for your account
  2. Open a shell terminal (Linux, macOS) or a Cygwin Terminal (Windows).
  3. Execute this script in the 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
  4. Clean up for security:
    rm ~/Downloads/setup-devcloud-access-<user>.txt
Option 2: Manual Configuration
  1. 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.
  2. Add the following lines to file ~/.ssh/config (if you do not have this file, simply create one). Be sure to change the “User u#####” line to match your assigned DevCloud username:
    Host devcloud
    User  <user>
    IdentityFile ~/.ssh/devcloud-access-key-<user>.txt
    ProxyCommand ssh -T -i ~/.ssh/devcloud-access-key-<user>.txt guest@ssh.devcloud.intel.com
    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.
  3. 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 your ~/.ssh/config file as below:

Host devcloud.proxy
User  <user>
Port 4022
IdentityFile ~/.ssh/devcloud-access-key-<user>.txt
ProxyCommand ssh -T devcloud-via-proxy

# If you must route outgoing SSH connection via a corporate proxy,
# replace PROXY_HOSTNAME and PORT below with the values provided by
# your network administrator.
Host devcloud-via-proxy
User guest
Hostname ssh.devcloud.intel.com
IdentityFile ~/.ssh/devcloud-access-key-<user>.txt
LocalForward 4022 c009:22
ProxyCommand nc -x <proxy_name>:<port> %h %p
################################################################################################

################################################################################################
# DevCloud VSCode config
################################################################################################
Host devcloud-vscode
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
Hostname localhost
User guest
Port 5022
IdentityFile ~/.ssh/devcloud-access-key-guest.txt
################################################################################################

################################################################################################
# SSH Tunnel config
################################################################################################
Host *.aidevcloud
User guest
IdentityFile ~/.ssh/devcloud-access-key-guest.txt
ProxyCommand ssh -T devcloud.proxy nc %h %p
LocalForward 5022 localhost:22
LocalForward 5901 localhost:5901

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

Verify Your Connection
  1. Open a terminal and connect to DevCloud:
    ssh devcloud
    If your connection is successful, you will see a message similar to this: DevCloud Overview

Connect using SSH

  1. Configure SSH Connection for VS Code* for your OS:
    • Windows — Cygwin*
      • Set SSH Config Path
        • Go to File>Preferences>Settings
        • Search for Remote.SSH: Config File
        • Enter the absolute path to the Cygwin ssh config file. The default location is:  C:\cygwin64\home\<user>\.ssh\config
      • Set SSH Executable Path
        • Go to File -> Preferences -> Settings
        • Search for Remote.SSH: Path
        • Set the absolute path to your Cygwin executable. The default path is: C:\cygwin64\bin\ssh.exe
  2. Connect VS Code* to Intel DevCloud:
    1. Go to File>Preferences>Settings.
    2. Search for DevCloud.
    3. Set connection and Visual Studio Code session settings if needed.Set connection and Visual Studio Code session settings if needed
  3. Press Ctrl+Shift+P ( or View -> Command Palette... ) to open the Command Palette. Type DevCloud and select Intel DevCloud: Setup connection. Press Ctrl+Shift+P ( or View -> Command Palette... ) to open the Command Palette.  Type DevCloud and select Intel DevCloud: Setup connection
  4. Two service terminals will be created with the names: devcloudService1 and devcloudService2. It may take several seconds to create the terminals. Two service terminals will be created with the names: devcloudService1 and devcloudService2. It may take several seconds to create the terminals. NOTE: These are service terminals that are being used to facilite your connection to the oneAPI DevCloud. Do not close them during your DevCloud session; closing them will interrupt your SSH connection to DevCloud.
  5. The second terminal may ask you to add an SSH key fingerprint - type "yes" followed by the “Enter” key. The second terminal may ask you to add an SSH key fingerprint - type yes NOTE: Do not type anything else in the service terminals.
  6. If the connection setup is successful, a message will appear: If the connection setup is successful, a message will appear:
  7. To open an interactive DevCloud terminal you should type Ctrl+Shift+P and choose "Intel DevCloud: New DevCloud Terminal.” To run DevCloud terminal you should type Ctrl+Shift+P and choose Intel DevCloud: New DevCloud Terminal
  8. The DevCloud terminal can use any of the command line operations supported by Intel® oneAPI Toolkits. For example, to browse samples, enter oneapi-cli sin the DevCloud terminal: The DevCloud terminal can use any of the command line operations supported by Intel® oneAPI Toolkits. For example, to browse samples, enter oneapi-cli:
  9. After running a sample, you can use PBS to check the status of your project: After running a sample, you can use PBS to check the status of your project:
  10. Instead of using the command line, you can use the command palette tostart the "Remote-SSH" extension and select the devcloud-vscode option. Instead of using the command line, you can use the command palette tostart the Remote-SSH extension and select the devcloud-vscode option.
  11. You should now be in your DevCloud home folder in an interactive computer node.
  12. For access to documentation type Ctrl+Shift+P and find command Intel Devcloud: Get Help.
  13. End the Connection

    To close your connection to the oneAPI DevCloud and kill your interactive session:

    • Press Ctrl+Shift+P ( or View -> Command Palette... ) to open the Command Palette. Type DevCloud and select Intel DevCloud: Close connection.

Using the Code Sample Browser for Intel® oneAPI Toolkit Extension on DevCloud

The Code 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
    3. Open a new terminal by selecting Terminal>New Terminal.
    4. Open the README.md for instructions on how to run the sample in the VS Code terminal you created.
Disconnect Visual Studio Code* from DevCloud

Once you have completed working on DevCloud, 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.