Set Up Remote Target¶
To allow profiling on a remote Linux* system, follow the steps below:
Make sure your target machine meets the requirements.
Configure a paswordless SSH connection between and machines.
If you have GPU and MYRIAD devices on the target machine, configure sudo privileges without a password to enable the DL Workbench to set up devices automatically.
Then proceed to register the remote target in the DL Workbench.
Target Prerequisites¶
Your target system must meet the following requirements:
Note
The provided combination of dependencies versions is recommended. Other combinations are not validated.
Prerequisite |
Requirement |
---|---|
Operating system |
Ubuntu* 18.04 |
Internet connection |
Required |
Default Shell |
Bash* |
Dependencies |
OpenSSH* |
Run the commands below to install the dependencies:
sudo apt-get update
Note
The command below installs the highest versions of the packages. To specify a package version, add =<version>
after the name of a package.
sudo apt-get install -y --no-install-recommends \
openssh-server \
ssh \
python3 \
python3-distutils \
python3-apt \
python3-dev \
python3-pip \
gcc \
libgtk-3-0 \
ffmpeg
python3 -m pip install --upgrade pip
Set Up SSH Connection Using SSH-Keys¶
Perform all steps in this section on your host machine. Choose the option that works for you:
Configure SSH Connection from Linux or macOS* to Linux¶
Note
This option assumes your host machine has the openssh-server
package installed. If not, run the following:
sudo apt update
sudo apt install openssh-server
Step 1 : Generate an SSH key pair with the command below:
ssh-keygen
Save keys to default files and do not use a passphrase.
Step 2 : Copy the public key to the target machine using the command below. Replace USERNAME
with your username on the target machine, and HOSTNAME
with the hostname or IP of the target machine.
ssh-copy-id USERNAME@HOSTNAME
Note
On macOS, install ssh-copy-id
first. Use the command below:
brew install ssh-copy-id
See Ssh-copy-id on Mac for other options.
Step 3 : Verify that you can connect to your target machine without a password by running the command below. Replace USERNAME
with your username on the target machine, and HOSTNAME
with the hostname or IPv4 of the target machine.
ssh USERNAME@HOSTNAME
The command should connect you to the target machine without a password.
If you have MYRIAD or GPU devices on your target, see Configure Sudo Privileges without Password. If you do not have such devices or they are configured correctly, move on to register a remote machine in the DL Workbench.
Configure SSH Connection from Windows to Linux Using OpenSSH¶
Note
If you do not have OpenSSH on your host machine, follow the OpenSSH installation guide.
Step 1 : In a Windows PowerShell* terminal, generate an SSH key pair with the command below:
ssh-keygen
Save the keys to default files and do not use a passphrase. The keys will be stored at C:\Users\<username>/.ssh/id_rsa
.
Step 2 : Manually copy the public key to the target machine. Follow the steps below:
Open the contents of the public key:
.ssh\id_rsa.pub
Copy the contents and transfer them to the target machine.
On the target machine, add the key as a new line in
authorized_keys
. Theauthorized_keys
file is typically found in the.ssh
directory for the target user. For the root user, this would be in/root/.ssh
. For other users, it would be in the/home/<username>
directory.
Step 3 : Verify that you can connect to your target machine without a password by running the command below. Replace USERNAME
with your username on the target machine, and HOSTNAME
with the hostname or IP of the target machine.
ssh USERNAME@HOSTNAME
The command should connect you to the target machine without a password.
If you have MYRIAD or GPU devices on your target, see Configure Sudo Privileges without Password. If you do not have such devices or they are configured correctly, move on to register a remote machine in the DL Workbench.
Configure Sudo Privileges without Password¶
DL Workbench tries to set up GPU and MYRIAD devices on the target machine automatically. For this, the DL Workbench needs sudo and root privileges for GPU devices and sudo privileges for MYRIAD devices. Skip this section if your devices are configured correctly or you do not have them on the target.
Follow the steps to configure sudo privileges without a password:
Step 1 : Check sudo permissions using the following command:
sudo ls -la /
If you are not asked for a sudo password during the execution of the command above, skip this section and proceed to register the remote target in the DL Workbench.
Step 2 : If you do not have sudo permissions, add the user to the sudo
group. Replace USERNAME
with the username of the user you want to grant sudo permissions to and run the command below:
su
usermod -a -G sudo USERNAME
exit
Step 3 : Open the /etc/sudoers.tmp
file as root using the command below:
sudo visudo
Step 4 : At the end of the sudoers
file, add the line provided below. Replace USERNAME
with the username of the user you want to grant sudo permissions to.
USERNAME ALL=(ALL) NOPASSWD: ALL
Follow the command-line instructions to exit and save the changes.
Note
Be careful when editing the sudoers
file and apply only the required changes.
Step 5 : Check sudo permissions using the following command:
sudo ls -la /
The user USERNAME
received sudo permissions if you are not asked for a sudo password during the execution of the command above.
If you do not have the rights to perform these steps, contact your system administrator or set up the devices manually by following the Steps for Intel® Processor Graphics (GPU) and Steps for Intel® Movidius™ Neural Compute Stick and Intel® Neural Compute Stick 2 sections of Install Intel® Distribution of OpenVINO™ toolkit for Linux.