You are not logged in.

#1 2021-09-04 10:09:29

Gmanos
Member
From: Poland
Registered: 2021-08-29
Posts: 7

[SOLVED]Dual head setup with hybrid graphics

So my laptop's screen is connected to integrated intel's gpu, and I use external HDMI monitor as my primary, that's connected to nvidia's gpu. I setup my xorg to use Reverse Prime according to this https://us.download.nvidia.com/XFree86/ … ndr14.html but my laptop's screen doesn't enable by default. I can enable it mannualy by running

 xrandr --output eDP-1-1 --auto --right-of HDMI-0 

command. I tried appending it my xinitrc but it doesn't work properly, all I can do is moving my couror around. To make it work again I need to reenable it (xrandr --off and again xrandr --output ...). Screen connected to HDMI works fine.

Outputs:

lspci | grep VGA

00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)

xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 5 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x1fd cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting

xrandr -q

Screen 0: minimum 8 x 8, current 2560 x 1080, maximum 32767 x 32767
DP-0 disconnected primary (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 2560x1080+0+0 (normal left inverted right x axis y axis) 673mm x 284mm
   2560x1080     60.00*+
   1920x1080     60.00    59.94    50.00    60.05    60.00    50.04
   1680x1050     59.95
   1600x900      60.00
   1280x1024     75.02    60.02
   1280x720      60.00    59.94    50.00
   1152x864      75.00
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       59.94
   640x480       75.00    59.94    59.93
eDP-1-1 connected (normal left inverted right x axis y axis)
   1920x1080     60.03 +  60.01    59.97    59.96    59.93
   1680x1050     59.95    59.88
   1400x1050     59.98
   1600x900      59.99    59.94    59.95    59.82
   1280x1024     60.02
   1400x900      59.96    59.88
   1280x960      60.00
   1440x810      60.00    59.97
   1368x768      59.88    59.85
   1280x800      59.99    59.97    59.81    59.91
   1280x720      60.00    59.99    59.86    59.74
   1024x768      60.04    60.00
   960x720       60.00
   928x696       60.05
   896x672       60.01
   1024x576      59.95    59.96    59.90    59.82
   960x600       59.93    60.00
   960x540       59.96    59.99    59.63    59.82
   800x600       60.00    60.32    56.25
   840x525       60.01    59.88
   864x486       59.92    59.57
   700x525       59.98
   800x450       59.95    59.82
   640x512       60.02
   700x450       59.96    59.88
   640x480       60.00    59.94
   720x405       59.51    58.99
   684x384       59.88    59.85
   640x400       59.88    59.98
   640x360       59.86    59.83    59.84    59.32
   512x384       60.00
   512x288       60.00    59.92
   480x270       59.63    59.82
   400x300       60.32    56.34
   432x243       59.92    59.57
   320x240       60.05
   360x202       59.51    59.13
   320x180       59.84    59.32
  1680x1050 (0x1c9) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1280x1024 (0x1cc) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1024x768 (0x1d2) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1d4) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  640x480 (0x1d8) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

my xinitrc

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi


# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi


xrandr --setprovideroutputsource modesetting NVIDIA-0 &
#xrandr --output eDP-1-1 --mode 1920x1080 --right-of HDMI-0 &
setxkbmap pl &
xset -b &
picom --experimental-backends & 
exec i3

xorg.conf

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "AllowNVIDIAGPUScreens"
    Inactive	   "intelGPU"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "HDMI"
    Option         "Enable" "True"
    Option	   "LeftOf" "eDP"
    Option         "DPMS" "True"
EndSection

Section "Monitor"
    Identifier     "eDP"
    Option         "Enable" "True"
    Option	   "RightOf" "HDMI"
    Option         "Primary" "True"
    Option	   "DPMS" "True"
EndSection

Section "Device"
    Identifier     "nvidiaGPU"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
    Option	   "Monitor-HDMI-0" "HDMI"
EndSection

Section "Device"
    Identifier     "intelGPU"
    Driver         "modesetting"
    BusID	   "PCI:0:2:0"
    Option	   "Monitor-eDP-1-1" "eDP"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "nvidiaGPU"
    Monitor        "HDMI"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Last edited by Gmanos (2021-09-04 12:12:53)

Offline

#2 2021-09-04 11:07:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,306

Re: [SOLVED]Dual head setup with hybrid graphics

Don't background the xrandr calls.

xrandr --setprovideroutputsource modesetting NVIDIA-0 
xrandr --output eDP-1-1 --auto --right-of HDMI-0 

note the lack of a &

I'd also replace that static xorg.conf that can break due to a variety of causes with something not as explicit and rigid and use the config mentioned in: https://wiki.archlinux.org/title/NVIDIA … phics_only instead.

Last edited by V1del (2021-09-04 11:09:20)

Offline

#3 2021-09-04 12:12:27

Gmanos
Member
From: Poland
Registered: 2021-08-29
Posts: 7

Re: [SOLVED]Dual head setup with hybrid graphics

Well... I didn't expect my solution to be that simple.  Thanks!

Offline

Board footer

Powered by FluxBB