I guess your multi-GPU slurm setup isn’t working correctly and might be masking all available devices, so that PyTorch isn’t able to use any.
If you are trying to use e.g. 2 GPUs, you could run this small test:
for d in range(torch.cuda.device_count()):
    print(torch.cuda.get_device_name(d))

If this doesn’t print anything, then your container might not be able to “see” any devices.