Is there a way of using intel graphics for display while nvidia 100% for computation?

I hope to have my nvidia GPU 100% for computation, and use the integrated intel graphics for display.

Now under Ubuntu 19.04, I can achieve this by booting with Prime set to Intel, and run “prime-select nvidia” to turn the nvidia GPU on. However, I have to manually turn it back to Intel every time I turn my desktop off and vice versa.

I wonder if there’s an easy way to have Prime set to Intel and Nvidia GPU power on automatically at the same time?

Please check if this still works:
[url]ubuntu 18.04+headless_390+intel iGPU after prime-select intel lost contact to GeFORCE 1050ti - Linux - NVIDIA Developer Forums

Thanks. Works for Ubuntu 19.04, Kernel 5.0.0-29-generic, Driver 418.87.01.

I am using the NVIDIA P5000 VPX form factor for computing and Intel graphics for display.

When I run CUDA graphics example I get the following error:

[tre@localhost bindlessTexture]$ ./bindlessTexture
CUDA bindlessTexture Starting…

GPU Device 0: “Pascal” with compute capability 6.1

CUDA error at bindlessTexture.cpp:240 code=999(cudaErrorUnknown) “cudaGraphicsGLRegisterBuffer(&cuda_pbo_resource, pbo, cudaGraphicsMapFlagsWriteDiscard)”
[tre@localhost bindlessTexture]$

The non Graphic Cuda Samples are working correctly.

If you want to use GL/Cuda interop, you need to run an Xserver on the nvidia gpu.