Intel + nVida simultaneously. Is it possible for Linux desktop?

Hello.
I wanted to know if is currently possible to use the intel integrated graphics as primary display (HD 4000) and nVidia GPU for computation. I know there is optimus for laptops, but I’m interested in a similar technology to desktop.
For example in Blender 3D with Cycles engine and GPU compute with nVidia CUDA, the system used all graphics resources in the render and is hard to use the computer while the render is running (slow system - lagging). Would be great to use the intel graphics as display while the nVidia GPU rendering is working.
Thanks!

It’s possible and such a usage scenario is described in documentation (headless output).

Hi birdie, thanks for your reply.
Do you know if that documentation is available online?
I have installed the 325.15 driver from the Xorg Edgers PPA repository on Kubuntu 12.04 64bits, and I do not find this documentation in /usr/share/doc/nvidia-325/html.

I appreciate you help me find this documentation.

[url]http://us.download.nvidia.com/XFree86/Linux-x86_64/325.15/README/index.html[/url]

Sorry, I’m confused maybe for my bad English.
Did I should have found something related to “headless output”? I do not find anything. The only thing mentioned about intel seems to be “Chapter 33. Offloading Graphics Display with RandR 1.4”

I have XRandR 1.4. Kernel 3.11.0-031100rc5-generic. Monitor only connected to intel GPU.
My nvidia card is a GT 430. I know, not very good. But I’m interested in doing a tutorial “easy” for the novice user about how to do this that I suggest in this thread.

I have configured multimonitor (multi gpu) from the BIOS, iGPU as the primary display.
I configured the xorg.conf as shown in that link, with the corresponding BusID to nVidia, and I left uncommented ‘Option “UseDisplayDevice” “none”’.

It does not work. Plymouth appears but then it goes to the terminal.
If you tell me that this I have done is right, I could give more logs information.

When I login to the system with intel connected to the monitor and with a blank xorg.conf, “lspci | grep-i vga” shows both (intel and nvidia).

$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation Ivy Bridge Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 430] (rev a1)

Hi YAFU. Are you talking about just using CUDA? You should be able to do that without configuring anything specially. If you need to modify X to start on the Intel chip instead of the NVIDIA one, look for the “BusID” option in the xorg.conf manual page.

Hi aplattner.
I want to use the intel iGPU connected to my monitor and nVidia GPU only to work with CUDA.
Currently (thanks to recent versions of Xorg, kernel and nvidia driver) I do not need to configure xorg.conf for nvidia or intel driver be correctly loaded (I have a blank xorg.conf). I just choose iGPU or PCIe as primary display from the BIOS and the corresponding driver is correctly loaded. With either drivers, lspci shows the two hardware available (I guess it’s because I have multi-GPU enabled from the BIOS)
If I select PCIe, the nvidia driver is loaded and I can use CUDA in Blender as GPU compute. The issue is that the render consumes all graphics resources while working and system becomes slow and is difficult to do anything on the computer while rendering is working. I clarify that I use a Blender version with precompiled CUDA Kernel (I have not installed CUDA on the system).
If I select iGPU, the intel driver is loaded correctly, but CUDA is not available in Blender when the intel driver is loaded. So this last I say is what I want. With the intel driver loaded and the monitor connected to the iGPU, be able to use nVidia CUDA in Blender.

Edit:
Actually, I do not care where the monitor should be connected. I want the intel iGPU handle the graphics part, while I can use the nvidia GPU with CUDA in Blender.

Set the display to the Intel IGP.

  1. Verify that X is running on the Intel GPU (e.g., look in /var/log/Xorg.0.log).
  2. Verify that the nvidia kernel module is loaded: lsmod | grep nv
  3. Verify that the nvidia device control files are created w/ 666 permissions: ls /dev/nv*

Hello jwcalla.
iGPU as primary display from the BIOS. Blank xorg.conf.

[    61.834] (II) intel(0): Creating default Display subsection in Screen section
	"Default Screen Section" for depth/fbbpp 24/32
