Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Help | startx with an optimus notebook
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
DerPreis
n00b
n00b


Joined: 30 Jul 2018
Posts: 16

PostPosted: Tue Jul 31, 2018 9:48 am    Post subject: [solved] Help | startx with an optimus notebook Reply with quote

Hello folks,

first of all im pretty new at gentoo and this is (one off) my first attempt(s) to install gentoo linux on my Lenovo Legion y520 Notebook.

I followed the handbook to install gentoo with a lvm instead of the normal partition. As profile I picked the normal desktop/plasma one, without anything special like SE or nomultilib.

I already tried different variations to startx:

The first one is use nvidia-xconfig before startx. This one generates me the following /etc/X11/xorg.conf
Code:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 396.24  (buildmeister@swio-display-x64-rhel04-13)  Thu Apr 26 01:13:52 PDT 2018

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from data in "/etc/conf.d/gpm"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

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

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


When I startx afterwards I tells me no screen found. Here's the log after this attempt
Code:
[ 34613.131]
X.Org X Server 1.19.5
Release Date: 2017-10-12
[ 34613.135] X Protocol Version 11, Revision 0
[ 34613.136] Build Operating System: Linux 4.14.52-gentoo x86_64 Gentoo
[ 34613.137] Current Operating System: Linux Aegis 4.14.52-gentoo #3 SMP Mon Jul 30 22:10:56 CEST 2018 x86_64
[ 34613.137] Kernel command line: BOOT_IMAGE=/vmlinuz-4.14.52-gentoo root=/dev/mapper/vg01-rootfs ro dolvm
[ 34613.139] Build Date: 30 July 2018  10:40:15PM
[ 34613.140] 
[ 34613.141] Current version of pixman: 0.34.0
[ 34613.143]    Before reporting problems, check http://wiki.x.org
   to make sure that you have the latest version.
[ 34613.143] Markers: (--) probed, (**) from config file, (==) default setting,
   (++) from command line, (!!) notice, (II) informational,
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 34613.147] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Jul 31 11:27:12 2018
[ 34613.148] (==) Using config file: "/etc/X11/xorg.conf"
[ 34613.149] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 34613.150] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 34613.150] (==) ServerLayout "Layout0"
[ 34613.150] (**) |-->Screen "Screen0" (0)
[ 34613.150] (**) |   |-->Monitor "Monitor0"
[ 34613.150] (**) |   |-->Device "Device0"
[ 34613.150] (**) |-->Input Device "Keyboard0"
[ 34613.150] (**) |-->Input Device "Mouse0"
[ 34613.150] (==) Automatically adding devices
[ 34613.150] (==) Automatically enabling devices
[ 34613.150] (==) Automatically adding GPU devices
[ 34613.150] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 34613.151] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
[ 34613.151]    Entry deleted from font path.
[ 34613.151] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
[ 34613.151]    Entry deleted from font path.
[ 34613.151] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[ 34613.151]    Entry deleted from font path.
[ 34613.151] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[ 34613.151]    Entry deleted from font path.
[ 34613.151]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
[ 34613.151] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[ 34613.151]    Entry deleted from font path.
[ 34613.151]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[ 34613.151] (==) FontPath set to:
   /usr/share/fonts/misc/
[ 34613.151] (**) ModulePath set to "/usr/lib64/opengl/nvidia,/usr/lib64/xorg/modules"
[ 34613.151] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 34613.151] (WW) Disabling Keyboard0
[ 34613.151] (WW) Disabling Mouse0
[ 34613.151] (II) Loader magic: 0x564b17ffcc40
[ 34613.151] (II) Module ABI versions:
[ 34613.151]    X.Org ANSI C Emulation: 0.4
[ 34613.151]    X.Org Video Driver: 23.0
[ 34613.151]    X.Org XInput driver : 24.1
[ 34613.151]    X.Org Server Extension : 10.0
[ 34613.151] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 34613.151] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 34613.167] (--) PCI:*(0:0:2:0) 8086:591b:17aa:39d1 rev 4, Mem @ 0xa2000000/16777216, 0xb0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/131072
[ 34613.167] (--) PCI: (0:1:0:0) 10de:1c8d:17aa:39d1 rev 161, Mem @ 0xa3000000/16777216, 0x90000000/268435456, 0xa0000000/33554432, I/O @ 0x00004000/128
[ 34613.167] (II) LoadModule: "glx"
[ 34613.167] (II) Loading /usr/lib64/opengl/nvidia/extensions/libglx.so
[ 34613.169] (II) Module glx: vendor="NVIDIA Corporation"
[ 34613.169]    compiled for 4.0.2, module version = 1.0.0
[ 34613.169]    Module class: X.Org Server Extension
[ 34613.169] (II) NVIDIA GLX Module  396.24  Wed Apr 25 23:17:01 PDT 2018
[ 34613.169] (II) LoadModule: "nvidia"
[ 34613.169] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
[ 34613.169] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 34613.169]    compiled for 4.0.2, module version = 1.0.0
[ 34613.169]    Module class: X.Org Video Driver
[ 34613.169] (II) NVIDIA dlloader X Driver  396.24  Wed Apr 25 22:53:34 PDT 2018
[ 34613.169] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 34613.169] (--) using VT number 7

