The dist.barrier() would synchronize the code and could thus potentially reraise a valid exception.
For the 3 different errors:

reduce the model or batch size to avoid the OOM
the NCCL error might be a red herring and could in fact also be the OOM issue
Could you post the stack trace here, please? Also, are you using custom CUDA code?

PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.