Skip to content

Commit ac7a8de

Browse files
author
Seil Na
authored
initialize history files added.
1 parent 589c18d commit ac7a8de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gpustat/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ def get_gpu_info(handle):
341341
"""Get one GPU information specified by nvml handle"""
342342
def get_last_used(index):
343343
last_useds = []
344+
if not os.path.exists('gpu_history.pkl'):
345+
pickle.dump({}, open('gpu_history.pkl', 'wb'))
344346
with open('gpu_history.pkl', 'rb') as f:
345347
history = pickle.load(f)
346348
if platform.node() in history:

0 commit comments

Comments
 (0)