diff --git a/utils.py b/utils.py index a8a87999..499ae021 100644 --- a/utils.py +++ b/utils.py @@ -31,9 +31,10 @@ def build_ujit(repo_dir): os.chdir(cwd) def set_bench_config(): - # sudo requires the flag '-S' in order to take input from stdin - subprocess.check_call("sudo -S sh -c 'echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo'", shell=True) - subprocess.check_call("sudo -S sh -c 'echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct'", shell=True) + if os.path.exists('/sys/devices/system/cpu/intel_pstate'): + # sudo requires the flag '-S' in order to take input from stdin + subprocess.check_call("sudo -S sh -c 'echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo'", shell=True) + subprocess.check_call("sudo -S sh -c 'echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct'", shell=True) def get_ruby_version(): ruby_version = subprocess.check_output(["ruby", "-v"])