I have found a problem. It fails with multiprocessing. For example a dataloader with workers=0 works fine. If I set workers>0 then it fails with cuda initialization error. It fails even if the dataloader is already created. As soon as you create an iterator it fails. For example if you have a training loop that does “for x in dl” then it fails.