Skip to content

Commit b909d90

Browse files
authored
chore: fix some misc (#754)
* feat: except gpu UnicodeDecodeError * chore: change log level
2 parents 30396c3 + cbdf2da commit b909d90

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

swanlab/data/run/metadata/hardware/gpu/nvidia.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def get_nvidia_gpu_info() -> HardwareFuncResult:
4444
info["type"].append(gpu_name)
4545
# 获取 GPU 的总显存, 单位为GB
4646
info["memory"].append(round(pynvml.nvmlDeviceGetMemoryInfo(handle).total / (1024**3)))
47+
except UnicodeDecodeError: # 部分GPU型号无法解码
48+
return None, None
4749
except pynvml.NVMLError:
4850
pass
4951
finally:

swanlab/data/run/metadata/hardware/type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __call__(self) -> Optional[HardwareInfoList]:
130130
except NotImplementedError as n:
131131
raise n
132132
except Exception as e:
133-
swanlog.error(f"Hardware info collection failed: {self.__class__.__name__}, {str(e)}")
133+
swanlog.debug(f"Hardware info collection failed: {self.__class__.__name__}, {str(e)}")
134134
return None
135135
finally:
136136
self.after_collect()

0 commit comments

Comments
 (0)