Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when CPU governor is not "performance" on Linux #140

Open
fitzgen opened this issue Jun 3, 2021 · 1 comment
Open

Warn when CPU governor is not "performance" on Linux #140

fitzgen opened this issue Jun 3, 2021 · 1 comment

Comments

@fitzgen
Copy link
Member

fitzgen commented Jun 3, 2021

From #138:

Observe CPU governor settings when on a known platform (Linux: /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor text file, will usually be ondemand, we want performance) and warn if scaling is turned on

If anyone knows how to detect the equivalent thing for other OSes, please share :)

@cfallin
Copy link
Member

cfallin commented Jun 9, 2021

As described by @jlb6740 just now over in #138, it would probably be even better to check for a mode that explicitly keeps a constant CPU frequency. The userspace governor is one such option, as long as the parameters are explicitly set for the same frequency on all cores and no userspace daemon is manipulating them. Perhaps we could just check that governor is one of userspace or performance and print a warning with instructions if not.

Along the same lines, we could detect if SMT (hyperthreading) is enabled by parsing /proc/cpuinfo and warn if so; this can lead to unreliable measurements.

Another way to check for varying CPU frequency more empirically would be to parse /proc/cpuinfo for the MHz lines and check these periodically during a benchmarking run to make sure they don't vary, and are the same (within real-world engineering margin) across all cores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants