Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Lenovo Legion Y520 w nVidia&Intel GPU->black screen
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Waterdevil
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2017
Posts: 126
Location: LaniakeaHypercluster VirgoSupercluster MilkomedaGroup OrionArm Sector001 GouldBelt SolSystem Austria

PostPosted: Fri Oct 20, 2017 1:14 pm    Post subject: [Solved] Lenovo Legion Y520 w nVidia&Intel GPU->black Reply with quote

Hello World,

if I try to activate nVidia for accelerated OpenGL / OpenCL I get a black screen, but nVidia is active. There is no error, but a warning and I don't know if xrandr has been executed.

I have lightdm with gnome or xfce.

Setup with Intel GPU only is working. I didn't try nouveau.

I've also tried bumblebee and optimus, but no success.
I tried daily many hours for a month with heavy searching in google
My hardware:

Code:
lspci -k
00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
   Subsystem: Lenovo Device 39d1
   Kernel driver in use: i915
   Kernel modules: i915
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: nouveau, nvidia_drm, nvidia


Code:
more /etc/modprobe.d/blacklist.conf
blacklist nouveau
   options nouveau modeset=0


Code:
eix
[I] x11-base/xorg-server
     Installierte Versionen: 1.19.5(14:22:30 19.10.2017)(glamor ipv6 suid udev xorg -debug -dmx -doc -kdrive -libressl -minimal -selinux -static-libs -systemd -tslib -unwind -wayland -xcsecurity -xephyr -xnest -xvfb)

[I] x11-base/xorg-drivers
     Installierte Versionen: 1.19(00:38:04 11.10.2017)(INPUT_DEVICES="libinput synaptics -acecad -aiptek -elographics -evdev -fpit -hyperpen -joystick -keyboard -mouse -mutouch -penmount -tslib -vmmouse -void -wacom" VIDEO_CARDS="i965 intel nouveau nvidia vesa -amdgpu -apm -ark -ast -chips -cirrus -dummy -epson -fbdev -fglrx -freedreno -geode -glint -i128 -i740 -i915 -mach64 -mga -neomagic -newport -nv -omap -qxl -r128 -radeon -radeonsi -rendition -s3 -s3virge -savage -siliconmotion -sis -sisusb -sunbw2 -suncg14 -suncg3 -suncg6 -sunffb -sunleo -suntcx -tdfx -tegra -tga -trident -tseng -vc4 -via -virtualbox -vmware -voodoo")

