Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)

vTune results

gray_heron
Beginner
2,647 Views

I'm doing a "hotspot analysis" of some processes on a container with VTune Profiler, but I'm not getting the results.

The tool is started from the command line, the process ID is specified, and the analysis is performed.

User mode sampling
Command: vtune -collect hotspots -duration=<sec> -knob sampling-mode=sw -target-pid <pid>

The tool does not end in the analysis of a specific process
(It does not return even if the time specified by the parameter is reached)

· Hardware event-based sampling
Command: vtune -collect hotspots -duration=<sec> -knob sampling-mode=hw -target-pid <pid>

"0x40000025 (Inapplicable report)" is output on the command line.

What could be the cause?

Regards.

0 Kudos
9 Replies
RaeesaM_Intel
Moderator
2,618 Views

Hi,

 

Thank you for reaching out to us. Could you please share the below details so that we can provide the necessary steps to profile inside container and help you with the error.

 

1) Clarify whether the vtune is in Host or the Container

2) The OS you are using

3) Version of VTune profiler

 

Please refer this link for profiling inside docker containers : https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/launch/containerization-support/run-from-container.html

https://www.intel.com/content/www/us/en/develop/documentation/vtune-cookbook/top/configuration-recipes/profiling-in-docker-container.html

 

Regards,

Raeesa

 

0 Kudos
gray_heron
Beginner
2,603 Views

Hi,

 

Thank you for your reply. 

>1) Clarify whether the vtune is in Host or the Container
 vtune is in Host or the Container

 

>2) The OS you are using
 Ubuntu 18.04.5 LTS


>3) Version of VTune profiler
 Intel VTune Profiler 2021.5.0

Check the contents of the link.

Regards.

0 Kudos
RaeesaM_Intel
Moderator
2,595 Views

Hi,

 

We assume that you have the VTune installed in you Host and you need to profile some processes running on a target container. Please follow the below steps :

Command to start Target container:

  • docker run -p 80:8080 --rm -dti --name Target --network test --cap-add CAP_SYS_ADMIN <Image_name> bash
  • docker exec -it <containerID> bash

Install ssh and enable on the container:

  • apt-get update
  • apt-get install ssh
  • service ssh start
  • service ssh status

You will see that “ssh is running”

Enable password less ssh connection

To generate public rsa key for connection on host :

  •  ssh-keygen -t rsa (key will be saved in this path (/root/.ssh/id_rsa.pub))

copy the content inside "id_rsa.pub" to the Target : ~/.ssh/authorized_keys

 

In the Target container, create the following directory:

  • mkdir ~/.ssh
  • cd ~/.ssh
  • touch authorized_keys

 vi authorized_keys (Copy the contents of the "id_rsa.pub" file from the host and paste the content in this file)

On Host system

Now we need to get container ip address:

  • docker ps (copy container id and past in below command)
  • docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_id

after running above command we will get an ip eg: 172.17.0.2

 

How to verify that we can access the target container:

  • ping -c 3 <ip address of the container>(eg:172.17.0.2)

output looks like below:

PING 172.18.0.3 (172.18.0.3) 56(84) bytes of data.

64 bytes from 172.17.0.2.: icmp_seq=1 ttl=64 time=0.038 ms

64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.043 ms

64 bytes from 172.17.0.2: icmp_seq=3 ttl=64 time=0.035 ms

 

--- 172.17.0.2 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2037ms

rtt min/avg/max/mdev = 0.035/0.038/0.043/0.007 ms

 

Profiling Python application using command line:

vtune -target-system ssh:root@<container ip address>(eg:172.17.0.2) -target-install-dir=/tmp/vtune_profiler -collect hotspots -app-working-dir /usr/bin --app-working-dir=/usr/bin -- /usr/bin/python3  <Path to the application in the Target container>

 

OR

 

Using VTune-GUI:

If you have GUI interface then you can use the command

>vtune-gui

the window will be opened and you can configure the analysis and get the results of process.

 

Also, try upgrading the VTune profiler to the latest version.

Please refer the below links for more details :

https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/launch/containerization-support/run-from-container.html

https://www.intel.com/content/www/us/en/develop/documentation/vtune-cookbook/top/configuration-recipes/profiling-in-docker-container.html

https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/launch/containerization-support/run-from-container.html

Hope this helps. Get back to us in case of any issues.

 

Regards,

Raeesa

 

0 Kudos
RaeesaM_Intel
Moderator
2,546 Views

Hi,


Is your issue resolved? Please let us know the updates so that we can help you further if you have more issues.


Regards,

Raeesa


0 Kudos
gray_heron
Beginner
2,540 Views

Hi, Raessa-san

I will report the current situation.
I also considered Raeesa-san's procedure, but since it is difficult to SSH from the host to the container due to the limited environment,
Attempting to mount results in an error. What could be the cause of this error?

 

[Step]
# docker run --cap-add CAP_SYS_ADMIN --cap-add CAP_SYS_PTRACE --privileged ... -v/opt/intel/oneapi:/opt/intel/oneapi/...
# docker exec -it < container id >/bin/bash
root > cd
root > source/opt/intel/oneapi/setvars.sh

                     :
root > vtune -collect hotspots -knob sampling-mode=sw -target-pid <pid>
  (pid:The process ID of the container)

 

[Error]
vtune: Error: Failed to execute sep process.Data collection is interrupted.
vtune: Collection failed.
vtune: Internal Error

 

Regards.

0 Kudos
RaeesaM_Intel
Moderator
2,460 Views

Hi,

 

We were able to reproduce the issue on Ubuntu 18.04. There is no issue while running in Ubuntu 20.04. We are checking on resolving the issue on 18.04 , will get back to you with the updates. 

 

Regards,

Raeesa

 

0 Kudos
RaeesaM_Intel
Moderator
2,371 Views

Hi,


Thank you for your patience.

We do not currently support python profiling outside of docker. And we have some problems with attach mode when profiling Python. You can try installing Vtune in docker and profile the workload inside docker via launch mode

Also,please note that we only support python3.7, 3.8, IDP3.7 (Intel Distribution Python) in launch mode. 


Regards,

Raeesa


0 Kudos
RaeesaM_Intel
Moderator
2,328 Views

Hi,


We haven't heard back from you. Please let us know if you have any more queries.


Raeesa


0 Kudos
RaeesaM_Intel
Moderator
2,291 Views

Hi,


We haven't heard back from you. We are discontinuing monitoring this thread. Please raise a new query if you have further questions.


Regards,

Raeesa


0 Kudos
Reply