How to use graphics card only for deep learning and not display?

Solution 1:

NVIDIA has a suggestion for this question.

Their recommendation is to use two GPUs: one for X, and one for computation. They also suggest disabling X, limiting the CUDA kernel to short execution times, and turning off interactive mode in the NVIDIA driver.

You don't say that you're using an NVIDIA graphics card, but some of these suggestions may work for any graphics card.

If your motherboard has onboard graphics in addition to a discrete graphics card, you may be able to configure the BIOS to use the onboard graphics for your display.