未验证 提交 0552a432 编写于 作者: D Double_V 提交者: GitHub

Merge pull request #5072 from JimEverest/issue5065

fix  #5065
...@@ -313,6 +313,11 @@ def create_predictor(args, mode, logger): ...@@ -313,6 +313,11 @@ def create_predictor(args, mode, logger):
def get_infer_gpuid(): def get_infer_gpuid():
if os.name == 'nt':
try:
return int(os.environ['CUDA_VISIBLE_DEVICES'].split(',')[0])
except KeyError:
return 0
if not paddle.fluid.core.is_compiled_with_rocm(): if not paddle.fluid.core.is_compiled_with_rocm():
cmd = "env | grep CUDA_VISIBLE_DEVICES" cmd = "env | grep CUDA_VISIBLE_DEVICES"
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册