How to use Intel integrated graphic card for display and NVidia card for CUDA on a desktop
The trick is to load nvidia card in to the device without module nvidia, because nsight don't need this module to debug. And I don't need nvidia module as a display.
Here is what I did:
I add the file named nvidia_cuda into /etc/init.d and make it executive by chmod +X
This is given by nvidia, but I commented the line /sbin/modprobe nvidia
#!/bin/bash
# /sbin/modprobe nvidia
if [ "$?" -eq 0 ]; then
# Count the number of NVIDIA controllers found.
NVDEVS=`lspci | grep -i NVIDIA`
N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l`
N=`expr $N3D + $NVGA - 1`
for i in `seq 0 $N`; do
mknod -m 666 /dev/nvidia$i c 195 $i
done
mknod -m 666 /dev/nvidiactl c 195 255
else
exit 1
fi
This file is from http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#runfile-installation 2.5.2. Runfile Installation, Step 6.
But first you need to verify that you have both cards as pci device. I enabled intel multi-display in BIOS to get this.
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GK208 [GeForce GT 635] (rev a1)
I have succeeded installing CUDA on my laptop with HD4600 + NV860M + Ubuntu 14.04, I hope it will help you.
You just need to follow the official documentation (Cuda installation). The Runfile works better if you want to keep the Intel Graphics for the display because it is the default option. The trick is to use --no-opengl-libs when running the runfile so your previous display settings are not overwritten by Nvidia Driver which cannot be used by X Server.
More details:
- Make sure you have a device iXXX (i915 in my case) for Intel
- Block the nouveau device if it exists
- Run runfile from runlevel 3
- Do not install the OpenGL
- Add Path and all should work fine
I have tried so many times with other solutions, it seems that the official documentation is the best way to do it. If my solution doesn't work for you, I suggest you to read more the doc, maybe you can find somethings interesting.
Hope you can find your way out soon.
install common Graphics driver package: It will select appropriate file for the display:
sudo apt-get install xserver-xorg-video-all