Thanks @ptrblck. I have a huge project, and in most places, in order to move the data to the proper device I used “type_as”. Then I wanted to run several instances of that program on different GPUs of the machine at the same time. The problem was that type_as always uses GPU 0. Right now I am using the approach explained here Select GPU device through env vars 137, and it solves my problem.