Enable Nvidia gpu and Intel integrated gpu simultaneously

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by Pheeble »

After repeatedly reading that it is impossible to enable both an Nvidia gpu and an integrated Intel gpu at the same time, I have discovered a simple method that has worked for me in my desktop pc.

Apparently this has been possible since RandR version 1.4 in 2013. In fact, the Intel gpu is not being used for graphics processing, but simply to display the desktop output of the Nvidia gpu on an Intel-connected monitor, as detailed at http://uk.download.nvidia.com/XFree86/L ... ndr14.html

I have successfully tested it in new default installations of Linux Mint Mate 18.3 and Xubuntu 16.04.4 without requiring any xorg.conf file creation.

This tutorial assumes that at least one monitor is attached to the Nvidia gpu, and at least one monitor to the motherboard. I have 3 monitors connected to the Nvidia gpu (2 DVI + 1 VGA), and one connected to the motherboard VGA port. Together the monitors form a single very wide desktop; windows can be dragged from any monitor to any other monitor. Maximizing a window causes it to fill one monitor only.

My system:
Motherboard: Gigabyte Z97X-SOC Force with AMI BIOS firmware version F7
CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz with integrated Intel gpu
Display: Nvidia GeForce GTX 970 on PCI Express x16 controller

The basic method is:

1. Ensure integrated GPU is disabled in the BIOS settings. To check, boot the computer and enter the BIOS settings. On my system this means holding the DEL key while booting. Save any changes in the BIOS and reboot.
bios_display_settings_before_installation.png

2. Perform a standard installation of the operating system.

3. Boot into the newly installed OS. One monitor connected to the Nvidia gpu will be active. Install the driver for the Nvidia GPU. In Linux Mint Mate 18.3: Menu -> Administration -> Driver Manager. Restart the computer. Now all Nvidia-connected monitors should be active.

4. Reboot the computer, and enter the BIOS settings. Enable the Intel gpu and set Intel as the initial display. Save BIOS settings and reboot.
bios_display_settings_after_installation.png

5. The OS loads and now uses the monitor attached to the motherboard as the initial display. It may be necessary to rearrange the desktop layout to span the different monitors in the correct order. In Linux Mint Mate 18.3, open Menu -> Preferences -> Displays and drag the monitor layout icons around to get the configuration you want. The Display Preferences dialog in Linux Mint Mate 18.3 can be problematic. It may require a bit of patience as it sometimes restricts the placement of the monitor icons, making it difficult to rearrange all icons at once. I had to move one or two monitor icons, apply and close, then reopen the Display Preferences dialog again and continue. Repeat until all the monitor layout is organized how you want.
Monitor Preferences.png

At this point all of the monitors should be tiled to act as one continuous desktop.

The Nvidia gpu is fully accessible to the system. I have played Steam games and performed gpu rendering using CUDA and OpenCL in Blender without any problem.

P.S. I would have attached more screenshots but the forum limits me to 3 attachments. Other screenshots are attached at viewtopic.php?f=49&t=265883&p=1445093#p1445093
Last edited by Pheeble on Sun Mar 18, 2018 5:11 pm, edited 1 time in total.
Pheeble
Level 3
Level 3
Posts: 116
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

xorg.conf version: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by Pheeble »

Sometimes it is necessary to use a device configuration in /etc/X11/xorg.conf - as I do due to a missing edid in my Viewsonic monitors:

Code: Select all

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
    Option "CustomEDID" "DFP-0:/etc/X11/viewsonic-vp950b-edid.bin; DFP-4:/etc/X11/viewsonic-vp950b-edid.bin"
EndSection
The 'ServerLayout' section sets the Nvidia device as the active gpu, and prevents the Intel gpu from being involved in rendering. The Intel device is only used for displaying a desktop rendered by the Nvidia device. This is referred to as 'offloading', as explained at http://uk.download.nvidia.com/XFree86/L ... ndr14.html.

There follows a pair of 'Device' and 'Screen' sections for each of the gpus. The 'Device' sections specify the PCI bus used by each gpu. This can be determined for the devices using 'lspci':

Code: Select all

lspci | grep -i 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 GM204 [GeForce GTX 970] (rev a1)
For the Intel, the lspci output is '00:02.0'. In xorg.conf, this is translated to '0@0:2:0'. So the xorg.conf PCI bus address for the Intel device becomes ' BusID "PCI:0@0:2:0" '. Similarly, the Nvidia's PCI bus address is translated from lspci's '01:00.0' to xorg.conf's ' BusID "PCI:1@0:0:0" '. Adjust according to your system's lspci output.
majenko

Re: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by majenko »

That is awesome stuff! I have been running on a pair of nVidia cards for a while now, and getting it to work with three monitors has been a right royal pain. And now one of them has a fan that is giving up the ghost - groaning like mad. I've "fixed" it numerous times, but decided I wanted to simplify.

Now thanks to this I have got the internal intel on my HP i5 running as an offload with three screens seamlessly - no configuration (other than arranging them with xrandr) needed - and only one nVidia card installed. Bliss.
lptessier

Re: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by lptessier »

Thank @Pheeble

It is working great. My old Lenovo LT22529 edid was'nt readable by any edid reader on Linux. I had to extract that edid from windows and make the change into the xorg.conf file.

LP
dimi_37
Level 1
Level 1
Posts: 11
Joined: Tue Feb 04, 2020 5:42 am
Contact:

Re: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by dimi_37 »

I have similar system specifications. All monitors are displaying the desktop. My only problem is that I get screen tearing on the monitor assigned on the intel GPU. I am searching for a tweak to fix the screen tearing and nothing more. I have tried this solution viewtopic.php?f=49&t=226953&p=1197801&h ... d#p1197801 but with this solution, Nvidia is disabled and only the intel GPU and connected monitor are working.
User avatar
SMG
Level 25
Level 25
Posts: 31047
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by SMG »

dimi_37 wrote: Thu Nov 25, 2021 11:38 am I have similar system specifications. All monitors are displaying the desktop. My only problem is that I get screen tearing on the monitor assigned on the intel GPU. I am searching for a tweak to fix the screen tearing and nothing more. I have tried this solution viewtopic.php?f=49&t=226953&p=1197801&h ... d#p1197801 but with this solution, Nvidia is disabled and only the intel GPU and connected monitor are working.
Please create a new topic for your issue. This tutorial topic is nearly three years old and the code has changed since then. Code changes are a reason we ask people not to resurrect topics more than six months old.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
dimi_37
Level 1
Level 1
Posts: 11
Joined: Tue Feb 04, 2020 5:42 am
Contact:

Re: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by dimi_37 »

Ok. Pardon me!
Post Reply

Return to “Tutorials”