Thanks for posting your code and details!
I see that when you init the process group with NCCL you specify the init_method as “tcp” and provide a local IP and port. Can you ensure that those are reachable? Alternatively, since you are already setting the address and port as environment variables and it works for gloo, you can remove the “init_method” parameter from init_process_group and it will default to use “env://” and that should work as well.
dist.init_process_group("nccl", rank=rank, world_size=world_size)

Here is the documentation for init_process_group: Distributed communication package - torch.distributed — PyTorch 1.8.1 documentation 2
Please let me know if this works.