sudkannan / likwid

Automatically exported from code.google.com/p/likwid
GNU General Public License v3.0
0 stars 0 forks source link

Support for Intel Atom C2700 processors #156

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Will we have support for reading Atom C2700 perf counters soon?

Original issue reported on code.google.com by devesh.d...@gmail.com on 29 May 2014 at 5:52

GoogleCodeExporter commented 9 years ago
Are you sure you mean C2700? There is currently no Intel CPU with this number, 
only D2700.
The Atom processors are already supported by LIKWID but we do not have such a 
CPU, hence we could not verify the integration. If you encounter problems, let 
us know.  

Original comment by Thomas.R...@googlemail.com on 30 May 2014 at 8:41

GoogleCodeExporter commented 9 years ago
​I meant Intel Avoton C2750.
http://www.newegg.com/Product/Product.aspx?Item=N82E16813157475

I am trying to order one from one of the vendors. I am working with vendors
to make sure that LIKWID works, before it is shipped. They are not able to
make it work. It keeps saying processor not supported. They are running CentOS
6.5.

Is that something you will be able to help with?
​

Original comment by devesh.d...@gmail.com on 31 May 2014 at 4:33

GoogleCodeExporter commented 9 years ago
Hi,

the model name Avoton is the internal name of newer Atom processors. If you 
search for it on the Intel webpages you will find there:
Intel® Atom™ Processor C2750 (4M Cache, 2.40 GHz)

Since we have included all counters and events that are denoted in the Intel 
Software Developers guide for Atom CPUs, I assume that the problem lies in the 
CPUID part of LIKWID where we determine the CPU microarchitecture. You have to 
determine the CPU family and model that is returned by CPUID. I attached a 
little program that reads the family and model (are also denoted in 
/proc/cpuinfo) and prints the Atom model numbers that are supported by LIKWID.

When you got the model number of the C2750 you can add it to the attached patch 
(change the XX in line #define ATOM_AVOTON 0xXXU) and patch LIKWID afterwards. 
Maybe these steps are enough to integrate the Intel Atom 'Avoton' in LIKWID.

Original comment by Thomas.R...@googlemail.com on 2 Jun 2014 at 11:15

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, that worked for performance counters. 

However, I am not able to correctly read energy counters. I have figured out 
that on Atom C2750 it fails in here:

char rapl_read_msr(int fd_msr, int offset, unsigned long long * buf) 
pread(fd_msr, buf, sizeof(unsigned long long), offset) != sizeof(unsigned long 
long)

I can successfully open msrs though. Any ideas?

Original comment by devesh.d...@gmail.com on 4 Jun 2014 at 6:15

GoogleCodeExporter commented 9 years ago
Can you please send me the number that identifies the Intel Atom 'Avoton'?

What do you mean with "correctly"? Does it read the value without a problem but 
the value cannot be valid?

LIKWID has no function with the name rapl_read_msr(), where do you have this 
name from?

I think the problem is that the Silvermont (base architecture of Avoton) 
introduced a new register entry that scales the temperature. This feature is 
currently not implemented in LIKWID. I will ask our hardware guy whether we 
already have a Silvermont system in house.

Original comment by Thomas.R...@googlemail.com on 5 Jun 2014 at 9:08

GoogleCodeExporter commented 9 years ago
Hi,

After applying patch atom_avoton_cpuid.patch, likwid still can not work 
properly on hardware counters.

When I tried to get counters DATA_TLB_MISSES_DTLB_MISS & 
BUS_TRANS_MEM_THIS_CORE_THIS_A, I got the following:
ERROR - [./src/perfmon.c:698] Counter register FIXC2 not supported

#likwid-perfctr -i:
CPU family: 6 
CPU model:  77 
CPU stepping:   8 
CPU features:   SSE SSE2 TM RDTSCP 
PERFMON version:    3 
PERFMON number of counters: 2 
PERFMON width of counters:  40 
PERFMON number of fixed counters:   3

Could you help with this? Thanks.

Original comment by alexdonn...@gmail.com on 26 Jun 2014 at 3:34

GoogleCodeExporter commented 9 years ago
Hi,

Running command "likwid-powermeter -c 0 -s 1s" on the same processor, I got the 
following error.

Failed to read data through daemon: daemon returned error 2 'access to this 
register is not allowed' for cpu 0 reg 606

Any idea how to make this work? Thanks.

Original comment by alexdonn...@gmail.com on 1 Jul 2014 at 5:14

GoogleCodeExporter commented 9 years ago
Hi,

i created a new patch. For the last patch I thought, that the architecture is 
only slightly different from the older Intel Atom architecture.

That is also the point, why the FIXC2 register is not supported, the older 
Atoms did not have such a register.

The new patch should allow everything, please try it. 
tar -xzf likwid-3.1.1.tar.gz
cd likwid-3.1.1
patch -p1 < "PATH_TO_PATCH"
#edit config.mk
make
make install

If you require the support for Silvermont, feel free to change my patch or 
grant one of us access to the machine, that we can test the code. We do not 
have a Silvermont CPU, thus this is an untested experimental patch.

I do not know whether this patch also fixes the likwid-powermeter application, 
but it should ;) Does it work as root with "-M 1" on the commandline? The error 
message comes from the accessdaemon which is kind of restictive due to security 
reasons.

Greetings
Thomas

Original comment by Thomas.R...@googlemail.com on 16 Jul 2014 at 3:37

Attachments:

GoogleCodeExporter commented 9 years ago
New version of the patch

Original comment by Thomas.R...@googlemail.com on 17 Jul 2014 at 8:48

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Thomas,

