PARL icon indicating copy to clipboard operation
PARL copied to clipboard

如何在remote_class修饰的类里使用GPU?

Open CCNUdhj opened this issue 2 years ago • 1 comments

在job.py里修改了os.environ['CUDA_VISIBLE_DEVICES'] = '0',但是在remote_class修饰的类中使用print(torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')) 输出的还是cpu。以下是我的版本信息: parl==2.0.5 torch=1.7.1

困扰了我很久,万分感激。

CCNUdhj avatar Oct 05 '22 16:10 CCNUdhj

感谢你的反馈,目前Actor是默认不使用GPU的,默认在CPU上跑Actor

https://github.com/PaddlePaddle/PARL/blob/7a910d3c586b01f18523ad45e4f8ecc7b49a249f/parl/remote/job.py#L17

rical730 avatar Oct 10 '22 06:10 rical730