This commit is contained in:
erpalma
2018-07-30 10:37:20 +02:00
parent 6c38278922
commit 2eca07717a

View File

@@ -38,8 +38,8 @@ power = {'source': None, 'method': 'polling'}
def writemsr(msr, val): def writemsr(msr, val):
n = glob.glob('/dev/cpu/[0-9]*/msr') n = ['/dev/cpu/{:d}/msr'.format(x) for x in range(cpu_count())]
if not n: if not os.path.exists(n[0]):
try: try:
subprocess.check_call(('modprobe', 'msr')) subprocess.check_call(('modprobe', 'msr'))
except subprocess.CalledProcessError: except subprocess.CalledProcessError: