Is is feasible for the operating system to refresh the screen display, while a kernel is running on the GPU. For example, if i have a kernel running for 5 sec, the operating system (windows, linux, etc.) will it perform any changes made in these 5 secs on the screen display?
No. At any instant, the GPU will be dedicated to graphics or to CUDA computes, and the display will freeze while the compute is going on. However, the compute vs display context can be switched in millisecond timeframes, and thus by launching short fast kernels you can indeed perform computation on your display board. If you keep kernels to less than roughly 25 ms net runtime, you may not have much visible impact on the display. As the kernels get longer, your display will start to “stutter”… by 250 ms, you’ll be really annoyed. 5 seconds is the absolute limit since the watchdog kernel will kill the kernel (unless you play registry games in Windows. In Linux there’s no way to disable it. I’m not sure about OSX.)
The simple solution especially as a developer is to get a cheap-o second card for display only.
It’s not obvious, but if you get a dual GPU board like a GTX295, you can use one GPU for display and the other for watchdog-less compute.