Looking at torch.autograd.variable 35, you might try device_id in Attempt #1:
x = Variable(torch.randn(3, 4).cuda())
xx = x.cuda(device_id=1)
# TypeError: cuda() got an unexpected keyword argument 'device'

Best regards
Thomas
P.S.: Thank you for the instructive material you publish, I have benefited greatly from it.