You are not logged in.

#1 2019-09-09 01:13:44

postfinem
Member
Registered: 2019-08-27
Posts: 7

[SOLVED] startx doesn't work with Nvidia Optimus

For about a week now, I've been trying to get Xorg working on my Lenovo Thinkpad P1 that has both integrated Intel graphics as well as a Nvidia Quadro P1000 Mobile graphics card.  I have the packages nvidia and xf86-video-intel installed, as well as optimus-manager and i3, and the last line of my .xinitrc is exec i3.  My initial issue was that running startx, Xorg -configure, or lspci would cause my computer to shutdown after hanging for a bit.  I managed to fix this by following the advice given here creating /etc/modprobe.d/blacklist.conf and adding

install i915 /usr/bin/false
install intel_agp /usr/bin/false

after adding this file and rebooting, my computer no longer shuts down when I run any of the above commands, but now running startx results in an error spread across several lines. (it looks something like this)

xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
Fatal server error: no screens found
Please consult The X.Org Foundation support at http://wiki.x.org for help.
Please also check the log file at "/home/devyn/.local/share/xorg/Xorg.0.log" for additional information.
Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

The full Xorg.0.log file is here; at the top of the file is the line

(WW) Failed to open protocol names file lib/xorg/protocol.txt

I don't know if that warning is relevant or not, but from the first error to the end of the file is as follows:

[   887.238] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[   887.238] (EE) NVIDIA:     system's kernel log for additional error messages and
[   887.238] (EE) NVIDIA:     consult the NVIDIA README for details.
[   887.503] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[   887.503] (EE) NVIDIA:     system's kernel log for additional error messages and
[   887.503] (EE) NVIDIA:     consult the NVIDIA README for details.
[   887.504] (WW) Falling back to old probe method for modesetting
[   887.504] (II) modeset(1): using default device
[   887.757] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
[   887.757] (EE) NVIDIA:     system's kernel log for additional error messages and
[   887.757] (EE) NVIDIA:     consult the NVIDIA README for details.
[   887.757] (II) modeset(G0): using drv /dev/dri/card0
[   887.757] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   887.757] (EE) Screen 0 deleted because of no matching config section.
[   887.757] (II) UnloadModule: "modesetting"
[   887.757] (EE) Screen 0 deleted because of no matching config section.
[   887.757] (II) UnloadModule: "modesetting"
[   887.757] (EE) Device(s) detected, but none match those in the config file.
[   887.757] (EE)
Fatal server error:
[   887.757] (EE) no screens found(EE)
[   887.757] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
[   887.757] (EE) Please also check the log file at "/home/devyn/.local/share/xorg/Xorg.0.log" for additional information.
[   887.757] (EE)
[   887.760] (EE) Server terminated with error (1). Closing log file.

After spending about a week trying to figure this out, the only reason I still have hope that I should be able to make it work is that Manjaro was installed previously and worked fine.  If any other files or outputs are needed, let me know; any help is appreciated.

Last edited by postfinem (2019-09-10 00:00:19)

Offline

#2 2019-09-09 08:07:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,665

Re: [SOLVED] startx doesn't work with Nvidia Optimus

The advice to blacklist your intel modules is wrong (in general, you should ignore the normal nvidia article on optimus), Optimus works by relaying your nvidia image over your intel card you have to have the intel modules loaded. Remove xf86-video-intel, remove any xorg configuration you tried to generate, then read https://wiki.archlinux.org/index.php/NVIDIA_Optimus and don't do anything that isn't explicitly mentioned there as a possibility (and do not mix and match, chose one approach)

If we continue to assume Optimus Manager and heeding that advice from the xorg log, post

pacman -Qs nvidia
pacman -Qs libgl
pacman -Qs linux
systemctl status optimus-manager
uname -a
dmesg

and while we are at it maybe your actual .xinitrc.

Last edited by V1del (2019-09-09 08:21:59)

Offline

#3 2019-09-09 09:17:23

postfinem
Member
Registered: 2019-08-27
Posts: 7

Re: [SOLVED] startx doesn't work with Nvidia Optimus

Thanks for the response.  I removed blacklist.conf and xorg.conf.new, and removed xf86-video-intel.  So far my error is the same.  The outputs of the commands were as follows:

pacman -Qs nvidia

local/nvidia 435.21-2
     NVIDIA drivers for linux
local/nvidia-utils 435.21-1
     NVIDIA drivers utilities

pacman -Qs libgl

local/libglvnd 1.1.1-1
     The GL Vendor-Neutral Dispatch library
local/mesa 19.1.6-1
     An open-source implementation of the OpenGL specification
local/nvidia-utils 435.21-1
     NVIDIA drivers utilities

pacman -Qs linux

local/alsa-lib 1.1.9-2
    An alternative implementation of Linux sound support
local/archlinux-keyring 20190827-1
    Arch Linux PGP keyring
local/avahi 0.7+18+g1b5f401-2
    Service Discovery for Linux using mDNS/DNS-SD -- compatible with Bonjour
local/filesystem 2019.05-2 (base)
    Base Arch Linux files
local/iptables 1:1.8.3-1
    Linux kernel packet control tool (using legacy interface)
local/keyutils 1.6.1-1
    Linux Key Management Utilities
local/kmod 26-2
    Linux kernel module management tools and library
local/libaio 0.3.112-1
    The Linux-native asynchronous I/O facility (aio) library
local/libutil-linux 2.34-3
    util-linux runtime libraries
local/libxshmfence 1.3-1
    a library that exposes a event API on top of Linux futexes
local/linux 5.2.13.arch1-1 (base)
    The Linux kernel and modules
local/linux-api-headers 5.1-1
    Kernel headers sanitized for use in userspace
local/linux-firmware 20190815.07b925b-1 (base)
    Firmware files for Linux
local/man-pages 5.02-1 (base)
    Linux man pages
local/mdadm 4.1-1 (base)
    A tool for managing/monitoring Linux md device arrays, also known as Software RAID
local/nvidia 435.21-2
    NVIDIA drivers for linux
local/pacman-mirrorlist 20190821-1
    Arch Linux mirror list for use by pacman
local/util-linux 2.34-3 (base base-devel)
    Miscellaneous system utilities for Linux

systemctl status optimus-manager

● optimus-manager.service - Optimus Manager Commands Daemon
   Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-09-09 04:38:08 EDT; 20min ago
  Process: 505 ExecStartPre=/usr/bin/prime-switch-boot (code=exited, status=0/SUCCESS)
 Main PID: 582 (python3)
    Tasks: 1 (limit: 4915)
   Memory: 28.8M
   CGroup: /system.slice/optimus-manager.service
           └─582 /usr/bin/python3 -u /usr/bin/optimus-manager-daemon

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

uname -a

Linux purple 5.2.13-arch1-1-ARCH #1 SMP PREEMPT Fri Sep 6 17:52:33 UTC 2019 x86_64 GNU/Linux

dmesg (pastebin)

.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

exec i3

Offline

#4 2019-09-09 13:15:06

vegarab
Member
Registered: 2017-12-22
Posts: 47

Re: [SOLVED] startx doesn't work with Nvidia Optimus

Looks like you did not add the following lines to the start of your .xinitrc

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

I have a similar laptop (X1 Extreme), following the NVIDIA graphics only part here https://wiki.archlinux.org/index.php/NV … phics_only solved the same issue for me.

Offline

#5 2019-09-09 13:42:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,665

Re: [SOLVED] startx doesn't work with Nvidia Optimus

Yeah just read up on it, optimus manager is only really intended to be used with display managers. If you want to use .xinitrc you will want to remove/disable it and use direct .xinitrc adjustments as mentioned above (or keep it but remember to comment/uncomment the two xrandr lines, and run the relevan optimus-manager switch command so that proper module blacklists are generated...)

Last edited by V1del (2019-09-09 13:45:17)

Offline

#6 2019-09-09 23:59:48

postfinem
Member
Registered: 2019-08-27
Posts: 7

Re: [SOLVED] startx doesn't work with Nvidia Optimus

Thanks for the help; it's finally working!  I followed the advice for NVIDIA graphics only, as well as deleted optimus manager, restored the intel blacklist (I couldn't run lspci otherwise), and I also changed the settings in bios to run with discrete graphics only.  Now that Xorg is working, I can spend the next week configuring i3!!

Offline

Board footer

Powered by FluxBB