Installing CUDA toolkit 9.1 on Ubuntu 16.04, internal video is C77(nForce 780a/980a SLI) and K620

I am new to this issue. I have an nvidia motherboard with an internal nvidia video driver with NVIDIA® 780a SLI Chipset. I also added a nvidia K620 video for cuda computing. I started with a fresh install of Ubuntu 16.04. After I installed the video

sudo apt-get nvidia-375 nvidia-modprobe

I wasn’t able to login again. I suspect that the nvidia-375 doesn’t work with the motherboard video and that breaks something. In the past I was able to get the ubuntu to work by Alt-CTL-F1 and purge nvidia-*, but that defeats the purpose.

Once Ubuntu stop allowing me in (login stop working), I don’t know how to control the driver.

I suspect I should use x.org Xserver for the internal video, and some other driver for the K620.
I just want to use the K620 for cuda computations. Do I really need to install a driver to run cuda.

I tried not to do it, but then other items were not installed.

Any guidance would be extremely helpful. Thanks

I followed both links and failed:
http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#pre-installation-actions

https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07#install-nvidia-graphics-driver-via-apt-get