HOWTO: Ubuntu 14.04: intel iGPU for display and GTX 960 for CUDA

As the title, I have a desktop and want to use iGPU for display and GTX 960 only for CUDA.

I know someone says this can be done by delete “Device” about Nvidia from xorg.conf and explicitly add BusID to “Device” under intel iGPU.

However, after I reboot, I meet a login loop, which means X window brings me back to the login window after I enter my password.

I went to tty1 and restart the lightdm service. It stops at loading extension GLX. I checked Xorg.0.log, it shows that when it tried to load GLX, it use /usr/lib/xorg//modules/extensions/ However, this “” is a link to “”, which is from the NVIDIA 352.21 driver. So this means that X window tries to use Nvidia file for glx anyway because NVIDIA driver made a link to

The only way I can find to use iGPU for display is to uninstall NVIDIA driver. And then reinstall (from a package about libg11 or something, I forget). But I can not use CUDA without NVIDIA driver.

To summary, install NVIDIA driver will delete former (actually, also many other statics libraries like …). If I use Nvidia GTX 960 for display and cuda, it works fine. But, if I change the BIOS and xorg.conf to use intel iGPU for display, it tries to use Nvidia’s, which leads me to a login loop. To use intel iGPU for display, I need get my previous statics libraries back which drives me crazy.

I wonder whether someone here can help me and tell me how to use intel iGPU for display and GTX 960 for CUDA only, considering my situations above.

Thank you.

I find one solution by myself and hope this can help others.

The main reason for this situation is Nvidia divers replace some *.so files, e.g.,, by their own. Same situation also discussion here,

To summary their solution, first they install Nvidia driver and then reinstall mesa and some other packages. But in my case, I still get errors when load GLX, some errors related to * *

The way I solve this situation is to uninstall Nvidia diver 352.21. Reinstall mesa and other packages. Then use to install Nvidia driver 346.46, which comes with this .run file. And I also choose not to install Nvidia’s OpenGL. Then I can login in X window fine with iGPU for display.

But as Nvidia driver does not work on X server. I get many N/A from nvidia-smi. Also nvidia-setting does not work as they require Nvidia driver works on X. But anyway, I can use my GTX 960 for heavy work without disturbing my display.

Hope this can help.

I find one solution for my laptop (HD4000 + NV860M), I hope it will help you.

When I have installed Ubuntu, I have a device i915 for Intel and nouveau for Nvidia. The primary display is on the Intel Graphics. Then I have blocked the nouveau device according to the Cuda tutorial ( by installing with the runfile. Make sure to use –no-opengl-libs so your previous display settings are not overwritten. After that, you should have Intel for display and Nvidia for Cuda.

I am not sure that works on desktop, but hope you can find you way out soon.