koenverhagen commited on
Commit
6a53fd5
1 Parent(s): 0ab5cef

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +6 -5
server.py CHANGED
@@ -90,11 +90,12 @@ def check_gpu_usage():
90
  try:
91
  while True:
92
  output = subprocess.check_output("nvidia-smi", shell=True).decode("utf-8")
93
- lines = output.split('\n')
94
-
95
- for line in lines:
96
- if '%' in line:
97
- print(line.strip().split(' ')[-2])
 
98
  return
99
  except subprocess.CalledProcessError:
100
  print("Nvidia-smi command not found, please check if the NVIDIA drivers are installed.")
 
90
  try:
91
  while True:
92
  output = subprocess.check_output("nvidia-smi", shell=True).decode("utf-8")
93
+ # lines = output.split('\n')
94
+ #
95
+ # for line in lines:
96
+ # if '%' in line:
97
+ # print(line.strip().split(' ')[-2])
98
+ print(output)
99
  return
100
  except subprocess.CalledProcessError:
101
  print("Nvidia-smi command not found, please check if the NVIDIA drivers are installed.")