Intel® VTune™ Amplifier - Collection failed due to SCP failing to copy files from the host to the target

By Shailendrsingh Kishore Sobhee, Published: 12/08/2016, Last Updated: 12/08/2016

Intel® VTune™ Amplifier uses SCP as a mechanism to copy files to and from the host and the target system, while performing a remote collection. 

Often, you may encounter an issue where VTune Amplifier will stop with the "Collection failed" error with a sub-message like:

Collection failed. The data cannot be displayed. Cannot copy [some_file] to [some_remote_destination] on target. Please check scp command. 

As the error message says, you may first test if the SCP command works. To do this, you may try to copy a simple file:

scp -v my_file.txt user@remote_host:/home/[remote_user]/Desktop

For the above to work, you need to set up a password-less SSH connection to your remote host. (See the section "Setup target to not require a password" from this link for more information)

Example:

I have a file called my_settings.txt on the desktop of my local machine and I want to copy that file on the Desktop of my remote machine with a hostname remotetarget (mapped to an IP address in /etc/hosts) and username targetuser:

scp /home/hostuser/Desktop/mysettings.txt targetuser@remotetarget:/home/targetuser/Desktop/mysettings.txt

If the above command works, then you know SCP is working fine.

Problem: 

Often, SCP will fail without any meaningful error, with the verbose output finishing on Exit status 0. The issue is based on a known bug reported here and is simply due to the remote shell outputting some text.

If when you do ssh targetuser@remotetarget and you see some text being printed, you would want to log on the target machine and comment the outputs (defined in ~/.bash_profile or ~/.bashrc).

Removing the printed outputs should resolve the SCP problem.

Another option could be to check if one is in an interactive shell through the $PS1 variable and subsequently preventing the execution of the rest of the script. This can be done by adding the following on the first line of your .bashrc script:

if [ -z "$PS1" ]; then
   return
fi​

You probably came to this article experiencing this SCP problem. I hope this article helps solve the problem.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804