How to use Nvidia card for CUDA and Ivy Bridge IGP for display in Linux?

Hi,

I am turning here before I finally give up on Linux+CPU+GPU combination. My system has Ivy Bridge CPU with integrated graphics and discrete Nvidia GTX 660 Ti card in PCIe. The main board is AsRock Extreme4-M with Z77 chipset. In BIOS I am able to select Primary Graphics Adapter as PCIe or Onboard (I use onboard for reasons below). I am running Mint 13 KDE.

My wish is to use onboard IGP for display and Nvidia card exclusively for CUDA programming. So far, I have succeeded to install the driver (304.64), module nvidia is shown in lsmod and lspci says:

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1183 (rev a1)

The original xorg.conf produced by nvidia-xconfig didn’t work, so I tried with:

Section “Module”
Load “glx”
EndSection

Section “Device”
Identifier “Device0”
VendorName “Intel i7 3770”
BusId “PCI:0:2:0”
EndSection

Section “Device”
Identifier “Device1”
Driver “nvidia”
VendorName “NVIDIA Corporation”
BusId “PCI:1:0:0”
EndSection

Section “Screen”
Identifier “Screen0”
Device “Device0”
Monitor “Monitor0”
DefaultDepth 24
SubSection “Display”
Depth 24
EndSubSection
EndSection

All in all, the card is detected to be sitting in PCIe and the module is loaded. But the driver is not active and cuda samples device query doesn’t detect any CUDA enabled device. The Xorg.0.log file says:

[ 1492.049] (II) LoadModule: “glx”
[ 1492.050] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 1492.055] (II) Module glx: vendor=“NVIDIA Corporation”
[ 1492.055] compiled for 4.0.2, module version = 1.0.0
[ 1492.055] Module class: X.Org Server Extension
[ 1492.055] (II) NVIDIA GLX Module 304.64 Tue Oct 30 11:18:32 PDT 2012
[ 1492.055] (II) Loading extension GLX


[ 1492.924] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

The strange part is that the error message is in the middle of messages related to the loading of intel graphics driver. It is also very general error and googling for it got me nowhere.

I am not interested in switching graphics (Optimus, bumblebee, …), only in being able to detect and use the CUDA enabled card not used by X.

Can someone please point me into the right direction or at least confirm that such a thing is not possible? I have been traversing forums all over the place and found some scattered reports about how it works with some motherboards, but no recipe has helped me so far. Thanks in advance.

You shouldn’t use the NVIDIA libglx module if you want to use the Intel driver for X. You also don’t need to specify an X device for the nvidia driver if you only want to use it with CUDA. I.e., you can delete the “Device1” section in the configuration you listed above.

When CUDA fails to work, does the /dev/nvidia0 device file exist? If not, please see the CUDA Getting Started guide for Linux at http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#install-cuda-software.

Thanks Aaron, this worked and my Nvidia card is recognized by deviceQuery now.What remains is an issue of IGP not being able to accelerate OpenGL, e.g. when launching glxgears:

Xlib: extension “GLX” missing on display “:0”.
Error: couldn’t get an RGB, Double-buffered visual

I realize this has to do with Nvidia proprietary drivers messing up the mesa setup used by intel (if nvidia driver is uninstalled and mesa libs reinstalled, then glxgears and glxinfo work again). Is there a way to prevent this during nvidia driver installation or should I look the bumblebee way (I believe they are quite on schedule with their repacks of nvidia drivers)?

Anyway, thanks again.