[I] x11-drivers/nvidia-drivers
     Installierte Versionen: 384.90^md(14:24:25 19.10.2017)(X acpi compat driver gtk3 multilib static-libs tools uvm -kms -pax_kernel -wayland ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32" KERNEL="linux -FreeBSD")


Code:
more /home/andreas/.xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

# Ensure dbus is either already running, or safely start it
if [[ -z "${DBUS_SESSION_BUS_ADDRESS}" ]];
then
    eval $(dbus-launch --sh-syntax --exit-with-session)
fi

# Make the keyring daemon ready to communicate with nm-applet
export $(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg)

export XDG_MENU_PREFIX=gnome-
nm-applet &


xorg.conf.d/10-hybrid.conf: https://gist.github.com/anonymous/c4f57fd8800b544609efff5b607d7d99

Code:
uname -a
Linux allengen 4.12.12-gentoo #19 SMP Wed Oct 18 15:48:15 CEST 2017 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux


Code:
lsmod |grep -E "nvidia|i9|nouveau"
i915                 1396736  19
nvidia_drm             40960  0
nvidia_modeset        815104  1 nvidia_drm
i2c_algo_bit           16384  1 i915
drm_kms_helper        118784  2 i915,nvidia_drm
drm                   290816  6 i915,nvidia_drm,drm_kms_helper
intel_gtt              20480  1 i915
nvidia              12505088  1 nvidia_modeset
button                 16384  1 i915
video                  36864  1 i915


Code:
more /etc/lightdm/lightdm.conf
[LightDM]
display-setup-script=/etc/lightdm/display_setup.sh
.
.
.


Code:
more /etc/lightdm/display_setup.sh
#!/bin/bash
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto


I suppose, that my xorg.conf is wrong or has something missing. I tried with two screens. Is it the same technology like older hybrid notebooks with two gpu's?

I hope you are smarter than me...

best regards
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,X11DPG-QT,MEM:64G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChannel,Tandberg LTO-6


Last edited by Waterdevil on Sat Oct 21, 2017 9:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 156

PostPosted: Fri Oct 20, 2017 3:03 pm    Post subject: Reply with quote

Your hybrid.conf is a bit crowded, see this for a clean xorg.conf:
https://forums.gentoo.org/viewtopic-p-8131222.html#8131222
Use that.
Otherwise, the steps you took look correct, please post your Xorg.0.log.
Back to top
View user's profile Send private message
Waterdevil
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2017
Posts: 126
Location: LaniakeaHypercluster VirgoSupercluster MilkomedaGroup OrionArm Sector001 GouldBelt SolSystem Austria

PostPosted: Sat Oct 21, 2017 8:54 am    Post subject: Reply with quote

Oh, sorry, I have forgotten to attach Xorg.0.log, dmesg, messages and a few more.

Here they are: https://gist.github.com/anonymous/3d505eac5f4b379e413a941c2f1d015a

I've found a suspect message:
messages:Oct 21 09:08:33 allengen kernel: [ 0.662824] pci 0000:01:00.0: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
Xorg.0.log:[ 27.759] (WW) NVIDIA(0): Unable to get display device for DPI computation.

Is my notebook constructed, to use the intel GPU for output and nvidia GPU has only a bridge and no direct output as I think?

How can I check, that xrandr is executed? I can't see a confirming message in all logfiles.
I think this is a potential candidate, because all my searches in google say, that without xrandr, one has a black screen.
There are two messages in rc.log "Can't open display" which I mean, that is from the two xrandr commands in .xinitrc

The changes of xorg.conf had no success.
Only two additional warnings
[ 28.008] (WW) modeset(G0): Option "enable" is not used
[ 28.377] (WW) NVIDIA(0): Option "enable" is not used


Best regards
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,X11DPG-QT,MEM:64G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChannel,Tandberg LTO-6
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 156

PostPosted: Sat Oct 21, 2017 10:29 am    Post subject: Reply with quote

The Xorg.0.log looks fine.

>Xorg.0.log:[ 27.759] (WW) NVIDIA(0): Unable to get display device for DPI computation.
This is normal and expected, since the nvidia gpu doesn't have a real monitor.

>Is my notebook constructed, to use the intel GPU for output and nvidia GPU has only a bridge and no direct output as I think?
Correct.
>How can I check, that xrandr is executed? I can't see a confirming message in all logfiles.
This is the problem right now. the script doesn't get executed. Yo can add
Code:
logger Starting xrandr offload

to your display-setup script to generate a syslog entry

[ 28.008] (WW) modeset(G0): Option "enable" is not used
[ 28.377] (WW) NVIDIA(0): Option "enable" is not used
You can remove
Code:
         Option         "enable" "true"

from the monitor section, it's a leftover from an older config of mine.

So you can now leave the xserver as it is and concentrate on lightdm.
Check if your display-setup script is executable for the lighdm user.
I'm not familiar with lightdm but according to this
https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Display_Managers
the lightdm.conf should be
Code:
[Seat:*]
display-setup-script=/etc/lightdm/display_setup.sh

Mind the [Seat*]
Back to top
View user's profile Send private message
Waterdevil
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2017
Posts: 126
Location: LaniakeaHypercluster VirgoSupercluster MilkomedaGroup OrionArm Sector001 GouldBelt SolSystem Austria

PostPosted: Sat Oct 21, 2017 11:11 am    Post subject: Reply with quote

I tried: xorg.conf with two Screen lines:
Code:
Section "ServerLayout"
    Identifier     "layout"
    Screen       0 "intel"
    Screen       1 "nvidia" 0 0
    Inactive       "intel"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
    Monitor        "eDP-1"
    DefaultDepth    24
    Option         "UseDisplayDevice" "intel"
    SubSection     "Display"
        Depth       24
        Virtual     1920 1080
    EndSubSection
EndSection


The parameter Option "UseDisplayDevice" "intel" I only guessed. I don't know if this make sense.

and I get login screen. both GPU's are active. After login GDM isn't working (there is a problem... System can't solve... please login again - translated from german),
but xfce is working.

In console glxinfo brings an error:
Code:
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig
Segmentation fault (translated Speicherzugriffsfehler)


Code:
glxgears -info
Error: couldn't get an RGB, Double-buffered visual


New Xorg.0.log: https://gist.github.com/anonymous/458bafdc763b64aa2f1b5b9d28fbddda
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,X11DPG-QT,MEM:64G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChannel,Tandberg LTO-6
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 156

PostPosted: Sat Oct 21, 2017 11:19 am    Post subject: Reply with quote

You should leave the xorg.conf alone. It was working before. Now you've opened a second screen on the intel with nvidia glx, doesn't work. Revert to the previous version and solve the problem with lightdm.
Back to top
View user's profile Send private message
Waterdevil
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2017
Posts: 126
Location: LaniakeaHypercluster VirgoSupercluster MilkomedaGroup OrionArm Sector001 GouldBelt SolSystem Austria

PostPosted: Sat Oct 21, 2017 11:32 am    Post subject: Reply with quote

Sorry :D :oops: Just playing around...
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,X11DPG-QT,MEM:64G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChannel,Tandberg LTO-6
Back to top
View user's profile Send private message
Waterdevil
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2017
Posts: 126
Location: LaniakeaHypercluster VirgoSupercluster MilkomedaGroup OrionArm Sector001 GouldBelt SolSystem Austria

PostPosted: Sat Oct 21, 2017 11:55 am    Post subject: Reply with quote

Wow, you got me to the right place.

I was wrong in lightdm.conf, so display_setup.sh was never executed.

Now it is corrected and xfce is working with nvidia opengl acceleration.

But now I want gnome to work.


Many thanks for your help. Maybe I need further assistance with gdm...


Best regards
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,X11DPG-QT,MEM:64G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChannel,Tandberg LTO-6
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 156

PostPosted: Sat Oct 21, 2017 12:41 pm    Post subject: Reply with quote

The general tip to make gdm/gnome on an Optimus system work is to emerge with USE="-wayland"
Then just like in the archlinux link:
Quote:

For the GDM display manager create two new .desktop files:

/usr/share/gdm/greeter/autostart/optimus.desktop
/etc/xdg/autostart/optimus.desktop

Code:
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer
Back to top
View user's profile Send private message
hhfeuer
Apprentice
Apprentice


Joined: 28 Jul 2005
Posts: 156

PostPosted: Sat Oct 21, 2017 12:42 pm    Post subject: Reply with quote

Forgot, you can enable PRIME sync with kernel parameter
Code:
nvidia-drm.modeset=1

to get rid of tearing.
Back to top
View user's profile Send private message
Waterdevil
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2017
Posts: 126
Location: LaniakeaHypercluster VirgoSupercluster MilkomedaGroup OrionArm Sector001 GouldBelt SolSystem Austria

PostPosted: Sat Oct 21, 2017 9:54 pm    Post subject: Reply with quote

Hi, gnome is working too. I installed Bioshock Infinite and performance is good.

Now I maybe want to manage the power consumption with optimus or bumblebee, when the nvidia GPU isn't used.

Many thanks - I should have ask two months ago...

Best regards
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,X11DPG-QT,MEM:64G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChannel,Tandberg LTO-6
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