Either break up your compute workload into a series of smaller stages which can be run as a sequence of short running kernels, or use a dedicated CUDA GPU which isn’t running a display, which completely removes the display driver 5 second limitation.
There is no other realistic way. The display driver watchdog exists for a very valid reason - the display manager on whatever operating system you are running is expecting to have regular, unfettered access to the video hardware to perform display updates. If it doesn’t, at a minimum, the display will be completely frozen and the machine unusable while the kernel is running. In a worst case scenario, the display manager is very likely to crash, and take the rest of the machine with it. Neither is particularly satisfactory.