How to use NVIDIA and Intel GPU simultaneously?

The CPU is i3770 and the NVIDIA card is GTX680. I am willing to enable the iGPU and connect the second monitor to it in order to attempt to configure a VGA passthrough as explained in this article.

I have enabled the iGPU in the BIOS setup and installed xf86-video-intel but the monitor connected to it stays off. If I set explicitly that the primary display should be the iGPU, then the monitor connected to the NVIDIA card stays off + X doesn’t start: I see only the boot messages and don’t get even a command line login. So it is either one or the other but never both simultaneously.

How can I do that?

Is your system a desktop or a laptop? Maybe an “Optimus” laptop? Knowing the laptop or motherboard model might help here.
Also posting the output of:

xrandr --listproviders

might help understand if what you look for is possible or not.

Desktop. MB is ASUS P8Z77-V

~]: xrandr --listproviders 
Providers: number : 1
Provider 0: id: 0x279; cap: 0x1 (Source Output); crtcs: 4; outputs: 6; associated providers: 0; name: NVIDIA-0
    output DVI-I-0
    output DVI-I-1
    output HDMI-0
    output DP-0
    output DVI-D-0
    output DP-1

In YaST->Hardware Info section Display I see 2 sections:

P8 series mother board
GK104 [GeForce GTX 680]

Unfolding the P8 series mother board shows various info. Some of it is

Drivers->
    Active: Yes
    modprobe: Yes
    modlues->
        modprobe: i915
...

Resources->
    IO Port->
        Active:Yes,
        Length: 64
        Mode: rw
        start: 61440
....

which I suppose means that it is detected.

I am not familiar with that MB, but apparently your current configuration allows for only one provider of graphics output, namely the discrete card.
I guess that you can switch that, as you likely already did, and get “Providers: number : 1” and “name: Intel”, but apparently not both providing output at the same time.
Unless the BIOS setting “iGPU Multi-Monitor [Enabled]” does something magic, but it doesn’t look like from what I read on your MB manual.
Anyway, if you find a setting that gives “Providers: number : 2”, that’s probably the way to go.
Or wait for a better expert to answer your question :wink:

BTW, having both GPUs powered on and recognized is not enough to have the graphics rendering routed through both of them; your MB wiring and/or BIOS might prevent that possibility.

What could be the reason for X not running when I set iGPU as primary? (in which case the NVIDIA is obviously not active)

As you have seen in the manual - there aren’t any other options apart from enable/disable iGPU multi-monitor, setting which is the primary GPU and with those I have tried all the 4 possible combinations.
But I just read that this LucidLogix MVP is something different: it seems to be a technology which enables using the combined power of both the integrated and discrete GPU to increase overall performance (in certain applications like games). All I found though was that it works in Windows 7 and requires a special driver - which is not downloadable from LucidLogix any more.

Or wait for a better expert to answer your question :wink:

Hopefully :slight_smile:

BTW, having both GPUs powered on and recognized is not enough to have the graphics rendering routed through both of them; your MB wiring and/or BIOS might prevent that possibility.

I am not quite sure how this is supposed to work internally. It makes sense that both GPUs should be able to work together (at least with that MVP for which I found nothing linux related).

Expert on this motherboard? I would tentatively think vendor forums would be better place to ask.

To use them together operating system must at the very least see both of them. So far you did not provide any evidence that both GPUs are seen by Linux simultaneously.

I actually tried Integrated+Nvidia GTX 750Ti at the same time using bumblebee. It is not optimus, but taking advantage of it to create/render a window/object with the full GPU and rest of it on Integrated.

It was VERY finnicky, for example default kernel update for LEAP 42.3 WILL NOT work the kernel required by bumblebee, so you will have to disable LEAP 42.3 update from repository, or change the default kernel from Boot Loaders.

One of the tricks to make sure that linux loads both dGPU and iGPU is to plug monitors through both(in my case VGA for iGPU and DVI for dGPU), and “copy screen” in display setting.

As I said, it is VERY finicky. Sometimes it loads one, sometimes neither, sometimes both. There will be a lot of reboots to make it work 100% of the time. I did have it stabilized, and an update destroyed the setup, but from my limited experience, bumblebeed was my solution.

Isn’t post #4 an evidence that Linux sees the hardware?

Actually I installed bumblebee before starting this thread. As per the notice which bumblebee’s yast installation shows: I added my user to groups ‘bumblebee’ and ‘video’ (as I am using the binary nvidia driver). I also ran mkinitrd and rebooted. Unfortunately that didn’t help. All I got was these errors in the boot messages and there was no option for a second screen in Plasma settings (although my 2 monitors we connected to dGPU and iGPU respectively).

Could you please provide more detail on how you made it work, what kernel you used and so on?

Originally Posted by arvidjaar
To use them together operating system must at the very least see both of them. So far you did not provide any evidence that both GPUs are seen by Linux simultaneously.

You said it, never both simultaneously.

What do you mean? In post #4 I explained that Yast -> Hardware Info shows they are visible simultaneously.

Intel+NVIDA hybrid is an odd combination of hardware. The Intel always transmits the video signal but the NVIDIA can do the rendering.or the Intel but not both rendering at the same time. It would do Rube Goldberg proud

Maybe the term “visible” leads to a misunderstanding…
HWINFO scans the MB buses and gets two pings back, one from the iGPU, the other from the dGPU: that means that both are powered on and the kernel might engage the correct driver for each one if needed.
But that doesn’t mean that both GPUs can actually process video streams at the same time: apparently there is a switch (firmware and/or hardware) that routes graphics data through one OR the other.
Unless you see “Providers: number : 2” when issuing “xrandr --listproviders” you are not able to route two graphics streams to the two GPUs simultaneously: you are forced to choose one or the other, by a BIOS switch apparently.

As to why the Xserver doesn’t start when you select the iGPU, likely you have an X configuration setup during the Nvidia install that calls for an Nvidia video driver irrespective of which GPU is actually enabled and working.

According to what ASUS site and manual says about this MB - it doesn’t sound like a BIOS switch because the LucidLogix MVP driver makes both GPUs work together (in Windows). So I suppose the question comes down to - what software for linux is needed for that?

None that I know of NVIDA does not really support Optimus on Linux

BTW I just noticed something:

I opened virt-manager and the details about the Windows VM guest. Now when I set video to virtio and Display spice Listen type: none and OpenGL: ON I see 2 GPUs in the dropdown. Screenshot:

http://ultraimg.com/images/2017/11/24/ncea.png

http://ultraimg.com/images/2017/11/24/nce0.png

However booting the guest gives the same error as before enabling iGPU:

“Error starting domain: unsupported configuration: This QEMU doesn’t support spice OpenGL”

Show output of “lspci -nnk” , “dmesg” immediately after boot and xorg.log for both cases (with and without iGPU).

I cannot show any output with iGPU because I simply have no login (not even text one).

You claimed some output of some program demonstrated that your OS saw both GPUs simultaneously. How did you obtain this output if you cannot even login?

If you have another computer, you can ssh into your system (I suppose it boots, just does not show any output).

In post #4 the output is from yast hwinfo - from the case when iGPU is not sent as primary in BIOS. In the case when it is - all I got were some boot time messages. No login prompt (not even a console one).

If you have another computer, you can ssh into your system (I suppose it boots, just does not show any output).

I can get a laptop and try that. But I am not 100% sure if it will work because the boot procedure may be incomplete and in case network services have not started I may not be able to do it. Anyway I will try.

What should I be looking for in the logs?