Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Problems with nvidia-drivers and 2nd monitor on IGPU
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 254
Location: Nijmegen

PostPosted: Sun Aug 12, 2018 6:06 pm    Post subject: [SOLVED]Problems with nvidia-drivers and 2nd monitor on IGPU Reply with quote

Hi,

I'm having a slight problem with my new pc. I have 2 monitors connected to it, 1 with VGA to the integrated intel GPU and 1 with HDMI to a nvidia GTX 1060. What I would like is to have X on both monitors.

However, I currently have X only on the HDMI monitor. I can get X to move to the VGA monitor by setting the IGPU as primary in the bios settings, but then I don't have X on my HDMI monitor. Xrandr only shows me the outputs of the gpu on which X is currently running.
I'm booting in UEFI mode, and I have tried toggeling CONFIG_FB_EFI. When this is set to 'y' I have a low-resolution console during boot on the HDMI but the VGA stays black, and when it's 'n' I get a console on the VGA but the HDMI keeps an image of GRUB until X starts on this monitor (if the IGPU is deafult it stays black instead, and X appears on the VGA monitor). My motherboard is a MSI Z370-A PRO and it does have a IGPU multi-monitor option, which is enabled.
Is nvidia-drivers not capable of what I want it to do, or is there some additional kernel/X configuration required?


Also, whenever I switch to a tty on the HDMI monior the screen will get corrupted when I return to X. the same happens immidiatly at startx if I add nvidia-drm.modeset=1 to the boot parameters (strangely, glxinfo reports that direct rendering is enabled even without this boot parameter).
What can I do about this weird screen corruption behavior?
Should I just give up on nvidia-drivers and use nouveau instead (even though the feature matrix tells me that nouveau is not completly finished for my GPU)?

Here's some info on my setup:
Code:

andrew@andrew-gentoo-pc ~ % lspci -k
00:00.0 Host bridge: Intel Corporation Device 3ec2 (rev 07)
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7b48
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 07)
        Kernel driver in use: pcieport
00:02.0 Display controller: Intel Corporation Device 3e92
        DeviceName:  Onboard IGD
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7b48
        Kernel driver in use: i915
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
        Subsystem: Micro-Star International Co., Ltd. [MSI] Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation 200 Series PCH USB 3.0 xHCI Controller
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH USB 3.0 xHCI Controller
        Kernel driver in use: xhci_hcd
00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH Thermal Subsystem
00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH CSME HECI
00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH SATA controller [AHCI mode]
        Kernel driver in use: ahci
00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #1 (rev f0)
        Kernel driver in use: pcieport
00:1c.3 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #4 (rev f0)
        Kernel driver in use: pcieport
00:1c.6 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
        Kernel driver in use: pcieport
00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
        Kernel driver in use: pcieport
00:1f.0 ISA bridge: Intel Corporation Device a2c9
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7b48
00:1f.2 Memory controller: Intel Corporation 200 Series PCH PMC
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH PMC
00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH HD Audio
        Kernel driver in use: snd_hda_intel
00:1f.4 SMBus: Intel Corporation 200 Series PCH SMBus Controller
        Subsystem: Micro-Star International Co., Ltd. [MSI] 200 Series PCH SMBus Controller
        Kernel driver in use: i801_smbus
01:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)
        Subsystem: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB]
        Kernel driver in use: nvidia
        Kernel modules: nvidia_drm, nvidia
01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)
        Subsystem: NVIDIA Corporation GP106 High Definition Audio Controller
        Kernel driver in use: snd_hda_intel
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
        Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
        Kernel driver in use: r8169
04:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)
        Subsystem: Lite-On Communications Inc AR9485 Wireless Network Adapter
        Kernel driver in use: ath9k
05:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981
        Subsystem: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981
        Kernel driver in use: nvme


dmseg | wgetpaste
cat /usr/src/linux/.config | wgetpaste
emerge --info | wgetpaste

Sorry for the many typos, I'm still getting used to this keyboard.
_________________
OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400


Last edited by AndrewAmmerlaan on Tue Aug 14, 2018 5:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 185

PostPosted: Sun Aug 12, 2018 10:00 pm    Post subject: Reply with quote

What you're seeing is expected with multi gpu and Xorg. The normal procedure would be disabling the iGPU and connect all monitors to the nvidia GPU. If you can't or don't want tht for whatever reason, you'll have to set up PRIME (meant for notebooks with hybrid graphics but works on desktop, too):
https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 254
Location: Nijmegen

PostPosted: Mon Aug 13, 2018 7:46 am    Post subject: Reply with quote

