That’s interesting. Maybe PyTorch tried to create the CUDA context on GPU0, which might fail.
Could you try to run your script from the terminal using:
CUDA_VISIBLE_DEVICES=1 python -m torch.utils.bottleneck script.py args