Intel Dev Cloud access via SSH for oneAPI

kazi haque
5 min readMay 23, 2022

Connect with Linux/macOS SSH Client

Hey folks, now in the last article, I have discussed in detail accessing Intel Dev Cloud via Jupyter Lab Notebooks in order to execute oneAPI programs, hope you had given a try and liked it.

Now in this article, we are going to learn how to access and connect to Intel Dev Cloud via SSH through Linux/macOS client. You can log in with an SSH client or a file transfer application based on the SSH protocol. This may be a more convenient access mode for advanced users who already have the code base developed, and who want to execute their code on powerful computing resources.

Now, before jumping into the connection of SSH, I’m assuming that all of us have registered ourselves in the Intel Dev Cloud and have an account, if not please follow my earlier article
https://medium.com/@kazithaque22/intel-devcloud-for-oneapi-9900ed626a8f and get yourself registered in the Intel Dev Cloud.

Once done, and signed In, please follow the below steps:

If you are running Linux or a macOS operating system you can access the cluster using the native Secure Shell (SSH) client, you will need to set up SSH tunneling as described below.

Option 1: Automated Configuration:

The easiest method to set up SSH connection 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.

Note: This method works best if you have only one account.

  1. Download and save the automatic installer script customized for your account <your node of Intel Dev Cloud>

Click on the installer button to download (described in Fig1.1):

Fig 1.1

2. Execute this script in a terminal (you may need to adjust the command according to your download location and the downloaded file name):

Code:

bash ~/Downloads/setup-devcloud-access-100931.txt

3. Clean up for security:

Code:

rm ~/Downloads/setup-devcloud-access-100931.txt

Connect

After the preparation steps above, you should be able to log in to your login node in the Intel® DevCloud without a password.

Code:

ssh devcloud

Note:Upon the first login, you will be asked to add the hostdevcloud to the list of known hosts. Answer “yes”:

The authenticity of host ‘devcloud’ (<no hostip for proxy command>)’can’t be established.

Terminal Output (Fig 2.1):

Fig 2.1

Next time you log in, you will only need to type ssh devcloud to log in:

Code:

ssh devcloud

Terminal Output (Fig2.2) :

Fig 2.2

Option 2: Manual Configuration

Alternatively, if you do not want a script to modify your SSH configuration, you can proceed with manual installation instructions below.

Direct SSH Connection

  1. Download and save the SSH access key for Linux/macOS to the folder ~/Downloads/ on your computer
Fig 3.1

2. Create the directory ~/.ssh, unless it already exists and move the private SSH key into permanent storage in ~/.ssh:

Code:

mkdir -p ~/.ssh
mv ~/Downloads/devcloud-access-key-100931.txt ~/.ssh/

If you saved your key in a location other than ~/Downloads/, insert the correct path.

3. Add the following lines to file ~/.ssh/config (if you do not have this file, simply create one):

Code:

Host devcloud
User u100931
IdentityFile ~/.ssh/devcloud-access-key-100931.txt
ProxyCommand ssh -T -i ~/.ssh/devcloud-access-key-100931.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.

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-100931.txt
chmod 600 ~/.ssh/config

Connect

After the preparation steps above, you should be able to log in to your login node in the Intel® DevCloud without a password.

Code:

ssh devcloud

Terminal Output (Fig 3.2):

Fig 3.2

Great, so now we are connected to the Intel Dev Cloud node via SSH Client, now let’s run a small (universal) Hello World Sample program to confirm that we are connected to oneAPI DevCloud

  1. CPU/GPU Vector-Add Sample Walkthrough

a. Connect to the DevCloud.

Code:

ssh devcloud

Terminal Output:

Fig 4.1

b. Download the samples.

Code:

git clone https://github.com/oneapi-src/oneAPI-samples.git

Note: From the github repo of oneAPI-samples, we can downlod and run from so many samples.

c. Go to the vector-add sample.

Code:

cd oneAPI-samples/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add/

Terminal output:

Fig 4.2

Voila! We could access the sample and execute the programs in Intel Dev Cloud via SSH

Now, there are multiple ways you can execute your programs like by Build and Running the different programs in Batch Mode by creating Job scripts, which we will discuss in the later series of articles.

Also, we will touch upon FPGA based Hardware execution of oneAPI programs and discuss about a very interesting series about SYCL which is a higher-level programming model to improve programming productivity on various hardware accelerators.

And yeah, last but not the least,

Please visit this link for an interesting Blogathon

and also exciting prizes to be won!!!

About me:

I am an Intel Certified Instructor for one oneAPI track along with oneAPI Innovator. Please explore the below links for my bio and feel free to reach me in case of any queries.

--

--