소스 검색

Adapted to API change (detached)

koerschens 3 년 전
부모
커밋
37f65c3919
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      python/renderer.py

+ 4 - 1
python/renderer.py

@@ -129,6 +129,9 @@ class Renderer:
         line_len = -1
 
         for i, gpu_dict in enumerate(node_dict["gpus"]):
+            if "detached" in gpu_dict and gpu_dict["detached"]:
+                continue
+            
             new_lines = self.get_rendered_gpu_lines(gpu_dict)
             
             if line_len == -1:
@@ -163,7 +166,7 @@ class Renderer:
         return lines
 
     def get_rendered_gpu_lines(self, gpu_dict):
-        gpu_type = self.maybe_shorten_gpu_name(gpu_dict["type"])
+        gpu_type = self.maybe_shorten_gpu_name(gpu_dict["type"].replace("NVIDIA", "").strip())
         index = gpu_dict["index"]
         mem_used = gpu_dict["latest_info"]["used_memory_mb"]
         mem_total = gpu_dict["total_memory_mb"]