PufferLib icon indicating copy to clipboard operation
PufferLib copied to clipboard

Allow device to be like cuda:1

Open kywch opened this issue 1 year ago • 4 comments

kywch avatar Sep 01 '24 19:09 kywch

I think you also need to update the torch.cuda.syncronize() calls otherwise it synchs torch.cuda.current_device that - if not set - is not the actual device used. You can use torch.cuda.synchronize(config.device) instead to synch the correct device.

EliaPiccoli avatar Sep 16 '24 10:09 EliaPiccoli

@EliaPiccoli Thank you so much! I followed your suggestion.

kywch avatar Sep 16 '24 16:09 kywch

Hi, me again :D While performing experiments I also noticed that the GPU usage should be adapted while using gpu different from 'cuda:0'. I believe you need to update lines 501-502 adding the gpu device as argument. In order to have the gpu information though you need to add an argument to the Utilization class, which I think should not be a problem right?

EliaPiccoli avatar Sep 19 '24 22:09 EliaPiccoli

Hi Elia, nice catch and thanks! As you suggested, I passed in the device info, and now it should query the correct device.

kywch avatar Sep 20 '24 04:09 kywch