Hi. I’ve got a program with kernel run times just short of a second, with the kernel being repeatedly called. If I run the code on my primary display device, Windows becomes a bit unresponsive, though there are no lock-ups during execution. Maximising and minimising of windows take a second or two, and sometimes the cursor stutters. It goes back to normal when the program exits.
However, If I run the same program on my secondary graphics card, which does not have any displays attached, there is no problems with windows response time.
My question is: has anyone else experienced this? Is this what one would expect? Are there any workarounds? I’d like to check before ordering a third graphic card to dedicate to display.
Yes, this is expected behavior. CUDA gives complete control of the GPU over to your kernel for the second it is running, which means the GUI cannot update during that period. Once your kernel is finished, the driver hands control to the waiting GUI code, then schedules another kernel to run. In fact, if your kernel takes more than 3-5 seconds, the driver will abort your kernel to allow the GUI to update. Avoiding the primary display adapter in CUDA is a reasonable solution.
If I understand you correctly, you describe the situation from single app perspective (what is going on in CUDA based application code).
I got similar behaviour on my computer and the real question is:
Why the other windows are droved so slowly when any CUDA app is in charge. Even mouse pointer is “jumping”. It seems that 2D drawing is slowed down by CUDA apps.
That is not a solution for me, I got only one NVidia card with two screens. The negative effect also affects the second screen.
Is there possibility to tweak some settings, that will change the processing power given to CUDA apps ?
The only way to improve things without a second card is to make your kernel runtime shorter, so that the GUI can update between calls. Kernel calls on the order of a second will introduce noticeable lag. If you can shorten them to 100 ms, things might be tolerable.