How to limit the cpu kernel usage?


Our server has 56 cpu cores, but when I use the dataloader with num_workers=0, it took all the cpu cores. From htop, I see that all cpu cores works with workload of 100%. What is the cause of this, and how could I confine the cpu usage to a few cpu cores?


This might be related to your problem.

Thanks, but there is one thing that I cannot explain. I have set my dataloader worker number to be 0, and other operations are done with gpu. Why will there still be many threads if no constraints are set? What are these threads doing?

Did you check all operations working on gpu?