Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.
1721 ディスカッション

Intel PCM - Can not access CPUs Model Specific Registers MSR

Mahieddine_D_
ビギナー
3,695件の閲覧回数

Hi all,

I am pretty new on PCM. Basically, I added some CPU counters in my test code and when I try to run my test I got the following output:

Number of physical cores: 8
Number of logical cores: 16
Threads (logical cores) per physical core: 2
Num sockets: 2
Core PMU (perfmon) version: 3
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Can not access CPUs Model Specific Registers (MSRs).
Try to execute 'modprobe msr' as root user and then
you also must have read and write permissions for /dev/cpu/*/msr devices (/dev/msr* for Android). The 'chown' command can help.
Segmentation fault (core dumped)

So what I did was:

  1. Login as root
  2. Execute the command 'modprobe msr'
  3. Run chmod -R ugo+rw /dev/cpu/
  4. I also checked if the msr module was correctly loaded using modprobe -l | grep msr, and the output was lib/modules/3.0.101-0.7.17-default/kernel/drivers/scsi/arcmsr/arcmsr.ko

But I am still getting the same error.

Any thoughts about that?

 

Many thanks,

Mahieddine

 

0 件の賞賛
8 返答(返信)
Patrick_F_Intel1
従業員
3,695件の閲覧回数

Hello Mahieddine,

When you use the base code (without your changes), does the code work properly?

If so, then you probably introduced errors with your changes.

Pat

Mahieddine_D_
ビギナー
3,695件の閲覧回数

Hi Patrick,

Actually just find out that pcm shoul run as root. So I just had to do a script to load my user environment while login as root.

Thanks though for the help

 

Mohammadreza_N_
ビギナー
3,695件の閲覧回数
 

Hi,

I am using a Docker container (https://www.docker.com/) on our server and I am facing an identical problem. I am root in my container but still I am receiving this message. Is the problem from using the container or there is a way to fix it.

Message:

Can not access CPUs Model Specific Registers (MSRs).
Try to execute 'modprobe msr' as root user and then
you also must have read and write permissions for /dev/cpu/*/msr devices (/dev/msr* for Android). The 'chown' command can help.
Access to Intel(r) Performance Counter Monitor has denied (no MSR or PCI CFG space access).

Bernard
高評価コントリビューター I
3,695件の閲覧回数

AFAIK some of MSRs are only accessible from BIOS.

Patrick_F_Intel1
従業員
3,695件の閲覧回数

Hello Mohammadreza,

Is Docker something like a virtual machine? If so, I don't think PCM works in virtual environments because virtual machines usually restrict access to most MSRs.

Pat

Mohammadreza_N_
ビギナー
3,695件の閲覧回数

Hello Pat,

No, it is not like a virtual machine. In docker each user can has a container which is run by a thread on the main OS. I am no expert in knowing Docker, but I think there are some limitations for each container to keep it safe to invade other users' containers, though, I am not fully sure and that is why I am here!

I have asked this question on Docker forum as well; yet without any reply!

Patrick Fay (Intel) wrote:

Hello Mohammadreza,

Is Docker something like a virtual machine? If so, I don't think PCM works in virtual environments because virtual machines usually restrict access to most MSRs.

Pat

Patrick_F_Intel1
従業員
3,695件の閲覧回数

I would try running PCM on the same machine without docker. Lets say PCM works in this case.

Then run PCM the exact same way inside docker on the same system. If PCM no longer works then I'd say docker is preventing it from accessing the HW.

Sorry to not be more helpful.

Pat
 

Roman_D_Intel
従業員
3,695件の閲覧回数

Mohammadreza N. wrote:

 

Hi,

I am using a Docker container (https://www.docker.com/) on our server and I am facing an identical problem. I am root in my container but still I am receiving this message. Is the problem from using the container or there is a way to fix it.

Message:

Can not access CPUs Model Specific Registers (MSRs).
Try to execute 'modprobe msr' as root user and then
you also must have read and write permissions for /dev/cpu/*/msr devices (/dev/msr* for Android). The 'chown' command can help.
Access to Intel(r) Performance Counter Monitor has denied (no MSR or PCI CFG space access).

It is possible to run PCM in a docker container if you specify --privileged flag like here: https://github.com/opcm/pcm/blob/master/DOCKER_README.md

 

返信