RAPL-SET(1)

πŸ’– RAPL-SET πŸ’– β€” bestie's guide to the rapl-set page (manual section 1)

okay so you opened rapl-set(1) and you're like "what is this". bestie. sit down. we're gonna read it together and it's gonna be fine. πŸ’…


🌸 NAME 🌸

rapl-set β€” set RAPL configurations. that's the whole vibe. it sets stuff. RAPL stuff. iconic. ✨


πŸ¦‹ SYNPOSIS πŸ¦‹

rapl-set [OPTION]...

yeah that's it, that's the whole shape of it. options. many options. we'll get there. 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

⚠️ okay first thing first and I need you to actually hear me: this utility is deprecated. use powercap-set(1) instead. periodt. it still exists, it still works, but it's giving "we've moved on". πŸ’€

so. this thing sets Intel Running Average Power Limit (RAPL) configurations. yes that's a real acronym. yes it's about power. no I will not be normal about it.

lowkey important detail: the -p and -z options here are different from the ones in powercap-set(1). like, don't assume they behave the same, they do not, that's a whole trap. πŸ™ˆ

and before you can even run this, the hardware/software vibe check has to pass:

  • an Intel processor (Sandy Bridge or newer β€” she's picky πŸ’…)
  • Linux kernel 3.13 or newer, compiled with CONFIG_POWERCAP and CONFIG_INTEL_RAPL enabled
  • the intel_rapl kernel module loaded

miss any of those and it's just not happening, bestie. πŸŽ€


✨ OPTIONS ✨

here's the menu. every single one. no skips. πŸ“

  • -h, --help β€” prints out the help screen. the classic. the little "hi, here's how I work". 🌈
  • -p, --zone=ZONE β€” the zone number. defaults to 0. this is the one you want.
  • -p, --package=PACKAGE β€” deprecated, use --zone instead. yes, it's the same short flag as the one above. yes, that's on purpose. no, I don't make the rules. 😭
  • -z, --subzone=SUBZONE β€” the subzone number. default is none.
  • -c, --constraint=CONSTRAINT β€” the constraint number. default is none.

πŸ’œ zone-level arguments

these ones can be used together, and -z/--subzone is optional for them:

  • -j, --z-energy β€” reset zone energy counter. fresh start energy. ✨
  • -e, --z-enabled=1|0 β€” enable/disable a zone. 1 for on, 0 for off. that simple.

πŸ’™ constraint-level arguments

these ones can also be used together, and they require -c/--constraint (-z/--subzone stays optional):

  • -l, --c-power-limit=UW β€” set constraint power limit. units are microwatts, iykyk.
  • -s, --c-time-window=US β€” set constraint time window. units are microseconds.

🧚 EXAMPLES 🧚

cute lil heads up before we start: -p/--zone=0 is the default, which means on single-socket systems your commands get to be short and adorable. πŸ’–

rapl-set -e 1 enable zone 0 (implicitly, because she's the default), which is usually named package-0.

rapl-set -p 0 -e 1 enable zone 0, but explicitly this time. saying the quiet part out loud.

rapl-set -p 0 -z 1 -e 1 enable zone 0, subzone 1 β€” which is usually the uncore or dram subzone of package-0, depending on the system. your mileage may vary, check your system. πŸ¦‹

rapl-set -p 0 -c 1 -l 25000000 set a power cap of 25 Watts (25000000 uW) on zone 0, constraint 1 β€” usually the short_term constraint for package-0.

rapl-set -p 1 -z 0 -c 0 -l 15000000 -s 976 set a power cap of 15 Watts (15000000 uW) and a time window of 976 microseconds on zone 1, subzone 0, constraint 0 β€” usually the long_term (and only) constraint for the core subzone of package-1, on a multi-socket system. look at her go. πŸ‘‘


πŸ’… REMARKS πŸ’…

  • administrative (root) privileges are usually needed to use rapl-set. sorry babe, that's just how it is. πŸ”’
  • setting constraint power cap and/or time limit values does not enable or disable a zone/subzone β€” you have to set the -e/--z-enabled flag explicitly. this one trips people up constantly, don't let it be you. πŸ™ˆ
  • power units: microwatts (uW)
  • time units: microseconds (us)

πŸ’€ BUGS πŸ’€

okay so everything in this section is a behavioral quirk caused by the kernel interface or by some hardware being weird. these are not bugs in rapl-set and should not be reported as such. read that twice. then read it again. 🫢

  • the kernel is not guaranteed to accept power limit and time window values exactly as you specified them. values may get rounded because of how they're encoded in Model-Specific Registers. usually that rounding error is small when you're in normal operating ranges, but at the extremes it can be significant. 🎒
  • some systems may not accept time window values correctly, and you'll need a system reboot to reset the time window to the default value. yeah. a reboot. 😭
  • values the kernel returns β€” for example via rapl-info(1) β€” sometimes lose accuracy compared to the actual stored value because of integer rounding. like, the kernel may return a time window value of 7812 us when the actual stored value is 7812.5 us. and if you write back an integer value that the kernel gave you, you may cause unexpected changes to its stored value thanks to these rounding problems. so. be careful. 🚨
  • at the time of this writing, some features in the powercap interface are not supported by RAPL. specifically: resetting a zone energy counter (-j/--z-energy) may result in an EACCES (Permission denied) error, because the energy_uj file is read-only. πŸ’”
  • some systems may not allow disabling package-level zones/constraints.
  • on multi-socket systems, packages can be indexed out of order by the kernel. for real. the package at index 0 (-p 0) could actually be named package-1, while the package at index 1 (-p 1) is named package-0. if that matters to you, it is your responsibility to check before setting values β€” e.g. using rapl-info(1). main character energy means doing your own research. ✨

report bugs upstream at <https://github.com/powercap/powercap>


🌈 FILES 🌈

/sys/devices/virtual/powercap/intel-rapl/*
/sys/class/powercap/intel-rapl/*

those are the paths. she lives in /sys. that's just where power stuff hangs out. πŸ’œ


πŸŽ€ AUTHORS πŸŽ€

Connor Imes <connor.k.imes@gmail.com> β€” thank you for your service, king. πŸ‘‘


⭐ SEE ALSO ⭐

powercap-info(1), powercap-set(1), rapl-info(1)

go read those too, bestie, they're the friend group. 🫢


and that's the whole page!! this one's from the powercap package, dated 2021-04-14, and it's rapl-set in manual section 1. ily, go set some power limits responsibly, drink water, and don't report kernel quirks as rapl-set bugs. mwah. πŸ’–βœ¨πŸŒΈ