Skip to content

Commit 5bc9006

Browse files
authored
Add support for systems with missing sysfs entries (#19)
Also update SVS to 0.2.0 in uv.lock.
1 parent 1de7327 commit 5bc9006

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/svsbench/utils.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ def read_free_huge_pages() -> list[int]:
7070

7171
def read_system_config() -> dict[str, Any]:
7272
"""Read system information."""
73+
no_turbo_path = Path(
74+
"/sys/devices/system/cpu/intel_pstate/no_turbo"
75+
)
76+
no_turbo = int(no_turbo_path.read_text()) if no_turbo_path.exists() else None
77+
governor_path = Path(
78+
"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
79+
)
80+
governor = governor_path.read_text().strip() if governor_path.exists() else None
7381
return {
7482
"system_config": {
75-
"no_turbo": int(
76-
Path(
77-
"/sys/devices/system/cpu/intel_pstate/no_turbo"
78-
).read_text()
79-
),
80-
"governor": Path(
81-
"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
82-
)
83-
.read_text()
84-
.strip(),
83+
"no_turbo": no_turbo,
84+
"governor": governor,
8585
"free_huge_pages": read_free_huge_pages(),
8686
}
8787
}

uv.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)