Skip to content

Commit

Permalink
Update surveillance.py
Browse files Browse the repository at this point in the history
Fix Kilo when calculating gpu free mem
  • Loading branch information
SvenVD committed Aug 31, 2017
1 parent a5098d0 commit 759e784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion surveillance/surveillance.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def check_free_gpumem():
threshold_bytes = 80000000
free_gpumem = get_free_gpumem()
if free_gpumem is not None:
conversions = {'B': 1024, 'M': 1024 ** 2, 'G': 1024 ** 3, 'T': 1024 ** 4}
conversions = {'K': 1024, 'M': 1024 ** 2, 'G': 1024 ** 3, 'T': 1024 ** 4}
free_gpumem_bytes = float(re.sub('[A-Za-z]+','', free_gpumem))*conversions.get(re.sub('\d+','', free_gpumem),1)
logger.debug("Free memory in bytes: " + str(free_gpumem_bytes))
if int(free_gpumem_bytes) < int(threshold_bytes):
Expand Down

0 comments on commit 759e784

Please sign in to comment.