Thanks for the patch.

After applying the patch, compilation gives the attached error (need 
perfmon_silvermont_groups.h).

After the adding the file based on perfmon_atom_groups.h, compilation 
succeeded. But I got the following runtime error:
"Failed to read data through daemon: daemon returned error 4 'failed to 
read/write register' for cpu 0 reg 614".

Option "-M 1" does not work neither.

Thanks,
Kun

Original comment by alexdonn...@gmail.com on 19 Jul 2014 at 4:30

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Kun,

thanks for your reply. Yes, there is currently no group defined for Intel 
Silvermont. I will add a dummy file to the next patch, e.g. Energy that should 
work.
Register 614 is one for power measurements, I have to check whether Silvermont 
supports this register or renamed it in the documentation.

I will release a new patch version soon.

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 22 Jul 2014 at 11:01

GoogleCodeExporter commented 9 years ago
I checked the documentation and as I thought, Intel has changed the Power 
registers for Silvermont.

Can you please try and reset the define in src/includes/registers.h
#define MSR_PKG_POWER_INFO 0x614
to
#define MSR_PKG_POWER_INFO 0x66E

This should remove your error message, at least for the direct access as root 
with "-M 0". The access daemon checks the validity of the registers again and 
it is likely not allowed there. This will be fixed in the upcomming patch if I 
you give me positive response.
Careful, this fix works only for Intel Atom Silvermont, all other Intel CPUs 
still use register 0x614.

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 22 Jul 2014 at 1:21

GoogleCodeExporter commented 9 years ago
Hi Thomas,

Thank you. The previous problem is solved using your method.

However, the hardware events of silvermont is different with previous atom. 
Please see attachment.

When I try to use the generated perfmon_atom_events.h to replace 
perfmon_silvermont_events.h, I got the following error during runtime:
"Failed to write data through daemon: daemon returned error 4 'failed to 
read/write register' for cpu 0 reg 0x390".

Thanks,
Kun

Original comment by alexdonn...@gmail.com on 26 Jul 2014 at 9:02

Attachments:

GoogleCodeExporter commented 9 years ago
Hey Kun,

thanks for your reply, I will add the changed register to the new version of 
LIKWID to enable power measurements on Intel Silvermont.

Yes, the events are different. The Silvermont architecture is a completely new 
CPU generation and does only have the name Atom in common with its 
predecessors. You cannot simply exchange the events from Atom and Silvermont.
When I created the event list for Silvermont I also realized, that most of the 
usable events of Atom do not exist anymore.

The register 0x390 is general and should work, even with the accessDaemon. We 
do some checking at the accessDaemon, but 0x390 should be allowed. Does it work 
with the direct access method (-M 0) as root?

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 29 Jul 2014 at 8:47

GoogleCodeExporter commented 9 years ago
Hi Thomas,

Thanks for your help.

I tried the events of Silvermont with "-M 0", it still gave the following error:
ERROR - [./src/msr.c:206] "cpu 0 reg 390".

FYI. With the patch "atom_avoton_cpuid.patch" you posted on Jun 2, I can get 
the group "BRANCH" working correctly, though profiling each event would give 
FIXC2 error.

Regards,
Kun

Original comment by alexdonn...@gmail.com on 30 Jul 2014 at 2:16

GoogleCodeExporter commented 9 years ago
Hi Kun,

it's really annoying to create a patch for a system we have no access to. Would 
it be possible to give me access to it for a few hours to properly create a 
patch?

The atom_avoton_cpuid.patch seems to work for you, but I wouldn't be sure that 
really the branch related events are measured. The FIXC2 error is easy to fix, 
we add the three fixed events to the eventSet for all Intel CPUs but the 
Silvermont has only 2 fixed counters, all other CPUs have 3. You can simply 
search in src/perfmon.c for FIXC2 and remove the event plus the counter from 
the event string.

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 1 Aug 2014 at 3:12

GoogleCodeExporter commented 9 years ago
Hi,

no answers yet? I would like to add the support for Intel Silvermont but doing 
it without testing is likely not successful.

Or are you happy with the support introduced by the patches I released here? 
Then I will close this issue and assume the Intel Silvermont support as working.

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 22 Aug 2014 at 9:05

GoogleCodeExporter commented 9 years ago
Thomas,

Please do not close the issue. We were in a highly secured environment and can 
not grant access to outside parties. But, I am working on it to see if there 
are workarounds.

thanks,

Original comment by devesh.d...@gmail.com on 22 Aug 2014 at 3:55

GoogleCodeExporter commented 9 years ago
Hi,

I can understand that granting access to persons from outside is not possible 
for most companies. I will check the Silvermont stuff again to get it work. 

Greetings,
Thomas

P.S. I am going to buy a Silvermont myself in the future but there are some 
other important things to buy first. If you can wait until then, the Silvermont 
support will work like a charm ;)

Original comment by Thomas.R...@googlemail.com on 27 Aug 2014 at 3:44

GoogleCodeExporter commented 9 years ago
Hi everybody,

a few moments ago, I added *tested* support for the Intel Atom (Silvermont) 
CPUs to LIKWID. Although I added it to the trunk, please use the v3.1 branch in 
the moment. I tested both.

One thing that did not work was the RAPL PP0 domain, although Intel mentions it 
in the documentation.

The Silvermont does not provide a lot of events, I tried to set up performance 
groups but they are not exhausitive. If you develop some meaningful metrics for 
the Silvermont, feel free to send them to us.

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 30 Sep 2014 at 1:49