Have you tried sending all variables to cuda in the same place in the code?  I see that you are sending different variables to devices both outside the loop:



 Nasi_Kaashki:

points = points.cuda()


and then also inside the loop:



 Nasi_Kaashki:

if x.is_cuda: # MY CHANGE: adding “.cuda()” y = y.cuda() # MY CHANGE: adding “.cuda()”


I can’t verify this but it’s possible that .cuda() (which I believe defaults to cuda:0) may be sending to different devices in different sections of the code, especially given that one is called within the DataParallel module and one is outside.
It’s also a good idea to use a debugger to check which device the variables used to calculate loss (pointsReconstructed, points.transpose(2, 1).contiguous()) are on: .contiguous() creates a copy of the tensor, for example, but on which device? A debugger also should help you check the gradients (or whether they exist in the first place).