Be alert to run a long kernel if you only have one video card

The kernel may be aborted if it runs for 3-5s, as pointed out by seibert
I am wondering if its possible to “freeze” all the GUI jobs on the video card so the program can take all the GPU.