[    61.834] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[    61.834] (==) intel(0): RGB weight 888
[    61.834] (==) intel(0): Default visual is TrueColor
[    61.834] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 4000
[    61.834] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx
[    61.834] (**) intel(0): Framebuffer tiled
[    61.834] (**) intel(0): Pixmaps tiled
[    61.834] (**) intel(0): "Tear free" disabled
[    61.834] (**) intel(0): Forcing per-crtc-pixmaps? no
[    61.834] (II) intel(0): Output VGA1 has no monitor section
[    61.834] (II) intel(0): Output HDMI1 has no monitor section
[    61.834] (II) intel(0): Output HDMI2 has no monitor section
[    61.834] (II) intel(0): Output DP1 has no monitor section
[    61.834] (II) intel(0): Output DP2 has no monitor section
[    61.835] (--) intel(0): Output VGA1 using initial mode 1920x1080 on pipe 0
[    61.835] (==) intel(0): DPI set to (96, 96)
[    61.835] (II) Loading sub module "dri2"
[    61.835] (II) LoadModule: "dri2"
[    61.835] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
[    61.835] (II) Module dri2: vendor="X.Org Foundation"
[    61.835] 	compiled for 1.12.3, module version = 1.2.0
[    61.835] 	ABI class: X.Org Server Extension, version 6.0
[    61.835] (II) UnloadModule: "vesa"
[    61.835] (II) Unloading vesa
[    61.835] (II) UnloadModule: "fbdev"
[    61.835] (II) Unloading fbdev
[    61.835] (II) UnloadSubModule: "fbdevhw"
[    61.835] (II) Unloading fbdevhw
$ lsmod | grep nv
nvidia               9366287  0 
drm                   298236  5 nvidia,i915,drm_kms_helper
$ ls /dev/nv*
ls: cannot access /dev/nv*: No such file or directory

Thanks.

That last part about CUDA being unavailable is the surprising part. CUDA doesn’t require X to work, but it does require the device nodes to be created first. Newer drivers have a utility called nvidia-modprobe that is used to load the kernel module and create the device nodes; do you have that installed? It might be missing from the xorg-edgers package since it’s a pretty new utility.

Do CUDA applications work if you run them as root while the iGPU is running the display?

With the iGPU as the primary display, if I run “kdesudo blender” CUDA is still not available in Blender. I remind you that I use Blener with precompiled CUDA kernel and I have no installed CUDA.
“nvidia-modprobe” binary not seem to be in any of the Xorg edgers packages. Only one new package called “nvidia-persistenced” which I have installed. Anyway I have downloaded “nvidia-modprobe” and I have compiled and installed, and after reboot I still with CUDA not available. Did I had to do something else? Should there be a script that call to run nvidia-modprobe?
“ls /dev/nv*” still returns the same output as before.
I clarify that “nvidia-modprobe” was installed in “/usr/local/bin/”. I did not know how to choose the Prefix for “/usr/bin”.

I’m doing parallel testing also in Kubuntu 13.04 64bit, and is happening the same as with Kubuntu 12.04.

Yeah it doesn’t look like the nvidia-modprobe utility is being included in the PPAs just yet.

After you compiled and installed the nvidia-modprobe utility, does it have the setuid root permissions (rwsr-xr-x), owner root, group root? (I think you’d want to move this to /usr/sbin. Aaron please correct me.)

In the meantime here’s some light reading:

[url]http://us.download.nvidia.com/XFree86/Linux-x86_64/325.15/README/optimus.html[/url] ← see section “Loading the Kernel Module and Creating the Device Files without X”

[url]Chapter 7. Frequently Asked Questions ← “How and when are the the NVIDIA device files created?”

If you can’t get the nvidia-modprobe utility working just right, consider the script provided here in the meantime:

[url]CUDA Toolkit Documentation

Section 2.5.2. Runfile Installation, step #6. You’ll need to run the script as root of course.

