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

Can't run Vtune as root || ubuntu 20.4

EliavShbt
Novice
2,555 Views

Add screenshot of the problem:

EliavShbt_0-1647787116832.png

I need the Vtune to run in root mode so it can test application that requires super user permissions.

Any ideas?

0 Kudos
7 Replies
Gopika_Intel
Moderator
2,490 Views

Hi,

Thank you for posting in Intel Communities. Could you please share with us the following information to investigate the issue from our end?

a. Are you able to run Vtune as a non-root user? Or is the issue happening only when you are signing in as root?

b. We could see you are trying to open vtune-gui from root. Could you please try running any analyses using command line from root?

Eg: 

vtune -collect hotspots -result-dir r001hs -quiet /home/test/sample

For other vtune command line syntax, please refer the vtune command syntax user guide

c. Could you please confirm whether your system has GUI support?

d. Could you please share with us the self-checker logs output? To get self-checker logs, please refer verifying vtune profiler installation.

WORKAROUND: While we investigate this issue, you can try opening Vtune profiler in a web server. Please refer Web server for the detailed steps. The web server interface helps you quickly get started with the tool since you do not need to install VTune Profiler as a desktop application on every client system. You can use the VTune Profiler Server to configure and control analysis on arbitrary target systems and view collected results.

Regards

Gopika

 

0 Kudos
EliavShbt
Novice
2,429 Views

So I managed to run the vtune within the command line (as root-user) and then I tried to open the result with the GUI of vtune and it failed because the file was written with root-user permissions so I had to change it and only than I could see the result.

This workaround solved the issue but it is very complicated and takes a lot of time.

How can I open the vtune gui with as a root user?

0 Kudos
EliavShbt
Novice
2,447 Views

For a. question: I did run it as a non-root user and it works but the application i'm using requires specific permissions that only super user has.

For b. I will try tomorrow and will reply if it works/

For c. Yes the system does support GUI, as I mentioned before it works with the GUI as non root-user.

For d. Yes I will as soon as I will try to run it again in GUI mode with root-user.

0 Kudos
Gopika_Intel
Moderator
2,374 Views

Hi,

Sorry for the delay in response. As a workaround you can try the following steps. We built an application in root mode and we were able to profile in non-root mode.

STEPS FOLLOWED

1. 

echo 0 | sudo dd of=/proc/sys/kernel/yama/ptrace_scope

While trying to profile an application, built in root mode, in non-root mode, data collection would not start because the scope of ptrace system call is limited. To enable profiling, please set /proc/sys/kernel/yama/ptrace_scope to 0(as above). To make this change permanent, set kernel.yama.ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf and reboot the machine.

 

2. Create a shell script appending the executable (application to be profiled built in the root mode) with sudo

##Script.sh##

#! /bin/sh
sudo ./hello  //hello is the executable built in the root mode.

 

3. Make the shell script executable.

chmod +x script.sh

 

4. Run the profiling using the shell script executable.

vtune -collect hotspots -knob sampling-mode=sw -- <path to script>/script.sh

 

Hope this helps.

Regards

Gopika

 

0 Kudos
Gopika_Intel
Moderator
2,265 Views

Hi,

 

We were able to reproduce your issue from our end and we informed this to our dev team. Let us know does the work around helped ?

 

Regards,

Gopika

 

0 Kudos
JaideepK_Intel
Moderator
1,851 Views

Hi,


Good day to you.


Sorry for the delay, this is a security feature:

install as root -> login as root and use. 

install as user -> use as user


If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue. Thank you!


Thanks,

Jaideep



0 Kudos
JaideepK_Intel
Moderator
1,506 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks,

Jaideep


0 Kudos
Reply