hhfeuer wrote:
What you're seeing is expected with multi gpu and Xorg. The normal procedure would be disabling the iGPU and connect all monitors to the nvidia GPU. If you can't or don't want tht for whatever reason, you'll have to set up PRIME (meant for notebooks with hybrid graphics but works on desktop, too):
https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910


Thanks, I found the solution on the NVIDIA/Optimus wiki page. I wouldn't have thought to look there if it wasn't for your comment.
I solved it by adding the following to /usr/share/sddm/scripts/Xsetup
Code:

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

and the following to make.conf
Code:

CONFIG_PROTECT="/usr/share/sddm/scripts/Xsetup"

Now both monitors show up in KDE system settings and I can configure them as expected.

I also discoverd that I can get rid of the screen corruption that appears when switching from tty to X by turning the HDMI monitor off and on again. Not a perfect solution, but it works. The annoying thing is that it now happens eveytime after login as well.
I remember having similar problems with fglrx on my old laptop when booting in UEFI mode, could this also be due to UEFI?

In SDDM I still have duplication of the screen instead of extension, which causes the resolution to be weird on the larger monitor. A quick google search suggest that SDDM is not (yet) capable of extension in a multi-monitor setup, is this correct? Is there a login display manager that does support this?
_________________
OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400


Last edited by AndrewAmmerlaan on Mon Aug 13, 2018 8:29 am; edited 1 time in total
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 185

PostPosted: Mon Aug 13, 2018 8:23 am    Post subject: Reply with quote

Quote:
In SDDM I still have duplication of the screen instead of extension, which causes the resolution to be weird on the larger monitor. A quick google search suggest that SDDM is not (yet) capable of extension in a multi-monitor setup, is this correct?

Yes, that's a limitation of sddm, maybe try lightdm (don't forget to add the xrandr commands to its config).
About screen corruption on VT switch: which monitor displays the console? In case of hdmi, see if setting the efifb resolution to the native resolution of the monitor helps.
BTW, nvidia-drm.modeset=1 is necessary to get a tear-free display.
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 254
Location: Nijmegen

PostPosted: Mon Aug 13, 2018 9:16 am    Post subject: Reply with quote

hhfeuer wrote:
Quote:
In SDDM I still have duplication of the screen instead of extension, which causes the resolution to be weird on the larger monitor. A quick google search suggest that SDDM is not (yet) capable of extension in a multi-monitor setup, is this correct?

Yes, that's a limitation of sddm, maybe try lightdm (don't forget to add the xrandr commands to its config).
About screen corruption on VT switch: which monitor displays the console? In case of hdmi, see if setting the efifb resolution to the native resolution of the monitor helps.
BTW, nvidia-drm.modeset=1 is necessary to get a tear-free display.

With efifb the HDMI shows the console, without efifb the console is on the VGA. I assume this is because efifb conflicts with the intel driver. I have tried adding video=efifb:1920x1080 to the kernel paramters, but the console stays at a low resolution, probably because efifb does not support this resolution.

Also nvidia-drm.modeset=1 cause the screen corruption to occur more frequently, without it it's only after I type my password, but with this parameter it happens before sddm starts as well.
I'm gonna try to boot the system in legacy mode instead of UEFI and see what that does.
_________________
OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 185

PostPosted: Mon Aug 13, 2018 9:19 am    Post subject: Reply with quote

Try
video=efifb:width:1920,height:1080
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 254
Location: Nijmegen

PostPosted: Mon Aug 13, 2018 10:03 am    Post subject: Reply with quote

hhfeuer wrote:
Try
video=efifb:width:1920,height:1080

It refuses to boot at all with this parameter, it keeps shwoing the grub screen with a black square in the middle.
Booting without UEFI didn't fix it either, I still got the screen corruption after SDDM.

[EDIT] I have removed 'xrandr --auto' from the xsetup file, this way sddm is shown only on the HDMI monitor, and the second monitor only kicks in after login. This fixes the weird resolutions in sddm. I have tried lightdm as well, while it works as expected, I found that I like the theming of sddm better.

[EDIT2] For future readers who would like to know more about how PRIME works: I found this article to be an interesting read.

[EDIT3] By adding the following to the xsetup file:
Code:

xrandr --output HDMI-0 --off --output DP-1-2 --auto

I have forced sddm to display on the vga monitor only, this keeps the HDMI off until kde starts. Don't ask me why, but this way I don't get any screen corruption, and as added bonus I can use sddm without weird screen resolutions on the larger monitor. And I can also add nvidia-drm.modeset=1 to the kernel parameters without getting any additional screen corruption.
Marking as solved, thanks for your help
_________________
OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum