diff --git a/pyproject.toml b/pyproject.toml index 6fc058c8..fc701d79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,3 +109,5 @@ ignore = [] # black配置,与构建无关 [tool.black] line-length = 120 +skip-string-normalization = true + diff --git a/swanlab/data/run/system/info.py b/swanlab/data/run/system/info.py index c414f8a4..e29aeb14 100644 --- a/swanlab/data/run/system/info.py +++ b/swanlab/data/run/system/info.py @@ -98,7 +98,11 @@ def __get_nvidia_gpu_info(): try: # 获取 NVIDIA 驱动版本信息 - info["driver"] = pynvml.nvmlSystemGetDriverVersion() + nv_driver = pynvml.nvmlSystemGetDriverVersion() + if isinstance(nv_driver, bytes): + nv_driver = nv_driver.decode("utf-8") + info["driver"] = nv_driver + # 获取 NVIDIA GPU 数量 info["cores"] = pynvml.nvmlDeviceGetCount() # 遍历每个 GPU,获取 GPU 信息