Re: Sometimes I only see 3 RAPL (out of 4) Counters

srinivas pandruvada
2025-09-11T20:11:01Z

On Thu, 2025-09-11 at 11:40 -0700, Kenneth Crudup wrote:
>
>
> On 9/11/25 11:37, srinivas pandruvada wrote:
> > On Thu, 2025-09-11 at 11:42 +0200, Rafael J. Wysocki wrote:
> > > +Srinivas & Rui
> > >
> > > On Thu, Sep 11, 2025 at 2:20 AM Kenneth Crudup <kenny@panix.com>
> > > wrote:
> > > >
> > > > I have a Dell XPS-9320, with a i7-1280P (family: 0x6, model:
> > > > 0x9a,
> > > > stepping: 0x3) CPU. Sometimes I'll only see 3 RAPL counters
> > > > instead
> > > > of
> > > > the normal 4. (It used to happen a lot more often, BTW):
> > > >
> >
> > That is because sometimes the counter for PP1 (GFX ..) is 0 during
> > boot
> > and then the PMU code will ignore that. This happens when the
> > counter
> > is sampled before GPU is not even started. So this is a race
> > condition.
>
> Is there anything that should/could be done about it?
>
Not an easy solution at this time without ignoring 0s.

> What's the effect of not having a GPU RAPL available?
>
The package level counter already includes this. So unless looking for
only GPU counter, not much effect.

Thanks,
Srinivas

> > Thanks,
> > Srinivas
> >
> >
> > > > ----
> > > > gunzip --force --stdout /var/log/syslog* | fgrep -i rapl |
> > > > fgrep
> > > > fixed
> > > > 2025-09-08T12:09:05.915989-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 3 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-09T08:52:19.098522-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-09T17:25:24.377784-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-09T17:50:09.334140-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-10T16:42:13.259270-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 3 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-10T16:46:36.322016-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-02T13:05:02.632218-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-02T14:07:19.683466-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-02T14:20:43.602483-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-04T13:13:38.636326-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-09-05T09:21:50.147180-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-29T10:57:14.419740-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-17T11:52:55.733943-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-19T07:52:30.696326-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-19T07:55:49.083600-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-20T10:53:54.601680-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-20T11:00:09.560496-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > 2025-08-20T11:12:30.580414-07:00 xps-9320 kernel: [    T1] RAPL
> > > > PMU: API
> > > > unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
> > > > ----
> > > >
> > > > ... and it's always(?) the GPU RAPL:
> > > >
> > > > ----
> > > > gunzip --force --stdout /var/log/syslog* | fgrep -i rapl | cut
> > > > -d\]
> > > > -f2-
> > > > > sort -f | uniq -c
> > > > grep: (standard input): binary file matches
> > > >        18  intel_rapl_common: Found RAPL domain core
> > > >        36  intel_rapl_common: Found RAPL domain package
> > > >        18  intel_rapl_common: Found RAPL domain psys
> > > >        16  intel_rapl_common: Found RAPL domain uncore
> > > >        18  intel_rapl_msr: PL4 support detected.
> > > >         2  RAPL PMU: API unit is 2^-32 Joules, 3 fixed
> > > > counters,
> > > > 655360
> > > > ms ovfl timer
> > > >        16  RAPL PMU: API unit is 2^-32 Joules, 4 fixed
> > > > counters,
> > > > 655360
> > > > ms ovfl timer
> > > >        18  RAPL PMU: hw unit of domain package 2^-14 Joules
> > > >        18  RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
> > > >        16  RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
> > > >        18  RAPL PMU: hw unit of domain psys 2^-14 Joules
> > > > ----
> > > >
> > > > A reboot fixes it up again (and that's if I even notice), but
> > > > what
> > > > would
> > > > cause this to happen? What's the effect of it missing the RAPL
> > > > counter, BTW?
> > > >
> > > > LMK if you need more info,
> > > >
> > > > -Kenny
> > > >
> > > > --
> > > > Kenneth R. Crudup / Sr. SW Engineer, Scott County Consulting,
> > > > Orange
> > > > County CA
> > > >
> > > >
> >