141
141
def check_gpu(log=None):
143
log = '/var/log/kern.log'
144
with open(log, 'rb') as f:
145
if re.findall(r'gpu\s+hung', str(f.read()), flags=re.I):
146
print("GPU hung Detected")
143
log = subprocess.check_output(['dmesg'], universal_newlines=True)
144
if re.findall(r'gpu\s+hung', log, flags=re.I):
145
print("GPU hung Detected")