I created a kernel which took 10ms to execute in order to see what is the CPU behavior when a kernel is running on a GPU.
Thanks to some topics on this forum I understood that the CPU is spinning to wait the end of a GPU process (default behavior). Thus it’s using 100 % of the CPU.
I learned that when you are using cudaSetDeviceFlags with the cudaDeviceScheduleBlockingSync flag, the process will be blocked and the CPU could be used for something else. It means that the cpu usage is lower than the spinning mode.
But when I do this trick, it doesn’t change a thing to the cpu usage, I still have 100 %.
Someone guessed in the bellow link that those flags might not be implemented in Linux.
The question is : Still this feature not implemented in Linux api ? Or what I’m doing wrong.
Information about my test :
- Nvidia GTX 950
- RHEL 6.0
- CUDA 7.5
- cudaSetDeviceFlags is used before all context creation