Checking if multiple GPUs come from the same node, or different nodes

In a multi GPU training, Is it possible to check whether multiple GPUs come from the same node (machine) or from different nodes? And then is it possible to list them? (torch.cuda.get_current_device() seems to be getting only one device)