$ ls -l /usr/sbin/nvidia-modprobe
-rwxr-xr-x 1 root root 22976 ago 30 07:59 nvidia-modprobe

I’ve tried copying “nvidia-modprobe” in “/usr/sbin/” and setting to boot in “/etc/rc.local”, and the devices are not created. I have also tried with the script and setting to boot in “/etc/rc.local” and the devices are not created.
But here I am a little confused, if I run as root the script I get:

FATAL: Module nvidia not found

which seems to be true:

$ modprobe -l | grep -i nvi
kernel/drivers/video/nvidia/nvidiafb.ko
kernel/drivers/net/ethernet/nvidia/forcedeth.ko
updates/dkms/nvidia_325.ko

but a module “nvidia” seems to be loaded anyway:

$ lsmod | grep nv
nvidia               9366287  0 
drm                   298236  5 nvidia,i915,drm_kms_helper

Edit: nvidia-modprobe also does not work with (rwsr-xr-x) permissions

I’ve replaced in the script “/sbin/modprobe nvidia” by “/sbin/modprobe nvidia_325”, and the devices are created!

$ ls /dev/nv*
/dev/nvidia0  /dev/nvidiactl

But still no CUDA available in Blender. How I can know if it is a Blender problem (not detecting nvidia CUDA capabilities when iGPU is as primary display)? because I have no CUDA toolkit installed and I do not know with which another application I could try.

Edit: I wonder if the script has worked because modprobe actually load the module. Or because without the error output the script can continue running.

Yeah that script doesn’t attempt to create the device files if the module isn’t successfully loaded (if [ “$?” -eq 0 ]; then…). I know the Ubuntu packagers are using all kinds of names for the nvidia driver versions these days. It’s a real mess.

I didn’t look into the nvidia-modprobe code too closely but that could be the same reason why that wasn’t working also.

Either way, I’m not sure why Blender isn’t detecting CUDA availability. Unfortunately I don’t have any Blender experience, and all my CUDA experience is with the toolkit.

Well, I’ve installed CUDA toolkit 5.5 with examples in Kubuntu 13.04. When I start the system with PCIe as primary display (nVidia), CUDA is available in Blender installed from repositories (without precompiled CUDA Kernel). I compiled two examples of CUDA, smokeParticles and Mandelbrot. They works with PCIe as primary display.
When I start the system with iGPU as the primary display (I have verified that the devices have been created) CUDA is not available in Blender. CUDA examples do not work, and I get the next messages when run from the terminal:

./smokeParticles
CUDA Smoke Particles Starting...

The following required OpenGL extensions missing:
        GL_ARB_multitexture
        GL_ARB_vertex_buffer_object
        GL_EXT_geometry_shader4.

===

./Mandelbrot
[CUDA Mandelbrot/Julia Set] - Starting...
CUDA error at ../../common/inc/helper_cuda.h:898 code=35(cudaErrorInsufficientDriver) "cudaGetDeviceCount(&device_count)"

Is there any useful test that I can do with the CUDA examples?

I wonder if any of the nVidia developers has confirmed in some Linux distribution that in a desktop computer with Intel iGPU and nVidia card had been able to do what I suggest in this thread. If so, would you please be kind enough to tell me what is the distribution in which this works?.
Thank you.

YAFU, Thanks for reporting this issue.

  • Please provide nvidia bug report? what gpu you are using ?
  • how you are using blender application with cuda? any settings in blender? what version of blender?
  • any more information that will help to duplicate this issue?

YAFU, Please provide requested information so we can reproduce this issue in-house…

@sandipt, sorry for the delay in responding. I’ve already sent the bug report.

I would appreciate if you do the tests. If you can make this works in any Linux distribution, I would appreciate that you indicate me how and on which distribution you have made it work. That way I will be able to test and know if it is a problem related to Linux, or my computer.
Thank you.

YAFU, Filed Bug 1384430 to track this issue.