Skip to content

Commit

Permalink
bugfix/gpu-driver (#681)
Browse files Browse the repository at this point in the history
* fix #679

---------

Co-authored-by: KAAANG <[email protected]>
  • Loading branch information
Zeyi-Lin and SAKURA-CAT authored Aug 21, 2024
1 parent 5bbdc59 commit a2b1d2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ ignore = []
# black配置,与构建无关
[tool.black]
line-length = 120
skip-string-normalization = true

6 changes: 5 additions & 1 deletion swanlab/data/run/system/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 信息
Expand Down

0 comments on commit a2b1d2e

Please sign in to comment.