model.to(device) or nn.DataParallel(model) moves the model to the GPU but is there a way to check if the particular device is already in use by any other process.
The actual problem is when some else is training something on the server I don’t want my program to disturb their process and my program to fail so that I can allocate some other resource.