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/libglx.so. However, this “libglx.so” is a link to “libglx.so.352.21”, 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 libglx.so.

The only way I can find to use iGPU for display is to uninstall NVIDIA driver. And then reinstall libglx.so (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 libglx.so (actually, also many other statics libraries like libGL.so.1 …). 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 libglx.so.352.21, 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., libglx.so, by their own. Same situation also discussion here, [url]http://osdf.github.io/blog/intel-integrated-graphics-dedicated-gpu-for-cuda-and-ubuntu-1310.html[/url].

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 *-tls.so *-glcore.so.

The way I solve this situation is to uninstall Nvidia diver 352.21. Reinstall mesa and other packages. Then use CUDA-7.0.run 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 ([url]http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/[/url]) 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.