CPU spinning during kernel execution

I’ve noticed that CPU usage is at 100% during execution of any long-running compute bound kernel. Is there a way to eliminate this wasteful spinning?

I’ve tried the following

  • calling cudaSetDeviceFlags with cudaDeviceScheduleBlockingSync arg
  • calling cudaSetDeviceFlags with cudaDeviceScheduleYield arg
  • including #pragma wait
  • calling acc_async_wait_all

Nothing worked.

I’m using PGI 16.10 on Tesla K20m.

Any advice appreciated, -Ondrej

It seems that spinning is caused by the CUDA runtime library.

I checked also CUDA forums and found it a recurring problem there.

Perhaps an update of the driver would help (currently using version 352.55) ?

Hi Ondrej,

Sorry, but I don’t know if an updated driver would fix this or not. Though, newer drivers will work with older devices and codes so it shouldn’t hurt to update your driver.

-Mat