Problems with likwid 3.0.0 and msr module

586 views
Skip to first unread message

Daniel Ruiz Molina

unread,
Dec 20, 2013, 3:44:39 AM12/20/13
to likwid...@googlegroups.com
Hello,

My scenario is this: normal users running likwid-perfctr, in systems with kernel 2.6.32-358.6.2 (Scientific Linux 6.4) and msr module compiled into kernel (not as a module) can't execute "likwid-perfctr". When an user execute "likwid-perfctr", he got this message:
likwid-perfctr -c 0 ./PROGRAM
ERROR
rdmsr: failed to open '/dev/cpu/0/msr': Operation not permitted!
       Please check if the msr module is loaded and the device file has correct permissions.
       Alternatively you might want to look into (sys)daemonmode.

MSR module is compiled into kernel:
cat /boot/config-2.6.32-358.6.2.el6.x86_64 | grep -i msr
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_X86_MSR=y
CONFIG_SCSI_ARCMSR=m
CONFIG_SCSI_ARCMSR_AER=y


And permissions in /dev/cpu/*/msr:
0:
crw-rw-rw-  1 root root 202, 0 dic 16 12:50 msr

1:
crw-rw-rw-  1 root root 202, 1 dic 16 12:50 msr

2:
crw-rw-rw-  1 root root 202, 2 dic 16 12:50 msr

3:
crw-rw-rw-  1 root root 202, 3 dic 16 12:50 msr

4:
crw-rw-rw-  1 root root 202, 4 dic 16 12:50 msr

5:
crw-rw-rw-  1 root root 202, 5 dic 16 12:50 msr

6:
crw-rw-rw-  1 root root 202, 6 dic 16 12:50 msr

7:
crw-rw-rw-  1 root root 202, 7 dic 16 12:50 msr

(I change manually in /etc/rc.local with "chmod o+rw /dev/cpu/*/msr")


What can I do?


Thanks.

Sonal Aggarwal

unread,
Mar 11, 2014, 4:24:24 PM3/11/14
to likwid...@googlegroups.com
Hello

I am facing an exactly similar issue. Please advise.
Message has been deleted

Thomas Röhl

unread,
Mar 12, 2014, 7:29:31 AM3/12/14
to likwid...@googlegroups.com
Hello,

we checked the kernel 2.6.32-358.6.2 that comes with Scientific Linux 6.4 and they backported the capabilities check for MSR (http://osdir.com/ml/linux-kernel/2013-02/msg00097.html). Therefore, your binaries need RAWIO access permission to the MSR register, the read/write permissions on the msr-Device is not sufficient. For multi-user systems the best method is the application of the MSR accessDaemon that comes with LIKWID and set the RAWIO permission only once for the daemon.

sudo setcap cap_sys_rawio+ep EXECUTABLE

We cannot check each Linux distribution and its versions if you need to set the RAWIO access permissions or not. There are recent distribution versions with kernel >= 3.7 that removed the capabilities check again from the kernel code.

Reply all
Reply to author
Forward
0 new messages