you can try inserting torch.cuda.synchronize() right before the enqueue maybe?
CUDA calls are async in nature, but if you only do all GPU calls, ordering is preserved by CUDA streams. The stream ordering guarantees dont extend across processes (each process has it’s own CUDA context and stream)