You are not logged in.

#1 2021-03-25 15:13:10

VanDavv
Member
Registered: 2021-03-25
Posts: 10

X Server not starting when running Optimus laptop only on GPU

I'm using Dell XPS 15 9560, which has two graphic cards - one integrated and one dedicated

$ lspci -k | grep -A 2 -E "(VGA|3D)"
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
	DeviceName:  Onboard IGD
	Subsystem: Dell Device 07be
--
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
	Subsystem: Dell Device 07be
	Kernel driver in use: nvidia

I wanted to follow Use NVIDIA graphics only tutorial, but it didn't work, X server didn't start and seems to freeze with just these two lines on the screen

Starting version 247.4-2-arch
/dev/nvme0n1p3: clean, 113619/3276800 files, 1605346/13107200 blocks

I tried various tutorials and troubleshooting pages, none of which made the X server show up.

Could anyone help me to start the X server using just the dedicated GPU?

Below, I'll list some of the relevant configurations/logs I have that may help solve this issue

/etc/modprobe.d/blacklist-nouveau.conf (I noticed that in "/usr/lib/modprobe.d/nvidia.conf" I also blacklist nouveau, but I guess these do not conflict)

blacklist nouveau
alias nouveau off

/etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

/etc/default/grub (added "nvidia-drm.modeset=1 i915.modeset=0 nouveau.modeset=0 nogpumanager pcie_aspm=off acpi_backlight=none acpi_osi=Linux acpi_osi=!")
/var/log/Xorg.0.log
/usr/share/X11/xorg.conf.d/10-quirks.conf
/usr/share/X11/xorg.conf.d/40-libinput.conf

Offline

#2 2021-03-25 15:24:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

The nvidia chip has no crtc, you'll need the intel chip to feed some output and you want to use https://wiki.archlinux.org/index.php/PR … erse_PRIME

Edit, for clarification: you *cannot* disable the intel chip or disable its kms (modesetting) features.
(W/ the exception that the UEFI allows to turn off the IGP and re-wires the output/s to the nvidia chip)

Last edited by seth (2021-03-25 15:29:14)

Offline

#3 2021-03-25 15:24:55

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

Re: X Server not starting when running Optimus laptop only on GPU

Did you follow the instructions setting up the xrandr calls depending on whether you use .xinitrc or a display manager below the the config?

Offline

#4 2021-03-25 15:38:14

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

seth wrote:

The nvidia chip has no crtc, you'll need the intel chip to feed some output and you want to use https://wiki.archlinux.org/index.php/PR … erse_PRIME

Edit, for clarification: you *cannot* disable the intel chip or disable its kms (modesetting) features.
(W/ the exception that the UEFI allows to turn off the IGP and re-wires the output/s to the nvidia chip)

I followed the page you've linked, now the X server still didn't show up, but at least it's not frozen (the cursor blinks). Here is the updated log /var/log/Xorg.0.log (I don't want to mess anything on my own, so just linking the output. Have been stuck with this issue for 2 weeks now and I don't feel confident at all)

What I want to achieve is to use GPU as a default rendering output - I use my laptop mostly under AC and I want to use my dedicated GPU. I was using Bumblebee on my previous Arch installation and it would default to integrated GPU, and I would like my applications and X server to utilize the dedicated one

V1del wrote:

Did you follow the instructions setting up the xrandr calls depending on whether you use .xinitrc or a display manager below the the config?

Yes, this is what I had in ~/..xinitrc

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

Offline

#5 2021-03-25 15:50:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

Xorg log wrote:

i915.modeset=0

This does not work. Also please don't blindly copy the wiki - the reverse prime example uses the intel chip as main GPU and the nvidia one prviding the desired output.
The https://wiki.archlinux.org/index.php/NV … phics_only example is actually closer, but you *cannot* disable the intel chip.

Offline

#6 2021-03-25 16:09:27

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

seth wrote:
Xorg log wrote:

i915.modeset=0

This does not work. Also please don't blindly copy the wiki - the reverse prime example uses the intel chip as main GPU and the nvidia one prviding the desired output.
The https://wiki.archlinux.org/index.php/NV … phics_only example is actually closer, but you *cannot* disable the intel chip.

I'm really sorry, I would like to be less "blind", but I feel like I am. I thought that following the Wiki as-is would make it work, but obviously it didn't.

I changed my /etc/X11/xorg.conf to the following

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

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:1:0:0"
EndSection

Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
EndSection

Section "Device"
        Identifier "intel"
        Driver "modesetting"
EndSection

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

And added an additional OutputClass to /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

And removed i915.modeset=0 from grub config

Now, the screen looks like it tries to display something, but instead of meaningful content it just renders a black screen

Here is the /var/log/Xorg.0.log and my .xinitrc

xrandr --setprovideroutputsource radeon Intel
xrandr --output HDMI-1 --auto --above LVDS1

Offline

#7 2021-03-25 16:14:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

The pastebin service doesn't load, but

xrandr --setprovideroutputsource radeon Intel

won't work because you don't have a radeon chip.
Refer to "xrandr --listproviders" for a meaning call

Offline

#8 2021-03-25 16:31:57

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

I uploaded now to a different pastebin server, updated log is here - /var/log/Xorg.0.log

I tried to also run the command, but I got

$ xrandr --listproviders
Can't open display 

Tried to google it and set the DISPLAY env variable before the call (with various params, 0.0, :0, :1.0), but it still doesn't work and throws similar error

Offline

#9 2021-03-25 16:34:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

log shows running X11 server w/ nvidia as main GPU and intel available on the modesetting driver, the correct output redirection is likely

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

as in the wiki example.

xrandr requires an active X11 server (eg. if you had run X11 on the intel chip)

Offline

#10 2021-03-25 16:40:15

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

I set the .xinitrc to these lines and it didn't help, it is still displaying just a black screen - /var/log/Xorg.0.log

Offline

#11 2021-03-25 17:20:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

Please post your complete xinitrc.
Also: how exactly do you start X11?

Offline

#12 2021-03-26 10:31:08

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

seth wrote:

Please post your complete xinitrc.

$ cat .xinitrc 
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
seth wrote:

Also: how exactly do you start X11?

I enabled lightdm service, nothing more

Offline

#13 2021-03-26 13:06:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

That doesn't involve xinitrc, use the display-setup-script config, https://wiki.archlinux.org/index.php/Li … ng_monitor

Offline

#14 2021-03-27 10:48:18

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

Sorry, I was wrong - I use LXDM instead of LightDM (so similar names, sorry for not checking it prior)

$ systemctl status lxdm
● lxdm.service - LXDE Display Manager
     Loaded: loaded (/usr/lib/systemd/system/lxdm.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2021-03-27 11:10:59 CET; 34min ago
   Main PID: 322 (lxdm-binary)
      Tasks: 8 (limit: 18977)
     Memory: 176.9M
     CGroup: /system.slice/lxdm.service
             ├─322 /usr/sbin/lxdm-binary
             ├─419 /usr/lib/Xorg -background none :0 vt01 -nolisten tcp -novtswitch -auth /var/run/lxdm/lxdm-:0.auth
             └─425 /usr/lib/lxdm/lxdm-greeter-gtk

And here is the config /etc/lxdm/lxdm.conf

[base]
## uncomment and set autologin username to enable autologin
# autologin=dgod

## uncomment and set timeout to enable timeout autologin,
## the value should >=5
# timeout=10

## default session or desktop used when no systemwide config
# session=/usr/bin/startlxde

## uncomment and set to set numlock on your keyboard
# numlock=0

## set this if you don't want to put xauth file at ~/.Xauthority
# xauth_path=/tmp

# not ask password for users who have empty password
# skip_password=1

## greeter used to welcome the user
greeter=/usr/lib/lxdm/lxdm-greeter-gtk

[server]
## arg used to start xserver, not fully function
arg=/usr/bin/X -background vt1
# uncomment this if you really want xserver listen to tcp
# tcp_listen=1
# uncoment this if you want reset the xserver after logou
# reset=1

[display]
## gtk theme used by greeter
gtk_theme=Adwaita

## background of the greeter
# bg=/usr/share/backgrounds/default.png

## if show bottom pane
bottom_pane=1

## if show language select control
lang=1

## if show keyboard layout select control
keyboard=0

## the theme of greeter
theme=Industrial

[input]

[userlist]
## if disable the user list control at greeter
disable=0

## whitelist user
white=

## blacklist user
black=

Should I install LightDM instead of LXDM?

Offline

#15 2021-03-27 12:05:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

LXDM runs different scripts at different stages, you can put the required redirection there
https://wiki.archlinux.org/index.php/LXDM#Configuration

Offline

#16 2021-03-27 22:34:16

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

Sorry, I tried googling, but I don't know still - what should I put in this configuration? What redirection?

Offline

#17 2021-03-27 22:38:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,005

Re: X Server not starting when running Optimus laptop only on GPU

The output redirection - the xrandr calls this thread revolves around.

Offline

#18 2021-04-26 13:15:56

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

I added the required lines to /etc/lxdm/LoginReady and performed chmod +x on it. The file contents are now this

#!/bin/sh

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

but the lxdm.log shows error

No protocol specified
Can't open display :0

The full logfile is here

$ sudo cat /var/log/lxdm.log
** Message: 15:09:43.870: find greeter (nil)

** Message: 15:09:43.870: find idle (nil)

** Message: 15:09:43.871: 1619442583: add xserver watch


X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
Build Operating System: Linux Arch Linux
Current Operating System: Linux VanDavvPC-XPS-Arch 5.11.7-arch1-1 #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 +0000 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=56882974-63ce-4e26-913f-734b08fd7dff rw loglevel=3 quiet nvidia-drm.modeset=1 nouveau.modeset=0 nogpumanager pcie_aspm=off acpi_backlight=none acpi_osi=Linux acpi_osi=!
Build Date: 14 December 2020  12:10:29PM
 
Current version of pixman: 0.40.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Apr 26 15:09:44 2021
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
** Message: 15:09:44.890: 1619442584: start xserver in 2 retry
** Message: 15:09:44.890: add 0x560890ed5910

** Message: 15:09:44.890: prepare greeter on /var/run/lxdm/lxdm-:0.auth

** Message: 15:09:44.892: start greeter on /var/run/lxdm/lxdm-:0.auth

No protocol specified
Can't open display :0
No protocol specified
Can't open display :0
** Message: 15:09:45.324: greeter 975 session 0x560890ed5910

** Message: 15:09:45.324: user 975 session 0x560890ed5910 cmd USER_LIST

Xorg: ../xserver/dix/privates.c:384: dixRegisterPrivateKey: Assertion `!global_keys[type].created' failed.
(EE) 
(EE) Backtrace:
(EE) 0: /usr/lib/Xorg (xorg_backtrace+0x53) [0x55ed8a376f63]
(EE) 1: /usr/lib/Xorg (0x55ed8a230000+0x151da5) [0x55ed8a381da5]
(EE) 2: /usr/lib/libc.so.6 (0x7f2699aec000+0x3cf80) [0x7f2699b28f80]
(EE) 3: /usr/lib/libc.so.6 (gsignal+0x145) [0x7f2699b28ef5]
(EE) 4: /usr/lib/libc.so.6 (abort+0x116) [0x7f2699b12862]
(EE) 5: /usr/lib/libc.so.6 (0x7f2699aec000+0x26747) [0x7f2699b12747]
(EE) 6: /usr/lib/libc.so.6 (0x7f2699aec000+0x35646) [0x7f2699b21646]
(EE) 7: /usr/lib/Xorg (dixRegisterPrivateKey+0x0) [0x55ed8a2c5870]
(EE) 8: /usr/lib/xorg/modules/libglamoregl.so (glamor_init+0xc9) [0x7f269398afb9]
(EE) 9: /usr/lib/xorg/modules/drivers/modesetting_drv.so (0x7f2694a78000+0x140fd) [0x7f2694a8c0fd]
(EE) 10: /usr/lib/Xorg (AddGPUScreen+0x10e) [0x55ed8a2a940e]
(EE) 11: /usr/lib/Xorg (0x55ed8a230000+0x185eb9) [0x55ed8a3b5eb9]
(EE) 12: /usr/lib/Xorg (0x55ed8a230000+0x1bb288) [0x55ed8a3eb288]
(EE) 13: /usr/lib/Xorg (0x55ed8a230000+0x1bbb12) [0x55ed8a3ebb12]
(EE) 14: /usr/lib/Xorg (0x55ed8a230000+0x14a331) [0x55ed8a37a331]
(EE) 15: /usr/lib/Xorg (WaitForSomething+0x250) [0x55ed8a375c00]
(EE) 16: /usr/lib/Xorg (0x55ed8a230000+0x39914) [0x55ed8a269914]
(EE) 17: /usr/lib/libc.so.6 (__libc_start_main+0xd5) [0x7f2699b13b25]
(EE) 18: /usr/lib/Xorg (_start+0x2e) [0x55ed8a26a5de]
(EE) 
(EE) 
Fatal server error:
(EE) Caught signal 6 (Aborted). Server aborting
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
lxdm-greeter-gtk: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

(process:327): GLib-CRITICAL **: 15:09:46.627: Source ID 3 was not found when attempting to remove it
** Message: 15:09:46.627: xserver stop, restart. return status 86

** Message: 15:09:46.627: 1619442586: add xserver watch


X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
Build Operating System: Linux Arch Linux
Current Operating System: Linux VanDavvPC-XPS-Arch 5.11.7-arch1-1 #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 +0000 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=56882974-63ce-4e26-913f-734b08fd7dff rw loglevel=3 quiet nvidia-drm.modeset=1 nouveau.modeset=0 nogpumanager pcie_aspm=off acpi_backlight=none acpi_osi=Linux acpi_osi=!
Build Date: 14 December 2020  12:10:29PM
 
Current version of pixman: 0.40.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Apr 26 15:09:46 2021
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) modeset(G0): Initializing kms color map for depth 24, 8 bpc.
** Message: 15:09:47.674: 1619442587: start xserver in 1 retry
** Message: 15:09:47.710: greeter 975 session 0x560890ed5910

** Message: 15:09:47.710: user 975 session 0x560890ed5910 cmd USER_LIST

Offline

#19 2021-04-26 13:36:50

VanDavv
Member
Registered: 2021-03-25
Posts: 10

Re: X Server not starting when running Optimus laptop only on GPU

I think my earlier attempts may messed something with the configuration (or some packages). Will follow your steps once again on a fresh arch install and check if it works

Offline

Board footer

Powered by FluxBB