[ 34613.186] (EE) No devices detected.
[ 34613.186] (EE)
Fatal server error:
[ 34613.186] (EE) no screens found(EE)
[ 34613.186] (EE)
Please consult the The X.Org Foundation support
    at http://wiki.x.org
 for help.
[ 34613.186] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 34613.186] (EE)
[ 34613.259] (EE) Server terminated with error (1). Closing log file.


The second variant is to start x without any xorg.conf. After this X starts and I see 3 Terminals in a realy bad solution. But keyboad, mouse and synaptics are working.

The third try is to follow the wiki/optimus and use this xorg.conf
Code:
Section "ServerLayout"
  Identifier "layout"
  Screen 0 "nvidia"
  Inactive "intel"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BUSID "01:00:0"
  Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection

Section "Screen"
  Identifier "nvidia"
  Device "nvidia"
  Option "AllowEmptyInitialConfiguration"
EndSection

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

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


After this X seems to start but the screen goes black. Even the screenbacklight stops so the display seems to shut down.

I hope someone here can help me to handle this. I realy tried a lot and still don't want to give up. A half year ago Linux Mint was installed on this Notebook. The optimus there seems to work even without me knowing it is a notebook like this.

I will add some informations about my system, maybe these can help finding a solution

lsmod
Code:
Module                  Size  Used by
bbswitch               16384  0
nvidia_drm             40960  0
nvidia_modeset       1056768  1 nvidia_drm
nvidia              13533184  1 nvidia_modeset
iwlmvm                311296  0
x86_pkg_temp_thermal    16384  0
iwlwifi               270336  1 iwlmvm


lspci -k
Code:
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 05)
   Subsystem: Lenovo Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 05)
   Kernel driver in use: pcieport
00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
   Subsystem: Lenovo Device 39d1
   Kernel driver in use: i915
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
   Subsystem: Lenovo Sunrise Point-H USB 3.0 xHCI Controller
   Kernel driver in use: xhci_hcd
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
   Subsystem: Lenovo Sunrise Point-H Thermal subsystem
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
   Subsystem: Lenovo Sunrise Point-H CSME HECI
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)
   Subsystem: Lenovo Sunrise Point-H SATA Controller [AHCI mode]
   Kernel driver in use: ahci
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #2 (rev f1)
   Kernel driver in use: pcieport
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3 (rev f1)
   Kernel driver in use: pcieport
00:1c.3 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #4 (rev f1)
   Kernel driver in use: pcieport
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
   Subsystem: Lenovo Sunrise Point-H LPC Controller
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
   Subsystem: Lenovo Sunrise Point-H PMC
00:1f.3 Audio device: Intel Corporation CM238 HD Audio Controller (rev 31)
   Subsystem: Lenovo CM238 HD Audio Controller
   Kernel driver in use: snd_hda_intel
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
   Subsystem: Lenovo Sunrise Point-H SMBus
   Kernel driver in use: i801_smbus
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev a1)
   Subsystem: Lenovo GP107M [GeForce GTX 1050 Mobile]
   Kernel driver in use: nvidia
   Kernel modules: nvidia_drm, nvidia
02:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)
   Subsystem: Lenovo SD/MMC Card Reader Controller
03:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth (rev 99)
   Subsystem: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth
   Kernel driver in use: iwlwifi
   Kernel modules: iwlwifi
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)
   Subsystem: Lenovo RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
   Kernel driver in use: r8169


make.conf
Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"

USE="nvidia kde -radeon -gnome"

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C

GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"

MAKEOPTS="-j5"

VIDEO_CARDS="nvidia"

INPUT_DEVICES="evdev libinput mouse keyboard synaptics"


eselect opengl
Code:
Available OpenGL implementations:
  [1]   nvidia *
  [2]   xorg-x11


dmesg nvidia
Code:
[   15.274354] nvidia: loading out-of-tree module taints kernel.
[   15.274371] nvidia: module license 'NVIDIA' taints kernel.
[   15.289836] nvidia-nvlink: Nvlink Core is being initialized, major device number 247
[   15.289974] nvidia 0000:01:00.0: enabling device (0106 -> 0107)
[   15.407223] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  396.24  Wed Apr 25 23:54:18 PDT 2018
[   15.431770] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[   15.431774] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
[   16.025880] nvidia-smi (3811) used greatest stack depth: 12360 bytes left


Greetings
Preis


Last edited by DerPreis on Wed Aug 08, 2018 9:20 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: Tue Jul 31, 2018 5:24 pm    Post subject: Reply with quote

Use the last xorg.conf
and use a ~/.xinitrc like
Code:
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xterm &
exec xterm

the two xrandr commands are necessary to enable PRIME output.

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
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 185

PostPosted: Tue Jul 31, 2018 5:28 pm    Post subject: Reply with quote

...and better use
Code:
    BusID          "PCI:1:0:0"

and remove
Code:
  Option "RegistryDwords" "EnableBrightnessControl=1"

since the screen brightness is handled by the intel gpu on Optimus notebooks.
Back to top
View user's profile Send private message
DerPreis
n00b
n00b


Joined: 30 Jul 2018
Posts: 16

PostPosted: Tue Jul 31, 2018 7:00 pm    Post subject: Reply with quote

Hi hhfeuer,

thank for your reply.

I changed your xinitrc a bit for kde to
Code:
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
startkde


Since this the DE is starting.

Thank you very much!
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