Skip to content
Snippets Groups Projects
Commit b4062ba7 authored by Nikolas Schmitz's avatar Nikolas Schmitz
Browse files

Fixed groupby error

parent 6d2fcb81
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,9 @@ def get_nvidia_gpu_power(pid_list, logger=None, **kwargs):
out_str_final = re.sub("\s+\n", "\n", out_str_final) # else pd will mis-align
out_str_final = out_str_final.strip()
df = pd.read_csv(StringIO(out_str_final), engine="python", delimiter="\t")
try:
process_percentage_used_gpu = df.groupby(["gpu", "pid"])[['sm', 'mem', 'enc', 'dec']].mean().reset_index()
except: # Older pandas versions
process_percentage_used_gpu = df.groupby(["gpu", "pid"]).mean().reset_index()
p = Popen(["nvidia-smi", "-q", "-x"], stdout=PIPE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment