Solved by albanD in post #4 
              
              
                Hi, 
Two things: 

The CUDA_VISIBLE_DEVICES environment variable is read by the cuda driver. So it needs to be set before the cuda driver is initialized. It is best if you make sure it is set before importing torch (or at least before you do anything cuda related in torch).
The device numbers within…