intel / intel-cmt-cat

User space software for Intel(R) Resource Director Technology
http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html
Other
693 stars 183 forks source link

Pqos can't be used together with intel pcm at the same time. #192

Closed Jiangrijin closed 3 years ago

Jiangrijin commented 3 years ago

I want to moniter the whole memory bandwidth using pcm-memory, and moniter some core's memory bandwidth using pqos at the same time.

But when I run pcm-memory first then run pqos, it will report an error "Monitoring start error on core(s) 0, status 3". So I try to run pqos first then run pcm-memory, but the pqos's output will turn to zero after pcm-memory starts.

I want to know what causes this phenomenon, and how can I use these two tools at the same time?

Please help me, thanks.

kmabbasi commented 3 years ago

Hi,

PCM automatically starts monitoring core LLC and B/W. You can disable it by setting the PCM_NO_RDT environment variable when starting PCM. e.g. export PCM_NO_RDT=1

Thanks, Khawar

Jiangrijin commented 3 years ago

Hi,

PCM automatically starts monitoring core LLC and B/W. You can disable it by setting the PCM_NO_RDT environment variable when starting PCM. e.g. export PCM_NO_RDT=1

Thanks, Khawar

Thanks a lot, it really worked! I also found use kernel interface like pqos -I -p "all:${pid}" could solve this problem.

hhyw6 commented 1 year ago

Hi, @Jiangrijin I had the same problem as you, but I executed export PCM_NO_RDT=1 before executing pcm, the problem still did not solve, while using pqos -m ... When monitoring with pcm, the output of pqos instantly changes to 0,but pcm works fine. I don't know why,

can you give me some help? Thank you!

mdcornu commented 1 year ago

What version of PCM are you using? That environment variable was introduced to PCM around mid 2020, so you'll need a minimum of PCM release 202007 for interoperability with pqos. https://github.com/intel/pcm/releases/tag/202007

hhyw6 commented 1 year ago

What version of PCM are you using? That environment variable was introduced to PCM around mid 2020, so you'll need a minimum of PCM release 202007 for interoperability with pqos. https://github.com/intel/pcm/releases/tag/202007

@mdcornu Thank you for your reply , the PCM version I am using is 2022 https://github.com/intel/pcm and I have tried many experiments like. Experiment 1.

>> export PCM_NO_RDT=1
>> sudo ./pcm-memory [works correctly]
>> sudo pqos --iface=msr -m "llc:2;mbl:2" 
ERROR: Monitoring on core 2 is already started
Monitoring start error on core(s) 2, status 3

Experiment 2.

>> sudo pqos --iface=msr -m "llc:2;mbl:2" 
>> export PCM_NO_RDT=1
>> sudo ./pcm-memory
the pqos's output will turn to zero after pcm-memory starts.
I checked the RMID at this point and found that **the RMID had changed**, which could be the reason for the result.

Experiment 3.

>> sudo PCM_NO_RDT=1 . /pcm-memory                // cmd1
>> sudo pqos --iface=msr -m "llc:2;mbl:2"         // cmd2
Both pqos and pcm display the results correctly.
The same result is obtained by exchanging commands 1, 2.

I don't understand the difference between export PCM_NO_RDT=1 and sudo PCM_NO_RDT=1 ./pcm-memory. Why does pqos not get the correct result in experiment 2, but can in experiment 3. Thanks.

mdcornu commented 1 year ago

What version of PCM are you using? That environment variable was introduced to PCM around mid 2020, so you'll need a minimum of PCM release 202007 for interoperability with pqos. https://github.com/intel/pcm/releases/tag/202007

@mdcornu Thank you for your reply , the PCM version I am using is 2022 https://github.com/intel/pcm and I have tried many experiments like. Experiment 1.

>> export PCM_NO_RDT=1
>> sudo ./pcm-memory [works correctly]
>> sudo pqos --iface=msr -m "llc:2;mbl:2" 
ERROR: Monitoring on core 2 is already started
Monitoring start error on core(s) 2, status 3

Experiment 2.

>> sudo pqos --iface=msr -m "llc:2;mbl:2" 
>> export PCM_NO_RDT=1
>> sudo ./pcm-memory
the pqos's output will turn to zero after pcm-memory starts.
I checked the RMID at this point and found that **the RMID had changed**, which could be the reason for the result.

Experiment 3.

>> sudo PCM_NO_RDT=1 . /pcm-memory                // cmd1
>> sudo pqos --iface=msr -m "llc:2;mbl:2"         // cmd2
Both pqos and pcm display the results correctly.
The same result is obtained by exchanging commands 1, 2.

I don't understand the difference between export PCM_NO_RDT=1 and sudo PCM_NO_RDT=1 ./pcm-memory. Why does pqos not get the correct result in experiment 2, but can in experiment 3. Thanks.

In experiment 1 and 2, you are setting the the PCM_NO_RDT=1 in the current environment. But when you run "sudo ./pcm-memory", that will execute in a separate environment.

Running "sudo PCM_NO_RDT=1 . /pcm-memory" will set PCM_NO_RDT=1 in the same environment that pcm is running.

hhyw6 commented 1 year ago

In experiment 1 and 2, you are setting the the PCM_NO_RDT=1 in the current environment. But when you run "sudo ./pcm-memory", that will execute in a separate environment.

Running "sudo PCM_NO_RDT=1 . /pcm-memory" will set PCM_NO_RDT=1 in the same environment that pcm is running.

ok, I get it, thanks.