Software Archive
Read-only legacy content
17061 Discussions

VTUNE and native Phi analysis and libiomp5.so oh my!

CFR
New Contributor II
680 Views

I had some problems with VTUNE native analysis and using LD_LIBRARY_PATH to find  libraries on the Phi.

I was trying to use VTUNE to analyze a native application.  Having copied my executable and libiomp5.so to /tmp and set up LD_LIBRARY_PATH (as suggested here) I could log into mic0 and run my app. But, I noticed that VTUNE seemed to be completing it's runs in far less time than it should have.  I then noticed that using "ssh mic0 /tmp/myapp" (which I'm guessing is kinda what VTUNE was doing) couldn't find libiomp5.so.  After futzing around and finding that "ssh mic0 <cmd>" doesn't run any of the bash dot files (explained here) it became clear to me that trying to use LD_LIBRARY_PATH to find things like libiomp5.so isn't really the best solution.  In the end I placed libiomp5.so in /lib64 and VTUNE can now profile my app.

I'm not sure what the underlying VTUNE mechanism is, or whether there's a better solution, but this seems to work.  I was thrown off by the odd "bash" behavior so maybe this note will help save someone else a little time.

0 Kudos
6 Replies
jimdempseyatthecove
Honored Contributor III
680 Views

Thanks for the post Craig. It is nice to see helpful hints as first post.

Have you tried setting LD_LIBRARY_PATH to include both paths? (/tmp/myapp;/lib64)

Jim Dempsey

0 Kudos
Sumedh_N_Intel
Employee
680 Views

Hi Craig, 

At the most basic level, Intel VTune Amplifier XE simply does "ssh mic0 <binary> <args>". 

I generally tend to use the command line more than the GUI. So, instead of directly running my binary, I tend to create scripts that set up the environment and run the binary. In such cases, in Intel VTune Amplifier XE, I specify my script as the application. 

Another way to set up the environment and run the app is by putting all the commands as the application for the analyzer. For example: 

[bash]amplxe-cl -c advanced-hotspots -target-system=mic-native -- " export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp; ~/diffusion/a.out mic" [/bash]

However, this method is not suited if you need to set up a large number of variables. 

I have verified that above command works for Intel VTune 2015 U1 and MPSS 3.4.1. 

I hope this helps. 

0 Kudos
Dmitry_P_Intel1
Employee
680 Views

Hello Craig,

When you use "-tarteg-system=mic-native" option for VTune CL to do collection for a native app on a MIC card, VTune constructs ssh command itself taking what is placed after ""--"".

Since you can propagate env variables through ssh with:

>ssh <host_name> LD_LIBRARY_PATH=<my_di> <app_to_launch>

the following invocation of VTune CL also should work

./amplxe-cl -target-system=mic-native -collect advanced-hotspots -- LD_LIBRARY_PATH=<my_dir> <app_to_launch_with_path_on_card>

In this case VTune will convert it internally into the following command call:

>ssh mic0 LD_LIBRARY_PATH=<my_dir> <app_to_launch_with_path_on_card>

and this should work.

Thanks & Rgeards, Dmitry
 

0 Kudos
Rong-Tai_H_
Beginner
680 Views

Hello Dmitry

What is my_di and <app_to_launch> on the your comments. Is the actual path(directory) and filename on mic? or else?

Thanks

0 Kudos
Rong-Tai_H_
Beginner
680 Views

Hello Dmitry

What is my_di and <app_to_launch> on the your comments. Is the actual path(directory) and filename on mic? or else?

Thanks

0 Kudos
Dmitry_P_Intel1
Employee
680 Views

Hello Rong-Ta,

"my_di" should be <my_dir> - this is the direcrory where you set LD_LIBRARY_PATH on. <app_to_launch> - is the <app_to_launch_with_path_on_the_card>

You can provide you CL and I can advise how to set amplxe-cl collection for it on MIC if it is still not very understandable.

Thanks & Regards, Dmitry

 

0 Kudos
Reply