I’ve seen approaches to set the CPU affinity for a GPU device using nvml as described here 16.
However, I don’t know if and how this approach would work for a general PyTorch process and if you would benefit from it.