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)