未验证 提交 0e900864 编写于 作者: K kangguangli 提交者: GitHub

[BugFix] fix install_check failure when multi cpu but no gloo (#51482)

* fix install_check failure when multi cpu but no gloo

* fix: raise error when multi-card check fails
上级 7d727f36
...@@ -272,7 +272,7 @@ def run_check(): ...@@ -272,7 +272,7 @@ def run_check():
device_list = paddle.static.npu_places() device_list = paddle.static.npu_places()
else: else:
device_str = "CPU" device_str = "CPU"
device_list = paddle.static.cpu_places(device_count=2) device_list = paddle.static.cpu_places(device_count=1)
device_count = len(device_list) device_count = len(device_list)
_run_static_single(use_cuda, use_xpu, use_npu) _run_static_single(use_cuda, use_xpu, use_npu)
...@@ -280,12 +280,13 @@ def run_check(): ...@@ -280,12 +280,13 @@ def run_check():
print("PaddlePaddle works well on 1 {}.".format(device_str)) print("PaddlePaddle works well on 1 {}.".format(device_str))
try: try:
_run_parallel(device_list) if len(device_list) > 1:
print( _run_parallel(device_list)
"PaddlePaddle works well on {} {}s.".format( print(
device_count, device_str "PaddlePaddle works well on {} {}s.".format(
device_count, device_str
)
) )
)
print( print(
"PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now." "PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now."
) )
...@@ -307,3 +308,4 @@ def run_check(): ...@@ -307,3 +308,4 @@ def run_check():
device_str device_str
) )
) )
raise e
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册