Solved by Diego in post #3 
              
              
                sorry this was a mistake by me. I had set the device_ids variable in the DDP constructor besides using the CUDA_VISIBLE_DEVICES variable, once I removed the former the script runs as expected.