ubuntu 16.04 x64 login in screen loop after installing 390.48 and using integrated Intel graphics

Hi,

I have an nvidia GPU I want to use only for CUDA with my screens connected to my computers built in Intel graphics.

After installing with NVIDIA-Linux-x86_64-390.38.run --dkms --no-opengl-files I boot into the login screen, but when I try to actually log in it just kicks me back out into the login screen.

I can log back into a graphics session by first logging into a terminal session (ctrl + alt + F2) and using nvidia-uninstall.

I tried following this https://devtalk.nvidia.com/default/topic/1031213/linux/problem-installing-nvidia-390-42-driver-on-ubuntu-16-04/post/5247202/#5247202, and I can log in now and have the nvidia driver installed, but /usr/lib/xorg/Xorg and compiz is using the graphics card (267MiB, 152MiB), even though my screens are connected to Intel.

How do I install nvidia graphics drivers for CUDA while using intel graphics for display?

Thanks

You used the correct start with

NVIDIA-Linux-x86_64-390.38.run --dkms --no-opengl-files

Propably you just had to push the Xserver a bit to use the iGPU then, using xorg.conf:

Section "Device"
    Identifier     "intel"
    Driver         "modesetting"
    BusID          "PCI:0:2:0"
EndSection

Adjust the busid to your system.
Otherwise, Please run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post will reveal a paperclip icon.