When a kernel is running for a large (>1s) period of time, i can still move my mouse and see the cursor move on the screen. I cant click anything, but what is it that is rendering my cursor on the screen if the video card is busy with a cuda kernel?
Actually the resources are shared between CUDA calculations and the graphics tasks, I suspect in favor of the second. Sometimes under heavy CUDA load it becomes really hard to interact with my mouse and I can feel that GPU being under a load. Also, under high resolutions the available memory to CUDA decreases significantly.
Your GPU has hardware cursor support, which basically means that the blitting of the cursor doesn’t depend on updates of the front-buffer.
This is why in many games, the cursor stays smooth, even if the frame rate drops. Cool little thing, that.
But CUDA is a completely different compute mode on the GPU. There is a context switch that happens when a CUDA kernel activates and when it does not even the mouse cursor will move until that kernel completes.
But to answer Sarnaths concerns, the context switch back to graphics mode only happens after a kernel completes so there are no issues when shared memory or the like.
Thanks for the answer. THat is what I had in mind as well. The context switch that you mention happens when you launch the kernel and after that it goes un-interrupted and then the context is restored back once the kernel is done.
So, during kernel execution,the Kernel is the King.
Beware of autocratic Kings who dont want to relinquish power. They can hang your display.
But NVIDIA’s constitution allows for a 5-sec watchdog to save you from such fellas…
I put 1s as a lower bound, i have kernels that run for 5-10 seconds. Or even a moving cursor right until the PC bluescreened from a watchdog problem.
One of my teacher told me that in X (which im not using, im in windows) only what is actually 3d accelerated (say, a glxgears window) will come out of the “accelerating” part of the GPU while normal blitting, if the rest of the window, if not updated, will continue to display, which is the phenomenom we re seeing.
Still doesnt explain the fact that my cursor is moving… or is it just me?
What TB said is pretty interesting, im looking into that right now.