# [SOLVED] [Nvidia Optimus] black screen after world update

## Jimini

Hey there,

yesterday, I installed a world update on my system. Since the next reboot, starting kdm leads to a black screen.

These are the updated packages:

 *Quote:*   

> =virtual/perl-Time-Local-1.230.0-r2
> 
> =dev-util/cmake-3.2.2
> 
> =kde-base/kdelibs-4.14.8
> ...

 

Nothing xserver or xdm related, I suppose.

I use a Lenovo Z50-70 with Nvidia Optimus, gentoo-sources-4.0.0 and nvidia-drivers-349.16. Before the update, everything worked fine.

xorg.conf:

```
Section "ServerLayout"

    Identifier "layout"

    Screen 0 "nvidia"

    Inactive "intel"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "3:00:0"

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    Option "AllowEmptyInitialConfiguration"

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    BusID "0:02:0"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection
```

Xorg.0.log

Graphic adapters:

 *Quote:*   

> 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
> 
> 03:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (rev a1)

 

When I start xdm, my syslog logs the following lines:

 *Quote:*   

> Jun 14 07:57:46 Phobos kernel: vgaarb: this pci device is not a vga device
> 
> Jun 14 07:57:46 Phobos kernel: ACPI Warning: \x5c_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150204/nsarguments-95)
> 
> Jun 14 07:57:46 Phobos kernel: ACPI Warning: \x5c_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150204/nsarguments-95)
> ...

 

But they already appeared during the last months, when everything worked.

At the moment, I have no idea where to look for the cause for this misbehavior.

Any help would be really appreciated.

Best regards,

Jimini

----------

## Keruskerfuerst

What says lsmod?

----------

## Jimini

```
Module                  Size  Used by

nvidia               8387447  -2 

snd_hda_codec_hdmi     36512  -2 

snd_hda_codec_conexant     9063  -2 

rtl8723be              77420  -2 

snd_hda_codec_generic    51038  -2 

btcoexist              38341  -2 

rtl_pci                18020  -2 

rtlwifi                52773  -2 

snd_hda_intel          20253  -2 

rtl8723_common          9275  -2 

snd_hda_controller     19865  -2 

snd_hda_codec          92499  -2 

snd_hwdep               5675  -2
```

Best regards,

Jimini

----------

## Keruskerfuerst

Anything in the logs in /var/log/* ?

----------

## Jimini

Only the following lines appear, when I execute startx oder start xdm.

 *Quote:*   

> Jun 21 12:12:31 Phobos kernel: vgaarb: this pci device is not a vga device
> 
> Jun 21 12:12:31 Phobos kernel: ACPI Warning: \x5c_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150204/nsarguments-95)
> 
> Jun 21 12:12:31 Phobos kernel: ACPI Warning: \x5c_SB_.PCI0.RP05.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150204/nsarguments-95)
> ...

 

But they were already logged, when the system was operating normally.

Best regards,

Jimini

----------

## caaarlos

What does 

```
lspci -k
```

 say about your VGA?

----------

## Jimini

```
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)

        Subsystem: Lenovo Device 380d

        Kernel driver in use: i915

03:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (rev a1)

        Subsystem: Lenovo GeForce 820M

        Kernel driver in use: nvidia

        Kernel modules: nvidia
```

Addendum: I forgot to mention, that executing xrandr leads to the error "Can't open display". Perhaps this leads to the cause for the misbehaviour?

Best regards,

Jimini

----------

## caaarlos

Do you tried nvidia-xconfig? Dont forget to backuo your actual xorg.conf first.

----------

## Jimini

Yeah, I tried my former xorg.conf and a new one, which I created with nvidia-xconfig:

```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig

# nvidia-xconfig:  version 349.16  (buildmeister@swio-display-x86-rhel47-06)  Wed Apr  8 00:52:19 PDT 2015

Section "ServerLayout"

    Identifier     "layout"

    Screen      0  "nvidia" 0 0

    Inactive       "intel"

    InputDevice    "Keyboard0" "CoreKeyboard"

    InputDevice    "Mouse0" "CorePointer"

EndSection

Section "InputDevice"

    # generated from default

    Identifier     "Keyboard0"

    Driver         "keyboard"

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 "Monitor"

    Identifier     "Monitor0"

    VendorName     "Unknown"

    ModelName      "Unknown"

    HorizSync       28.0 - 33.0

    VertRefresh     43.0 - 72.0

    Option         "DPMS"

EndSection

Section "Device"

    Identifier     "nvidia"

    Driver         "nvidia"

    BusID          "3:00:0"

EndSection

Section "Device"

    Identifier     "intel"

    Driver         "modesetting"

    BusID          "0:02:0"

EndSection

Section "Screen"

    Identifier     "nvidia"

    Device         "nvidia"

    Monitor        "Monitor0"

    DefaultDepth    24

    Option         "AllowEmptyInitialConfiguration"

    SubSection     "Display"

        Depth       24

        Modes      "nvidia-auto-select"

    EndSubSection

EndSection

Section "Screen"

    Identifier     "intel"

    Device         "intel"

    Monitor        "Monitor0"

EndSection
```

The problem persists.

Best regards,

Jimini

----------

## caaarlos

So I think the problem is your kdm configuration. Did you configure it? Take a look on this tutorial https://wiki.archlinux.org/index.php/NVIDIA_Optimus#KDM. I'm using lighdm, but for kdm is the same...

----------

## Jimini

Oh my, now it works. I added the following lines to /usr/share/config/kdm/Xsetup:

 *Quote:*   

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

 

Afterwards, kdm started up, but the screen resolution was limited to 640x480. So I took my old xorg.conf and everything works again.

Many thanks to all of you for your help!

Best regards,

Jimini

----------

## caaarlos

Good!! You can use these 

```
if (xrandr | grep "HDMI-1-0 disconnected"); then

        xrandr --output HDMI-1-0 --off --output eDP-1-0 --auto

else

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

fi

```

. Instead of xrandr --auto. On my system xrandr --auto not gives the right config. So if I use this script I dont have to modify my screens resolution every time I turn on my notebook.

Dont forget to change eDP-1-0 and HDMI-1-0 to yours... just execute xrandr and you will see the names.

----------

