# [SOLVED] Black screen, nvidia optimus, nvidia-drivers-361.28

## xerofzos

Hello.

I tried a lot of things to fix problem with black screen, but had no luck.. I need help with this problem.

Hardware - msi gs70 6qe, skylake i7-6700HQ, nvidia gtx 970m.

Everything (almost) was perfect before upgrade to xorg-server-1.18.0 (and then 1.18.1) and nvidia-drivers-361.18 (and then 361.28 ).

I used info from https://wiki.archlinux.org/index.php/NVIDIA_Optimus and https://wiki.gentoo.org/wiki/NVIDIA/Optimus

to configure my system. (And tried a lot of configs from various forum posts)

After this upgrade, I get black screen when on system configured for nvidia-drivers I launch X, be it session based on simple xinit with some xrandr calls and twm, or gdm.

System configured for intel video works perfectly.

Info about problem:

Xorg.0.log

dmesg

glxinfo

xrandr

xrandr --listproviders

xorg.conf  (I've tried "AccelMethod" "none" in intel device section, it does not fix bug.)

.xinit

kernel config

Interesting parts in Xorg.0.log:

```

[   107.085] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support

[   108.150] (WW) NVIDIA(0): Unable to get display device for DPI computation.

[   108.688] (WW) modeset(G0): Option "AllowEmptyInitialConfiguration" is not used

[   108.997] (WW) Warning, couldn't open module x11glvnd

[   109.081] (EE) Error systemd-logind returned paused fd for drm node

[   109.111] (EE) Error systemd-logind returned paused fd for drm node

[   110.001] (EE) modeset(G0): failed to set mode: No space left on device

```

These logs from test run with disabled VGA arbiter in kernel, but only difference in logs with enabled VGA arbiter - absence of line "(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support" in Xorg.0.log

Interesting part in dmesg:

```

[  108.173256] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  361.28  Wed Feb  3 15:15:17 PST 2016

[  108.173566] nvidia-modeset: Allocated GPU:0 (GPU-f379ab95-caa5-2cb1-4e44-6177c58e5351) @ PCI:0000:01:00.0

[  108.173644] nvidia-modeset: Freed GPU:0 (GPU-f379ab95-caa5-2cb1-4e44-6177c58e5351) @ PCI:0000:01:00.0

```

I will appreciate your help.

Thanks.

UPDATE:

Solved after update to latest xorg-server and nvidia-driversLast edited by xerofzos on Sat Apr 23, 2016 5:29 pm; edited 4 times in total

----------

## Keruskerfuerst

1. Can you locate the module x11glvnd ?

2. 109.081] (EE) Error systemd-logind returned paused fd for drm node ?

3. [   110.001] (EE) modeset(G0): failed to set mode: No space left on device ?

----------

## xerofzos

 *Keruskerfuerst wrote:*   

> 1. Can you locate the module x11glvnd ?
> 
> 2. 109.081] (EE) Error systemd-logind returned paused fd for drm node ?
> 
> 3. [   110.001] (EE) modeset(G0): failed to set mode: No space left on device ?

 

1. I was not able to find it on my system

2. I do not understand this question.

3. I do not understand this question, but additional info - I have a lot of free space on every mounted filesystem.

----------

## Atmmac

I just had the same problem this morning. I am going to have to check out the driver release notes and see what the deal is. You will need to downgrade your x11-driver packages to get back on your feet until we figure this out.

do this

add this to your /etc/portage/package.mask

#nvidiasucks

>=x11-base/xorg-drivers-1.18-r1

>=x11-base/xorg-server-1.18.0

>=x11-drivers/xf86-input-evdev-2.10.0

>=x11-drivers/nvidia-drivers-358.16-r4

>=x11-drivers/xf86-video-intel-2.99.917_p20160203

>=x11-drivers/xf86-input-mouse-1.9.1

>x11-drivers/xf86-input-synaptics-1.8.3

do this

emerge xf86-input-evdev

then do this

emerge xorg-drivers xorg-server nvidia-drivers xf86-video-intel xf86-input-mouse xf86-input-synaptics

Then reboot and your system will come back up. Hopefully we can figure out what changed to resolve this so we can unmask the packages ASAP going forward. Good luck.

----------

## xerofzos

 *Atmmac wrote:*   

> You will need to downgrade your x11-driver packages to get back on your feet until we figure this out.
> 
> Then reboot and your system will come back up. Hopefully we can figure out what changed to resolve this so we can unmask the packages ASAP going forward. Good luck.

 

Thanks, I've tried downgrading, but masked only some of packages you listed .. had some problems with xorg drivers at startup and reverted downgrade.

And than.. accidentally killed my encrypted gentoo root by trying to instruct ubuntu installer to decrypt and automount my encrypted gentoo root to some folder at startup..

I will update this comment as soon as I'll try gentoo system with these package masks.

----------

## mikfire

I am having similar issues. A few things I will mention.

First, so far I've only needed to mask this

```

>=x11-base/xorg-server-1.18.0

>=x11-base/xorg-drivers-1.18-r1

```

and a simple emerge -av -uDN @world cleans things up. Your mileage may vary.

As far as I can tell, there is no libglvnd available on gentoo. It's basic purpose is to allow applications to request specific GL vendor engines. I haven't had the patience to download the source from github, build and see if it fixes the issue. I don't think it will, because those same messages are in the Xorg.0.log file even after I downgraded. 

I am also finding this https://bbs.archlinux.org/viewtopic.php?id=193685 which suggests setting "AccelMethod" "None" in the intel device section. I will try that later and report back if it works.

Mik

----------

## xerofzos

I've tried "AccelMethod" "none" in intel device section, it does not fix bug.

----------

## Atmmac

 *xerofzos wrote:*   

> I've tried "AccelMethod" "none" in intel device section, it does not fix bug.

 

I already had this in my config from before the issue and its a no go. I am looking at some other stuff and will update if I find anything.

----------

## Atmmac

Looks like this is fixed in a future version of xorg. we will have to wait for it to get pushed out to portage.

https://bugs.archlinux.org/task/47151

----------

## mikfire

Try this.

1. Make a backup copy of /etc/X11/xorg.conf

2. replace the contents of /etc/X11/xorg.conf with this

```

Section "Module"

        Load    "modesetting"

EndSection

Section "Device"

   Identifier "nvidia"

   Driver "nvidia"

   BusID   "PCI:1:0:0"

   Option "DPI" "96 x 96"

   Option "AllowEmptyInitialConfig"

   Option "Coolbits" "31"

   Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x1; PowerMizerDefaultAC=0x1"

   Option "nvidiaXineramaInfoOverride" "1920x1080+0+0, 1920x1080+1600+0, 1920x1080+0+1080, 1920x1080+1920+1080"

EndSection

```

Change the nvidiaXineramaInfoOverride to match the resolution of your monitor(s). So far, my environment seems to be working. I need to try a few more apps to make it's all good, but this is the closest I've gotten yet.

I think I will be really brave and try upgrading nvidia-drivers too.

----------

## Atmmac

I'm going to hold out until the new xorg release. This seems like a workaround that will be temporary and more trouble than its worth.

----------

## Xywa

 *Atmmac wrote:*   

> I'm going to hold out until the new xorg release. This seems like a workaround that will be temporary and more trouble than its worth.

 

Do we need to ask for bump relase for xorg-server 1.18.1-3 for Gentoo or this is just arch version (which works and solve the problem)?

 *Quote:*   

> I will push a new release in testing with this patch applied, please test (xorg-server-1.18.1-3)

 

 *Quote:*   

> Initial indications are that xorg-server-1.18.1-3 appears to work for me, thanks!

 

 *Quote:*   

> This patch isn't included in xorg-server-1.18.1

 

https://bugs.archlinux.org/task/47151

----------

## Xywa

I was trying downgrade xorg-server but I ha this message:

```
>>> Installing (2 of 5) x11-base/xorg-server-1.17.4::gentoo

 * This package will overwrite one or more files that may belong to other

 * packages (see list below). You can use a command such as `portageq

 * owners / <filename>` to identify the installed package that owns a

 * file. If portageq reports that only one package owns a file then do

 * NOT file a bug report. A bug report is only useful if it identifies at

 * least two or more packages that are known to install the same file(s).

 * If a collision occurs and you can not explain where the file came from

 * then you should simply ignore the collision since there is not enough

 * information to determine if a real problem exists. Please do NOT file

 * a bug report at http://bugs.gentoo.org unless you report exactly which

 * two packages install the same file(s). See

 * http://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how to

 * solve the problem. And once again, please do NOT file a bug report

 * unless you have completely understood the above message.

 * 

 * Detected file collision(s):

 * 

 *      /usr/share/X11/xorg.conf.d/10-evdev.conf

 * 

 * Searching all installed packages for file collisions...

 * 

 * Press Ctrl-C to Stop

 * 

 * x11-drivers/xf86-input-evdev-2.10.1:0::gentoo

 *      /usr/share/X11/xorg.conf.d/10-evdev.conf

 * 

 * Package 'x11-base/xorg-server-1.17.4' NOT merged due to file

 * collisions. If necessary, refer to your elog messages for the whole

 * content of the above message.
```

----------

## mir3x

I had the same problem earlier:

[   108.150] (II) NVIDIA(0): Validated MetaModes:

[   108.150] (II) NVIDIA(0):     "NULL"

So u must define valide metamode for nvidia:

Tune it to fit your configuration and it should work:

Section "Device"

    Identifier     "Device0"

    Driver         "nvidia"

    Option         "MetaModes"          "1920x1080"

    Option         "ConnectedMonitor"   "DFP-1"

    Option         "ModeDebug" "true"

    VendorName     "NVIDIA Corporation"

EndSection

----------

## Xywa

I was trying your xorg.conf - did not work

```
Section "Module" 

        Load    "modesetting" 

EndSection 

Section "Device" 

   Identifier "nvidia" 

   Driver "nvidia" 

   BusID   "PCI:1:0:0" 

   Option "DPI" "96 x 96" 

   Option "AllowEmptyInitialConfig" 

   Option "Coolbits" "31" 

   Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x1; PowerMizerDefaultAC=0x1" 

   Option "nvidiaXineramaInfoOverride" "1600x800+0+0, 1600x800+1600+0, 1600x800+0+800, 1600x800+1600+800" 

EndSection

```

Here is my old one used to work - any suggestions?

```
Section "ServerLayout"

    Identifier "layout"

    Screen 1 "nvidia"

    Inactive "intel"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "PCI:1:0:0"

    # e.g. BusID "PCI:1:0:0"

    Option "ConnectedMonitor" "CRT-0"

    Option "CustomEDID" "CRT-0:/lib/firmware/edid/1920x1080_Clevo_W670SR.bin"

    Option "UseEDID" "True"

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    Option "AllowEmptyInitialConfiguration"

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    Option "CustomEDID" "CRT-0:/lib/firmware/edid/1920x1080_Clevo_W670SR.bin"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection
```

My logs, looks like is OK, but black screen:

```
[  2293.233] 

X.Org X Server 1.18.1

Release Date: 2016-02-08

[  2293.239] X Protocol Version 11, Revision 0

[  2293.241] Build Operating System: Linux 4.4.1-gentoo x86_64 Gentoo

[  2293.242] Current Operating System: Linux tux 4.4.1-gentoo #2 SMP Tue Feb 2 20:50:32 GMT 2016 x86_64

[  2293.242] Kernel command line: root=/dev/sda2 vga=792

[  2293.244] Build Date: 11 February 2016  08:43:39AM

[  2293.245]  

[  2293.247] Current version of pixman: 0.34.0

[  2293.248]    Before reporting problems, check http://wiki.x.org

   to make sure that you have the latest version.

[  2293.248] Markers: (--) probed, (**) from config file, (==) default setting,

   (++) from command line, (!!) notice, (II) informational,

   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

[  2293.253] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Feb 16 16:40:35 2016

[  2293.254] (==) Using config file: "/etc/X11/xorg.conf"

[  2293.255] (==) Using config directory: "/etc/X11/xorg.conf.d"

[  2293.256] (==) Using system config directory "/usr/share/X11/xorg.conf.d"

[  2293.256] (==) ServerLayout "layout"

[  2293.256] (**) |-->Screen "nvidia" (1)

[  2293.256] (**) |   |-->Monitor "<default monitor>"

[  2293.256] (**) |   |-->Device "nvidia"

[  2293.256] (==) No monitor specified for screen "nvidia".

   Using a default monitor configuration.

[  2293.256] (**) |-->Inactive Device "intel"

[  2293.256] (==) Automatically adding devices

[  2293.256] (==) Automatically enabling devices

[  2293.256] (==) Automatically adding GPU devices

[  2293.256] (==) Max clients allowed: 256, resource mask: 0x1fffff

[  2293.256] (WW) The directory "/usr/share/fonts/TTF/" does not exist.

[  2293.256]    Entry deleted from font path.

[  2293.256] (WW) The directory "/usr/share/fonts/OTF/" does not exist.

[  2293.256]    Entry deleted from font path.

[  2293.256] (WW) The directory "/usr/share/fonts/Type1/" does not exist.

[  2293.256]    Entry deleted from font path.

[  2293.256] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".

[  2293.256]    Entry deleted from font path.

[  2293.256]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").

[  2293.256] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".

[  2293.256]    Entry deleted from font path.

[  2293.256]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").

[  2293.256] (==) FontPath set to:

   /usr/share/fonts/misc/

[  2293.256] (**) ModulePath set to "/usr/lib64/opengl/nvidia,/usr/lib64/xorg/modules"

[  2293.256] (II) The server relies on udev to provide the list of input devices.

   If no devices become available, reconfigure udev or disable AutoAddDevices.

[  2293.256] (II) Loader magic: 0x812c60

[  2293.256] (II) Module ABI versions:

[  2293.256]    X.Org ANSI C Emulation: 0.4

[  2293.256]    X.Org Video Driver: 20.0

[  2293.256]    X.Org XInput driver : 22.1

[  2293.256]    X.Org Server Extension : 9.0

[  2293.256] (II) xfree86: Adding drm device (/dev/dri/card1)

[  2293.256] (II) xfree86: Adding drm device (/dev/dri/card0)

[  2293.257] (--) PCI:*(0:0:2:0) 8086:0126:1558:2703 rev 9, Mem @ 0xf7400000/4194304, 0xd0000000/268435456, I/O @ 0x0000f000/64

[  2293.258] (--) PCI: (0:1:0:0) 10de:0de9:1558:2703 rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/524288

[  2293.258] (II) LoadModule: "glx"

[  2293.258] (II) Loading /usr/lib64/opengl/nvidia/extensions/libglx.so

[  2293.261] (II) Module glx: vendor="NVIDIA Corporation"

[  2293.261]    compiled for 4.0.2, module version = 1.0.0

[  2293.261]    Module class: X.Org Server Extension

[  2293.261] (II) NVIDIA GLX Module  361.28  Wed Feb  3 15:10:57 PST 2016

[  2293.261] (II) LoadModule: "nvidia"

[  2293.261] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so

[  2293.261] (II) Module nvidia: vendor="NVIDIA Corporation"

[  2293.261]    compiled for 4.0.2, module version = 1.0.0

[  2293.261]    Module class: X.Org Video Driver

[  2293.261] (II) LoadModule: "modesetting"

[  2293.261] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so

[  2293.261] (II) Module modesetting: vendor="X.Org Foundation"

[  2293.261]    compiled for 1.18.1, module version = 1.18.1

[  2293.261]    Module class: X.Org Video Driver

[  2293.261]    ABI class: X.Org Video Driver, version 20.0

[  2293.261] (II) NVIDIA dlloader X Driver  361.28  Wed Feb  3 14:48:10 PST 2016

[  2293.261] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs

[  2293.261] (II) modesetting: Driver for Modesetting Kernel Drivers: kms

[  2293.261] (--) using VT number 7

[  2293.264] (II) Loading sub module "fb"

[  2293.264] (II) LoadModule: "fb"

[  2293.264] (II) Loading /usr/lib64/xorg/modules/libfb.so

[  2293.265] (II) Module fb: vendor="X.Org Foundation"

[  2293.265]    compiled for 1.18.1, module version = 1.0.0

[  2293.265]    ABI class: X.Org ANSI C Emulation, version 0.4

[  2293.265] (II) Loading sub module "wfb"

[  2293.265] (II) LoadModule: "wfb"

[  2293.265] (II) Loading /usr/lib64/xorg/modules/libwfb.so

[  2293.265] (II) Module wfb: vendor="X.Org Foundation"

[  2293.265]    compiled for 1.18.1, module version = 1.0.0

[  2293.265]    ABI class: X.Org ANSI C Emulation, version 0.4

[  2293.265] (II) Loading sub module "ramdac"

[  2293.265] (II) LoadModule: "ramdac"

[  2293.265] (II) Module "ramdac" already built-in

[  2293.266] (II) modeset(G0): using drv /dev/dri/card0

[  2293.266] (II) NVIDIA(0): Creating default Display subsection in Screen section

   "nvidia" for depth/fbbpp 24/32

[  2293.266] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32

[  2293.266] (==) NVIDIA(0): RGB weight 888

[  2293.266] (==) NVIDIA(0): Default visual is TrueColor

[  2293.266] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)

[  2293.266] (**) NVIDIA(0): Option "AllowEmptyInitialConfiguration"

[  2293.266] (**) NVIDIA(0): Option "UseEDID" "True"

[  2293.266] (**) NVIDIA(0): Option "ConnectedMonitor" "CRT-0"

[  2293.266] (**) NVIDIA(0): Option "CustomEDID" "CRT-0:/lib/firmware/edid/1920x1080_Clevo_W670SR.bin"

[  2293.266] (**) NVIDIA(0): Enabling 2D acceleration

[  2293.266] (**) NVIDIA(0): ConnectedMonitor string: "CRT-0"

[  2293.285] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0

[  2293.285] (--) NVIDIA(0):     CRT-0 (boot)

[  2293.285] (**) NVIDIA(0): Using ConnectedMonitor string "CRT-0".

[  2293.285] (--) NVIDIA(0): Chi Mei Optoelectronics corp. (CRT-0): connected

[  2293.285] (--) NVIDIA(0): Chi Mei Optoelectronics corp. (CRT-0): 400.0 MHz maximum pixel clock

[  2293.285] (--) NVIDIA(0): 

[  2293.285] (II) NVIDIA(GPU-0): Found DRM driver nvidia-drm (20150116)

[  2293.286] (II) NVIDIA(0): NVIDIA GPU GeForce GT 630M (GF108) at PCI:1:0:0 (GPU-0)

[  2293.286] (--) NVIDIA(0): Memory: 1048576 kBytes

[  2293.286] (--) NVIDIA(0): VideoBIOS: 70.08.92.00.b5

[  2293.286] (II) NVIDIA(0): Detected PCI Express Link width: 16X

[  2293.286] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display

[  2293.286] (**) NVIDIA(0):     device Chi Mei Optoelectronics corp. (CRT-0) (Using EDID

[  2293.286] (**) NVIDIA(0):     frequencies has been enabled on all display devices.)

[  2293.286] (==) NVIDIA(0): 

[  2293.286] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"

[  2293.286] (==) NVIDIA(0):     will be used as the requested mode.

[  2293.286] (==) NVIDIA(0): 

[  2293.286] (II) NVIDIA(0): Validated MetaModes:

[  2293.287] (II) NVIDIA(0):     "CRT-0:nvidia-auto-select"

[  2293.287] (II) NVIDIA(0): Virtual screen size determined to be 1600 x 900

[  2293.289] (--) NVIDIA(0): DPI set to (104, 103); computed from "UseEdidDpi" X config

[  2293.289] (--) NVIDIA(0):     option

[  2293.289] (==) modeset(G0): Depth 24, (==) framebuffer bpp 32

[  2293.289] (==) modeset(G0): RGB weight 888

[  2293.289] (==) modeset(G0): Default visual is TrueColor

[  2293.289] (II) Loading sub module "glamoregl"

[  2293.289] (II) LoadModule: "glamoregl"

[  2293.289] (II) Loading /usr/lib64/xorg/modules/libglamoregl.so

[  2293.291] (II) Module glamoregl: vendor="X.Org Foundation"

[  2293.291]    compiled for 1.18.1, module version = 1.0.0

[  2293.291]    ABI class: X.Org ANSI C Emulation, version 0.4

[  2293.292] (II) glamor: OpenGL accelerated X.org driver based.

[  2293.298] (EE) modeset(G0): eglInitialize() failed

[  2293.299] (EE) modeset(G0): glamor initialization failed

[  2293.299] (II) modeset(G0): ShadowFB: preferred YES, enabled YES

[  2293.299] (II) modeset(G0): Output LVDS-1 has no monitor section

[  2293.300] (II) modeset(G0): Output VGA-1 has no monitor section

[  2293.388] (II) modeset(G0): Output HDMI-1 has no monitor section

[  2293.388] (II) modeset(G0): Output DP-1 has no monitor section

[  2293.388] (II) modeset(G0): EDID for output LVDS-1

[  2293.388] (II) modeset(G0): Manufacturer: CMO  Model: 1719  Serial#: 0

[  2293.388] (II) modeset(G0): Year: 2009  Week: 5

[  2293.388] (II) modeset(G0): EDID Version: 1.3

[  2293.388] (II) modeset(G0): Digital Display Input

[  2293.388] (II) modeset(G0): Max Image Size [cm]: horiz.: 39  vert.: 22

[  2293.388] (II) modeset(G0): Gamma: 2.20

[  2293.388] (II) modeset(G0): No DPMS capabilities specified

[  2293.388] (II) modeset(G0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4 

[  2293.388] (II) modeset(G0): First detailed timing is preferred mode

[  2293.388] (II) modeset(G0): redX: 0.613 redY: 0.344   greenX: 0.326 greenY: 0.590

[  2293.388] (II) modeset(G0): blueX: 0.160 blueY: 0.082   whiteX: 0.313 whiteY: 0.329

[  2293.388] (II) modeset(G0): Manufacturer's mask: 0

[  2293.388] (II) modeset(G0): Supported detailed timing:

[  2293.388] (II) modeset(G0): clock: 107.8 MHz   Image Size:  382 x 215 mm

[  2293.388] (II) modeset(G0): h_active: 1600  h_sync: 1648  h_sync_end 1680 h_blank_end 1940 h_border: 0

[  2293.388] (II) modeset(G0): v_active: 900  v_sync: 903  v_sync_end 908 v_blanking: 926 v_border: 0

[  2293.388] (II) modeset(G0):  N173O6-L02

[  2293.388] (II) modeset(G0):  CMO

[  2293.388] (II) modeset(G0):  N173O6-L02

[  2293.388] (II) modeset(G0): EDID (in hex):

[  2293.388] (II) modeset(G0):    00ffffffffffff000daf191700000000

[  2293.388] (II) modeset(G0):    05130103802716780a08059d58539729

[  2293.388] (II) modeset(G0):    15505400000001010101010101010101

[  2293.388] (II) modeset(G0):    0101010101011c2a405461841a303020

[  2293.388] (II) modeset(G0):    35007ed710000018000000fe004e3137

[  2293.388] (II) modeset(G0):    334f362d4c30320a2020000000fe0043

[  2293.388] (II) modeset(G0):    4d4f0a202020202020202020000000fe

[  2293.388] (II) modeset(G0):    004e3137334f362d4c30320a202000ad

[  2293.389] (II) modeset(G0): Printing probed modes for output LVDS-1

[  2293.389] (II) modeset(G0): Modeline "1600x900"x60.0  107.80  1600 1648 1680 1940  900 903 908 926 -hsync -vsync (55.6 kHz eP)

[  2293.389] (II) modeset(G0): Modeline "1024x768"x120.1  133.47  1024 1100 1212 1400  768 768 770 794 doublescan -hsync +vsync (95.3 kHz d)

[  2293.389] (II) modeset(G0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz d)

[  2293.389] (II) modeset(G0): Modeline "960x720"x120.0  117.00  960 1024 1128 1300  720 720 722 750 doublescan -hsync +vsync (90.0 kHz d)

[  2293.389] (II) modeset(G0): Modeline "928x696"x120.1  109.15  928 976 1088 1264  696 696 698 719 doublescan -hsync +vsync (86.4 kHz d)

[  2293.389] (II) modeset(G0): Modeline "896x672"x120.0  102.40  896 960 1060 1224  672 672 674 697 doublescan -hsync +vsync (83.7 kHz d)

[  2293.389] (II) modeset(G0): Modeline "800x600"x120.0   81.00  800 832 928 1080  600 600 602 625 doublescan +hsync +vsync (75.0 kHz d)

[  2293.389] (II) modeset(G0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz d)

[  2293.389] (II) modeset(G0): Modeline "800x600"x56.2   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz d)

[  2293.389] (II) modeset(G0): Modeline "700x525"x120.0   61.00  700 744 820 940  525 526 532 541 doublescan +hsync +vsync (64.9 kHz d)

[  2293.389] (II) modeset(G0): Modeline "640x512"x120.0   54.00  640 664 720 844  512 512 514 533 doublescan +hsync +vsync (64.0 kHz d)

[  2293.389] (II) modeset(G0): Modeline "640x480"x120.0   54.00  640 688 744 900  480 480 482 500 doublescan +hsync +vsync (60.0 kHz d)

[  2293.389] (II) modeset(G0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz d)

[  2293.389] (II) modeset(G0): Modeline "512x384"x120.0   32.50  512 524 592 672  384 385 388 403 doublescan -hsync -vsync (48.4 kHz d)

[  2293.389] (II) modeset(G0): Modeline "400x300"x120.6   20.00  400 420 484 528  300 300 302 314 doublescan +hsync +vsync (37.9 kHz d)

[  2293.389] (II) modeset(G0): Modeline "400x300"x112.7   18.00  400 412 448 512  300 300 301 312 doublescan +hsync +vsync (35.2 kHz d)

[  2293.389] (II) modeset(G0): Modeline "320x240"x120.1   12.59  320 328 376 400  240 245 246 262 doublescan -hsync -vsync (31.5 kHz d)

[  2293.390] (II) modeset(G0): EDID for output VGA-1

[  2293.478] (II) modeset(G0): EDID for output HDMI-1

[  2293.478] (II) modeset(G0): EDID for output DP-1

[  2293.478] (II) modeset(G0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.

[  2293.478] (==) modeset(G0): DPI set to (96, 96)

[  2293.478] (II) Loading sub module "fb"

[  2293.478] (II) LoadModule: "fb"

[  2293.478] (II) Loading /usr/lib64/xorg/modules/libfb.so

[  2293.478] (II) Module fb: vendor="X.Org Foundation"

[  2293.478]    compiled for 1.18.1, module version = 1.0.0

[  2293.478]    ABI class: X.Org ANSI C Emulation, version 0.4

[  2293.478] (II) Loading sub module "shadow"

[  2293.478] (II) LoadModule: "shadow"

[  2293.479] (II) Loading /usr/lib64/xorg/modules/libshadow.so

[  2293.479] (II) Module shadow: vendor="X.Org Foundation"

[  2293.479]    compiled for 1.18.1, module version = 1.1.0

[  2293.479]    ABI class: X.Org ANSI C Emulation, version 0.4

[  2293.479] (--) Depth 24 pixmap format is 32 bpp

[  2293.479] (==) modeset(G0): Backing store enabled

[  2293.479] (==) modeset(G0): Silken mouse enabled

[  2293.479] (II) modeset(G0): RandR 1.2 enabled, ignore the following RandR disabled message.

[  2293.480] (==) modeset(G0): DPMS enabled

[  2293.480] (WW) modeset(G0): Option "CustomEDID" is not used

[  2293.480] (WW) modeset(G0): Option "AllowEmptyInitialConfiguration" is not used

[  2293.764] (II) NVIDIA: Using 3072.00 MB of virtual memory for indirect memory

[  2293.764] (II) NVIDIA:     access.

[  2293.804] (II) NVIDIA(0): Setting mode "CRT-0:nvidia-auto-select"

[  2293.828] (==) NVIDIA(0): Disabling shared memory pixmaps

[  2293.828] (==) NVIDIA(0): Backing store enabled

[  2293.828] (==) NVIDIA(0): Silken mouse enabled

[  2293.828] (==) NVIDIA(0): DPMS enabled

[  2293.829] (II) Loading sub module "x11glvnd"

[  2293.829] (II) LoadModule: "x11glvnd"

[  2293.829] (WW) Warning, couldn't open module x11glvnd

[  2293.829] (II) UnloadModule: "x11glvnd"

[  2293.829] (II) Unloading x11glvnd

[  2293.829] (II) x11glvnd Loading

[  2293.829] (II) Loading sub module "dri2"

[  2293.829] (II) LoadModule: "dri2"

[  2293.829] (II) Module "dri2" already built-in

[  2293.829] (II) NVIDIA(0): [DRI2] Setup complete

[  2293.829] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia

[  2293.829] (--) RandR disabled

[  2293.830] (II) Initializing extension GLX

[  2293.830] (II) Indirect GLX disabled.

[  2293.830] (II) modeset(G0): Damage tracking initialized

[  2293.867] (II) config/udev: Adding input device Power Button (/dev/input/event3)

[  2293.867] (**) Power Button: Applying InputClass "evdev keyboard catchall"

[  2293.867] (II) LoadModule: "evdev"

[  2293.868] (II) Loading /usr/lib64/xorg/modules/input/evdev_drv.so

[  2293.868] (II) Module evdev: vendor="X.Org Foundation"

[  2293.868]    compiled for 1.18.1, module version = 2.10.1

[  2293.868]    Module class: X.Org XInput Driver

[  2293.868]    ABI class: X.Org XInput driver, version 22.1

[  2293.868] (II) Using input driver 'evdev' for 'Power Button'

[  2293.868] (**) Power Button: always reports core events

[  2293.868] (**) evdev: Power Button: Device: "/dev/input/event3"

[  2293.868] (--) evdev: Power Button: Vendor 0 Product 0x1

[  2293.868] (--) evdev: Power Button: Found keys

[  2293.868] (II) evdev: Power Button: Configuring as keyboard

[  2293.868] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input3/event3"

[  2293.868] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 6)

[  2293.868] (**) Option "xkb_rules" "evdev"

[  2293.868] (II) config/udev: Adding input device Video Bus (/dev/input/event5)

[  2293.868] (**) Video Bus: Applying InputClass "evdev keyboard catchall"

[  2293.868] (II) Using input driver 'evdev' for 'Video Bus'

[  2293.868] (**) Video Bus: always reports core events

[  2293.868] (**) evdev: Video Bus: Device: "/dev/input/event5"

[  2293.868] (--) evdev: Video Bus: Vendor 0 Product 0x6

[  2293.868] (--) evdev: Video Bus: Found keys

[  2293.868] (II) evdev: Video Bus: Configuring as keyboard

[  2293.868] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:01/input/input5/event5"

[  2293.868] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD, id 7)

[  2293.868] (**) Option "xkb_rules" "evdev"

[  2293.869] (II) config/udev: Adding input device Video Bus (/dev/input/event4)

[  2293.869] (**) Video Bus: Applying InputClass "evdev keyboard catchall"

[  2293.869] (II) Using input driver 'evdev' for 'Video Bus'

[  2293.869] (**) Video Bus: always reports core events

[  2293.869] (**) evdev: Video Bus: Device: "/dev/input/event4"

[  2293.869] (--) evdev: Video Bus: Vendor 0 Product 0x6

[  2293.869] (--) evdev: Video Bus: Found keys

[  2293.869] (II) evdev: Video Bus: Configuring as keyboard

[  2293.869] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1a/LNXVIDEO:00/input/input4/event4"

[  2293.869] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD, id 8)

[  2293.869] (**) Option "xkb_rules" "evdev"

[  2293.869] (II) config/udev: Adding input device Power Button (/dev/input/event0)

[  2293.869] (**) Power Button: Applying InputClass "evdev keyboard catchall"

[  2293.869] (II) Using input driver 'evdev' for 'Power Button'

[  2293.869] (**) Power Button: always reports core events

[  2293.869] (**) evdev: Power Button: Device: "/dev/input/event0"

[  2293.869] (--) evdev: Power Button: Vendor 0 Product 0x1

[  2293.869] (--) evdev: Power Button: Found keys

[  2293.869] (II) evdev: Power Button: Configuring as keyboard

[  2293.869] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0/event0"

[  2293.869] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 9)

[  2293.869] (**) Option "xkb_rules" "evdev"

[  2293.870] (II) config/udev: Adding input device Lid Switch (/dev/input/event2)

[  2293.870] (II) No input driver specified, ignoring this device.

[  2293.870] (II) This device may have been added with another device file.

[  2293.870] (II) config/udev: Adding input device Sleep Button (/dev/input/event1)

[  2293.870] (**) Sleep Button: Applying InputClass "evdev keyboard catchall"

[  2293.870] (II) Using input driver 'evdev' for 'Sleep Button'

[  2293.870] (**) Sleep Button: always reports core events

[  2293.870] (**) evdev: Sleep Button: Device: "/dev/input/event1"

[  2293.870] (--) evdev: Sleep Button: Vendor 0 Product 0x3

[  2293.870] (--) evdev: Sleep Button: Found keys

[  2293.870] (II) evdev: Sleep Button: Configuring as keyboard

[  2293.870] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input1/event1"

[  2293.870] (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD, id 10)

[  2293.870] (**) Option "xkb_rules" "evdev"

[  2293.871] (II) config/udev: Adding input device HDA Intel PCH HDMI/DP,pcm=3 (/dev/input/event9)

[  2293.871] (II) No input driver specified, ignoring this device.

[  2293.871] (II) This device may have been added with another device file.

[  2293.871] (II) config/udev: Adding input device HDA Intel PCH Mic (/dev/input/event7)

[  2293.871] (II) No input driver specified, ignoring this device.

[  2293.871] (II) This device may have been added with another device file.

[  2293.871] (II) config/udev: Adding input device HDA Intel PCH Front Headphone (/dev/input/event8)

[  2293.871] (II) No input driver specified, ignoring this device.

[  2293.871] (II) This device may have been added with another device file.

[  2293.871] (II) config/udev: Adding input device Primax USB OPTICAL MOUSE (/dev/input/event11)

[  2293.871] (**) Primax USB OPTICAL MOUSE: Applying InputClass "evdev pointer catchall"

[  2293.871] (II) Using input driver 'evdev' for 'Primax USB OPTICAL MOUSE'

[  2293.871] (**) Primax USB OPTICAL MOUSE: always reports core events

[  2293.871] (**) evdev: Primax USB OPTICAL MOUSE: Device: "/dev/input/event11"

[  2293.922] (--) evdev: Primax USB OPTICAL MOUSE: Vendor 0x461 Product 0x4de3

[  2293.922] (--) evdev: Primax USB OPTICAL MOUSE: Found 9 mouse buttons

[  2293.922] (--) evdev: Primax USB OPTICAL MOUSE: Found scroll wheel(s)

[  2293.922] (--) evdev: Primax USB OPTICAL MOUSE: Found relative axes

[  2293.922] (--) evdev: Primax USB OPTICAL MOUSE: Found x and y relative axes

[  2293.922] (II) evdev: Primax USB OPTICAL MOUSE: Configuring as mouse

[  2293.922] (II) evdev: Primax USB OPTICAL MOUSE: Adding scrollwheel support

[  2293.922] (**) evdev: Primax USB OPTICAL MOUSE: YAxisMapping: buttons 4 and 5

[  2293.922] (**) evdev: Primax USB OPTICAL MOUSE: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200

[  2293.922] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.1/0000:04:00.0/usb3/3-2/3-2:1.0/0003:0461:4DE3.0001/input/input18/event11"

[  2293.922] (II) XINPUT: Adding extended input device "Primax USB OPTICAL MOUSE" (type: MOUSE, id 11)

[  2293.922] (II) evdev: Primax USB OPTICAL MOUSE: initialized for relative axes.

[  2293.923] (**) Primax USB OPTICAL MOUSE: (accel) keeping acceleration scheme 1

[  2293.923] (**) Primax USB OPTICAL MOUSE: (accel) acceleration profile 0

[  2293.923] (**) Primax USB OPTICAL MOUSE: (accel) acceleration factor: 2.000

[  2293.923] (**) Primax USB OPTICAL MOUSE: (accel) acceleration threshold: 4

[  2293.924] (II) config/udev: Adding input device Primax USB OPTICAL MOUSE (/dev/input/mouse1)

[  2293.924] (II) No input driver specified, ignoring this device.

[  2293.924] (II) This device may have been added with another device file.

[  2293.925] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event6)

[  2293.925] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"

[  2293.925] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard'

[  2293.925] (**) AT Translated Set 2 keyboard: always reports core events

[  2293.925] (**) evdev: AT Translated Set 2 keyboard: Device: "/dev/input/event6"

[  2293.925] (--) evdev: AT Translated Set 2 keyboard: Vendor 0x1 Product 0x1

[  2293.925] (--) evdev: AT Translated Set 2 keyboard: Found keys

[  2293.925] (II) evdev: AT Translated Set 2 keyboard: Configuring as keyboard

[  2293.925] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input6/event6"

[  2293.925] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id 12)

[  2293.925] (**) Option "xkb_rules" "evdev"

[  2293.927] (II) config/udev: Adding input device PS/2 Logitech Wheel Mouse (/dev/input/event10)

[  2293.927] (**) PS/2 Logitech Wheel Mouse: Applying InputClass "evdev pointer catchall"

[  2293.927] (II) Using input driver 'evdev' for 'PS/2 Logitech Wheel Mouse'

[  2293.927] (**) PS/2 Logitech Wheel Mouse: always reports core events

[  2293.927] (**) evdev: PS/2 Logitech Wheel Mouse: Device: "/dev/input/event10"

[  2293.927] (--) evdev: PS/2 Logitech Wheel Mouse: Vendor 0x2 Product 0x1

[  2293.927] (--) evdev: PS/2 Logitech Wheel Mouse: Found 3 mouse buttons

[  2293.927] (--) evdev: PS/2 Logitech Wheel Mouse: Found relative axes

[  2293.927] (--) evdev: PS/2 Logitech Wheel Mouse: Found x and y relative axes

[  2293.927] (II) evdev: PS/2 Logitech Wheel Mouse: Configuring as mouse

[  2293.927] (**) evdev: PS/2 Logitech Wheel Mouse: YAxisMapping: buttons 4 and 5

[  2293.927] (**) evdev: PS/2 Logitech Wheel Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200

[  2293.927] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio2/input/input15/event10"

[  2293.927] (II) XINPUT: Adding extended input device "PS/2 Logitech Wheel Mouse" (type: MOUSE, id 13)

[  2293.927] (II) evdev: PS/2 Logitech Wheel Mouse: initialized for relative axes.

[  2293.928] (**) PS/2 Logitech Wheel Mouse: (accel) keeping acceleration scheme 1

[  2293.928] (**) PS/2 Logitech Wheel Mouse: (accel) acceleration profile 0

[  2293.928] (**) PS/2 Logitech Wheel Mouse: (accel) acceleration factor: 2.000

[  2293.928] (**) PS/2 Logitech Wheel Mouse: (accel) acceleration threshold: 4

[  2293.929] (II) config/udev: Adding input device PS/2 Logitech Wheel Mouse (/dev/input/mouse0)

[  2293.929] (II) No input driver specified, ignoring this device.

[  2293.929] (II) This device may have been added with another device file.

[  2294.538] (--) NVIDIA(GPU-0): Chi Mei Optoelectronics corp. (CRT-0): connected

[  2294.538] (--) NVIDIA(GPU-0): Chi Mei Optoelectronics corp. (CRT-0): 400.0 MHz maximum pixel clock

[  2294.538] (--) NVIDIA(GPU-0): 

[  2295.165] (--) NVIDIA(GPU-0): Chi Mei Optoelectronics corp. (CRT-0): connected

[  2295.165] (--) NVIDIA(GPU-0): Chi Mei Optoelectronics corp. (CRT-0): 400.0 MHz maximum pixel clock

[  2295.165] (--) NVIDIA(GPU-0): 

```

----------

## mir3x

So just downgrade using:

FEATURES="-collision-detect" emerge XXX ?

or remove file manually ...

----------

## Xywa

 *mir3x wrote:*   

> So just downgrade using:
> 
> FEATURES="-collision-detect" emerge XXX ?
> 
> or remove file manually ...

 

I was trying FEATURES="-collision-detect" emerge XXX and did remove xorg-server manually, did not help.

UPDATE.

I did manage to downgrade X for version from post above, the problem was still the same. Is there any existing X configuration in 2016 which works with nvidia-optimus & nvidia driver? I was trying to downgrade eselect-opengl, but it was too many changes...

Maybe here is still the problem?

https://bugs.gentoo.org/show_bug.cgi?id=572274

LETS TRY AGAIN, to track, what is going wrong:

Xorg.0.log

http://pastebin.com/mVhWtpC9

The only error:

```
[  2228.295] (II) Loading sub module "glamoregl"

[  2228.295] (II) LoadModule: "glamoregl"

[  2228.295] (II) Loading /usr/lib64/xorg/modules/libglamoregl.so

[  2228.297] (II) Module glamoregl: vendor="X.Org Foundation"

[  2228.297]    compiled for 1.18.1, module version = 1.0.0

[  2228.297]    ABI class: X.Org ANSI C Emulation, version 0.4

[  2228.297] (II) glamor: OpenGL accelerated X.org driver based.

[  2228.304] (EE) modeset(G0): eglInitialize() failed

[  2228.305] (EE) modeset(G0): glamor initialization failed
```

/var/log/messages

http://pastebin.com/tGUm3TiM

here looks OK

```
Feb 17 05:27:16 tux kernel: nvidia-modeset: Allocated GPU:0 (GPU-d236f73a-723d-f140-5d29-2116ac080711) @ PCI:0000:01:00.0
```

maybe this?

```
Feb 17 05:27:23 tux kernel: xembedsniproxy[11252]: segfault at 2 ip 000000000040f8b6 sp 00007ffde39fdfb0 error 4 in xembedsniproxy[400000+17000]
```

?

https://bugs.kde.org/show_bug.cgi?id=355463

----------

## Atmmac

Did you try masking the packages that I had listed earlier? I am hoping this new xorg version takes care of it. Optimus is always a huge hassle. Anyways here is a copy of my xorg.conf which is working with xorg-server-1.17.4 and the packages masked i referenced above.

```
Section "ServerLayout"

    Identifier "layout"

    Screen 0 "nvidia"

    Inactive "intel"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "PCI:02:0:0"

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    Option "AllowEmptyInitialConfiguration"

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    Option "AccelMethod" "none"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"                                                                                                                                                            

EndSection 
```

----------

## mjgardes

I found this bug had different symptoms for me, but it appears to be the same root cause.  

Some people have reported that all they get is a pixel in the upper left corner.  For me, most applications seem to work except some widgets (drop-down menus and such) are either invisible or show up as a line or pixel in the upper left corner.  Simple applications, such as dmenu, fluxbox, etc. just failed silently.  In other applications, pixman was nice enough to detect that it was trying to draw menu items in negative coordinates and produced the error:

In pixman_region32_init_rect: Invalid rectangle passed

Set a breakpoint on '_pixman_log_error' to debug

Many gtk+, qt, and other apps were affected so this led me to believe it was an  X server bug.  

Downgrading xorg-server to 1.17.4 took care of it for now.

----------

## Xywa

Hi,

As there is 30 days as I cannot to use my Nvidia Optimus, I would like to apply a patch to fix the problem.

https://bugs.gentoo.org/show_bug.cgi?id=574410

The patch is here:

https://cgit.freedesktop.org/xorg/xserver/diff/?id=7bb64d8c1de9659f11da7917772919b071e9db82

How to use it in Gentoo?

p.s. Also Arch forum says there are some changes in xorg.conf?

 *Quote:*   

> The xorg.conf instructions have changed

 

https://bugs.archlinux.org/task/47151?project=1

Any ideas what to do?

p.s.2

Gentoo Nvidia Optimus is a bit out-of-dated:

https://wiki.gentoo.org/wiki/NVIDIA/Optimus

as sugested link to Nvidia website leads to 343.36 version, and in portage we use 361.28. So there is a bitt simpler (and different) xorg.conf than in Gentoo guide.

 *Quote:*   

> If X.Org X server version 1.17.2 or higher

 

^^ Thanks to newset version of Nvidia info I know now:

 *Quote:*   

> Some versions of the “modesetting” driver try to load a sub-module called “glamor”, which conflicts with the NVIDIA GLX implementation. Please ensure that the libglamoregl.so X module is not installed.

 

looks like it s related to my case:

```
[  2228.304] (EE) modeset(G0): eglInitialize() failed 

[  2228.305] (EE) modeset(G0): glamor initialization failed
```

----------

## TwoMinds

Hello,

I solved on my system with Optimus and x11-base/xorg-server-1.18.1, without changing anything in the X.org configuration, but using the resulting patch coming from the link above.

The resulting patch I applied is the following (for convenience):

```
diff -uNr xorg-server-1.18.1-orig/randr/rrmonitor.c xorg-server-1.18.1/randr/rrmonitor.c

--- xorg-server-1.18.1-orig/randr/rrmonitor.c   2016-02-08 23:52:26.000000000 +0100

+++ xorg-server-1.18.1/randr/rrmonitor.c   2016-03-05 21:40:30.393344339 +0100

@@ -326,7 +326,7 @@

         RRMonitorSetFromClient(pScrPriv->monitors[list.client_primary], mon);

         mon++;

     } else if (list.server_primary >= 0) {

-        RRMonitorSetFromServer(pScrPriv->crtcs[list.server_primary], mon);

+        RRMonitorSetFromServer(list.server_crtc[list.server_primary], mon);

         mon++;

     }

 

@@ -354,8 +354,8 @@

 

     /* And finish with the list of crtc-inspired monitors

      */

-    for (c = 0; c < pScrPriv->numCrtcs; c++) {

-        RRCrtcPtr crtc = pScrPriv->crtcs[c];

+    for (c = 0; c < list.num_crtcs; c++) {

+        RRCrtcPtr crtc = list.server_crtc[c];

         if (c == list.server_primary && list.client_primary < 0)

             continue;

 

diff -uNr xorg-server-1.18.1-orig/randr/rroutput.c xorg-server-1.18.1/randr/rroutput.c

--- xorg-server-1.18.1-orig/randr/rroutput.c   2016-02-08 23:52:26.000000000 +0100

+++ xorg-server-1.18.1/randr/rroutput.c   2016-03-05 21:40:30.393344339 +0100

@@ -543,6 +543,7 @@

     WindowPtr pWin;

     rrScrPrivPtr pScrPriv;

     int ret;

+    ScreenPtr slave;

 

     REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);

 

@@ -565,7 +566,18 @@

 

     pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);

     if (pScrPriv)

+    {

         RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);

+        

+        xorg_list_for_each_entry(slave,

+                                 &pWin->drawable.pScreen->output_slave_list,

+                                 output_head) {

+            rrScrPrivPtr pSlavePriv;

+            pSlavePriv = rrGetScrPriv(slave);

+            

+            RRSetPrimaryOutput(slave, pSlavePriv, output);

+        }

+    }

 

     return Success;

 }
```

EDIT:

Here there is the bug on Gentoo Bugzilla.

----------

## Xywa

 *TwoMinds wrote:*   

> The resulting patch I applied is the following (for convenience):

 

Quick question - how to apply such patch?

----------

## Xywa

There is a new xorg-server 1.18.2 in Today's portage:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e568e1b08734f77e40cd0bd5c5937b88f751abdf

Lets see if this fix our problems...

----------

## Xywa

OK, so time for small update.

Today we have 16th of March 2016. In my case another week without nvidia...

We have new xorg-server 1.18.2, new kernel 4.5.0, new intel driver 2.99.917_p20160313 and problem... still exist.

As nvidia manual says:

 *Quote:*   

> Some versions of the “modesetting” driver try to load a sub-module called “glamor”, which conflicts with the NVIDIA GLX implementation. Please ensure that the libglamoregl.so X module is not installed.

 

...so I recompiled xorg-server without glamor USE flag.

For now, I have a black screen and such error in Xorg.0.log

```
[ 19696.917] (EE) modeset(G0): failed to set mode: No space left on device
```

so looks exactly the same like in the first post.

I did small research, and... looks like such error only exist in Gentoo(!):

[url]https://www.google.pl/?gws_rd=ssl#q=%22(EE)+modeset(G0):+failed+to+set+mode:+No+space+left+on+device%22[/url]

There is only on place in all the Google with such error listed - this topic. So maybe this error is Gentoo configuration related - eg. eselect-opengl?

Where do you think I should ask for help? Xorg bugzilla?

=====

Update, 

I posted it on Xorg bugzilla:

https://bugs.freedesktop.org/show_bug.cgi?id=94577

Downgrade did NOT help (black screen again):

```
>=x11-base/xorg-drivers-1.18-r1 

>=x11-base/xorg-server-1.18.0 

>=x11-drivers/xf86-input-evdev-2.10.0 

>=x11-drivers/nvidia-drivers-358.16-r4 

>=x11-drivers/xf86-video-intel-2.99.917_p20160203 

>=x11-drivers/xf86-input-mouse-1.9.1 

>x11-drivers/xf86-input-synaptics-1.8.3
```

Maybe I should recompile entire system or reinstall Gentoo?

----------

## xerofzos

With downgraded packages, this works for me:

cat /etc/X11/xinit/xinitrc.d/00-nvidia-optimus.sh

```

#!/bin/sh

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

```

cat /usr/share/gdm/greeter/autostart/display_setup.desktop

```

[Desktop Entry]

Type=Application

Name=Display setup

Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"

NoDisplay=true

X-GNOME-AutoRestart=true

```

cat /etc/xorg/xorg.conf

```

Section "ServerLayout"

    Identifier "layout"

    Screen 0 "nvidia"

    Inactive "intel"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    # Change BusID if necessary. Tips: (lspci | grep 3D) (Change 01:00.0 to 1:0:0)

    BusID "PCI:1:0:0"

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    Option "AllowEmptyInitialConfiguration" "Yes"

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    # Change BusID if necessary. Tips: (lspci | grep VGA) (Change 00:02.0 to 0:2:0)

    BusID "PCI:0:2:0"

    Option "AccelMethod"  "none"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection

```

----------

## fhede

 *xerofzos wrote:*   

> With downgraded packages, this works for me:
> 
> cat /etc/X11/xinit/xinitrc.d/00-nvidia-optimus.sh
> 
> ```
> ...

 

Can you share what you downgraded and to what thanks.

----------

## xerofzos

I have same masks as in 3rd comment.

----------

## fhede

 *xerofzos wrote:*   

> I have same masks as in 3rd comment.

 

Ok thanks. I still not get this to work. But i removed intel from make.conf and added i965 instead. 

After that  i got bumblebee to start. Not what i want. But i have a desktop anyway.

----------

## Xywa

After last days drivers update (both intel & nvidia) I have such error on the screen after typing 'startx' from the console:

 *Quote:*   

> xrandr: Configure crtc 2 failed
> 
> X Error of failed request: BadValue (integer parameter out of range for operation)
> 
>    Major Opcode of failed request: 139 (RANDR)
> ...

 

p.s. Do you remember when x11-drivers/xf86-video-modesetting was no longer necessary as it of part of probably xorg-server now?

p.s.2 fhede, downgrade with your settings did not help. I cannot start X either.

BTW - I cannot start pure X (without KDE) in any configuration now, I was trying with new xorg ald downgraded one, with eselect opengl nvidia, and eselect opengl xorg-x11. Just after typing 'startx' from console, looks like X starts and after 1/10 of sec I am back into text console. No error in logs (so whats wrong?):

http://pastebin.com/p3Y6EfDw

The only sollution for myself is to reinstall Gentoo, and if doesn't work, I will try another distro to see, if this bug is Gentoo related.

----------

## Barbieken

Have the same problems with xorg-server-1.18.2 and nvidia-drivers-364.12-r1. Blackscreen without blinking cursor instead of sddm login screen. "[     8.398] (WW) NVIDIA(0): Unable to get display device for DPI computation." in the Xorg.0.log

It used to work with 1.18.1 (or .0, i don't remember) and one of older version of nvidia-drivers though.

If I remove nvidia.conf and change opengl to xorg-x11 I'm able to login to plasma and everything works without problems. But with nvidia/opengl only blackscreen istead of login screen.

nvidia.conf

```

Section "ServerLayout"

    Identifier "layout"

    Screen 1 "nvidia"

    Inactive "intel"

    Option "Xinerama" "0"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "PCI:1:0:0"

    Option "RegistryDwords" "EnableBrightnessControl=1"

    Option "AllowEmptyInitialConfiguration" 

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    # Uncomment this line if your computer has no display devices connected to

    # the NVIDIA GPU.  Leave it commented if you have display devices

    # connected to the NVIDIA GPU that you would like to use.

    #Option "UseDisplayDevice" "none"

     Option "AllowEmptyInitialConfiguration" 

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    BusID "PCI:0:2:0"

    Option "AccelMethod" "none"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection

```

----------

## Xywa

 *Barbieken wrote:*   

> Have the same problems with xorg-server-1.18.2 and nvidia-drivers-364.12-r1. Blackscreen without blinking cursor instead of sddm login screen. "[     8.398] (WW) NVIDIA(0): Unable to get display device for DPI computation." in the Xorg.0.log

 

The point is, in my case now, I have no errors in Xorg.0.log. I was trying all the servers 1.17.4, 1.18.0, 1.18.1, 1.18.2 - and all the same. I am trying to downgrade to 1.16.4-r5 now. Will let you know soon.

----------

## Barbieken

 *Xywa wrote:*   

>  *Barbieken wrote:*   Have the same problems with xorg-server-1.18.2 and nvidia-drivers-364.12-r1. Blackscreen without blinking cursor instead of sddm login screen. "[     8.398] (WW) NVIDIA(0): Unable to get display device for DPI computation." in the Xorg.0.log 
> 
> The point is, in my case now, I have no errors in Xorg.0.log. I was trying all the servers 1.17.4, 1.18.0, 1.18.1, 1.18.2 - and all the same. I am trying to downgrade to 1.16.4-r5 now. Will let you know soon.

 

It's not an error though (EE). It's warning (WW)

Also just got a thought about xinerama. A while ago I disabled the xinerama flag globally because there was a bug in one of recent versions of xorg-server, which resulted in multiple problems with menus. So the new problem could be related to bugfix of this old problem, as as fas as i remember it is related to xinerama. I'll try to enable xinerama and rebuild the world later.

----------

## Xywa

I did rebuild system without xinerama, did not help.

I will try to rebuild all the system to see if it help.

----------

## Barbieken

Full rebuild with or without xinerama didn't work for me as well

NVIDIA relevant log data:

```

[     8.187] (II) Module glx: vendor="NVIDIA Corporation"

[     8.187] (II) NVIDIA GLX Module  364.12  Wed Mar 16 20:39:46 PDT 2016

[     8.195] (II) Module nvidia: vendor="NVIDIA Corporation"

[     8.197] (II) NVIDIA dlloader X Driver  364.12  Wed Mar 16 20:16:45 PDT 2016

[     8.197] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs

[     8.210] (II) NVIDIA(0): Creating default Display subsection in Screen section

[     8.210] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32

[     8.210] (==) NVIDIA(0): RGB weight 888

[     8.210] (==) NVIDIA(0): Default visual is TrueColor

[     8.210] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)

[     8.211] (**) NVIDIA(0): Option "AllowEmptyInitialConfiguration"

[     8.211] (**) NVIDIA(0): Option "RegistryDwords" "EnableBrightnessControl=1"

[     8.211] (**) NVIDIA(0): Enabling 2D acceleration

[     8.398] (II) NVIDIA(0): NVIDIA GPU GeForce GT 730M (GK208) at PCI:1:0:0 (GPU-0)

[     8.398] (--) NVIDIA(0): Memory: 1048576 kBytes

[     8.398] (--) NVIDIA(0): VideoBIOS: 80.28.2a.00.30

[     8.398] (II) NVIDIA(0): Detected PCI Express Link width: 8X

[     8.398] (II) NVIDIA(0): Validated MetaModes:

[     8.398] (II) NVIDIA(0):     "NULL"

[     8.398] (II) NVIDIA(0): Virtual screen size determined to be 640 x 480

[     8.398] (WW) NVIDIA(0): Unable to get display device for DPI computation.

[     8.398] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default

[     9.030] (II) NVIDIA: Using 3072.00 MB of virtual memory for indirect memory

[     9.031] (II) NVIDIA:     access.

[     9.055] (II) NVIDIA(0): Setting mode "NULL"

[     9.062] (==) NVIDIA(0): Disabling shared memory pixmaps

[     9.062] (==) NVIDIA(0): Backing store enabled

[     9.062] (==) NVIDIA(0): Silken mouse enabled

[     9.062] (==) NVIDIA(0): DPMS enabled

[     9.063] (II) NVIDIA(0): [DRI2] Setup complete

[     9.063] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia

```

----------

## Barbieken

All right I made nvidia+opengl work at last.  GeForce 730M, Thinkpad T540p laptop.

x11-base/xorg-server-1.18.2

x11-drivers/nvidia-drivers-358.16-r5  #downgrade

x11-misc/sddm-0.13.0-r3

sys-kernel/gentoo-sources-4.4.1

nvidia.conf

```

Section "ServerLayout"

    Identifier "layout"

    Screen 1 "nvidia"

    Inactive "intel"

    Option "Xinerama" "0"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "PCI:1:0:0"

    Option "RegistryDwords" "EnableBrightnessControl=1"

    Option "AllowEmptyInitialConfiguration" 

EndSection

Section "Screen"

    Identifier "nvidia"

    Device "nvidia"

    Option "AllowEmptyInitialConfiguration" 

EndSection

Section "Device"

    Identifier "intel"

    Driver "modesetting"

    BusID "PCI:0:2:0"

    Option "AccelMethod" "none"

EndSection

Section "Screen"

    Identifier "intel"

    Device "intel"

EndSection

```

/usr/share/sddm/scripts/Xsetup

```

xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

xrandr --dpi 144

```

xinerama flag off in the make.conf

----------

## Xywa

Great news! I will try this config, but at the moment I am in the middle of rebuilding all the system. 744 out of 1274 files so far   :Cool:   :Cool:   :Cool: 

----------

## Xywa

 *Barbieken wrote:*   

> x11-base/xorg-server-1.18.2
> 
> x11-drivers/nvidia-drivers-358.16-r5  #downgrade
> 
> x11-misc/sddm-0.13.0-r3
> ...

 

Did not work either  :Sad: 

No answer on xorg buglist either  :Sad: 

I need ASAP Nvidia to do my job  :Sad:  , could someone recommend me a distro with a fresh kde which works currently with nvidia Optimus? Kubutnu or Open Suse?

----------

## Xywa

Right, I wrote on Nvidia forum, maybe they will help.

But I would like to check something. 

Nvidia says: A Linux kernel with CONFIG_DRM enabled and the appropriate driver interfaces present

http://us.download.nvidia.com/XFree86/Linux-x86_64/361.28/README/randr14.html

Where should I find those drm_gem_prime_export, drm_gem_prime_import... ?

 *Quote:*   

> System Requirements
> 
> X.Org X server version 1.13 or higher.
> 
> A Linux kernel with CONFIG_DRM enabled and the appropriate driver interfaces present:
> ...

 

----------

## fhede

I finally got it working.

I have the latest programs.

x11-base/xorg-server-1.18.2 

x11-drivers/nvidia-drivers-364.12-r1

x11-misc/lightdm-lightdm-1.17.5 

sys-kernel/gentoo-sources-4.5.0

I recompiled intel with uxa after i read this thread ( thanks for the tip Xywa) [url] https://forums.gentoo.org/viewtopic-t-1042216.html

I create two xorg.conf-files one for intel and one for nvidia and they look like this.

xorg.conf.intel

Section "Device" 

   Identifier  "Intel Graphics" 

   Driver      "intel" 

   Option      "AccelMethod" "uxa" 

   Option      "TearFree" "true" 

EndSection

-------------------------------------------------------

xorg.conf.nvidia

/etc/X11/xorg.conf

Section "Module"

    Load "modesetting"

EndSection

Section "Device"

    Identifier "nvidia"

    Driver "nvidia"

    BusID "PCI:4:0:0"

    Option "AllowEmptyInitialConfiguration" "on"

EndSection

And i eselect opengl set xorg-x11.

I also have in grub.

GRUB_CMDLINE_LINUX="root=/dev/sda3 quiet nvidia_drm modeset=1"

glxgears show 60.425 FPS

[IMG]http://i1018.photobucket.com/albums/af301/fredda_01/optimus-gentoo/2016-04-03%2013.02.44.jpg[/IMG][/code][/url]

----------

## Xywa

 *Quote:*   

> I recompiled intel with uxa

 

Do you have uxa only for intel or globally?

 *Quote:*   

> I create two xorg.conf-files one for intel and one for nvidia and they look like this.

 

Do I need 2 config files like you or can I put everything into xorg.conf?

----------

## fhede

 *Xywa wrote:*   

>  *Quote:*   I recompiled intel with uxa 
> 
> Do you have uxa only for intel or globally?
> 
>  *Quote:*   I create two xorg.conf-files one for intel and one for nvidia and they look like this. 
> ...

 

You can try one, that should work. But i have had so much trouble with this now and tried everything so i tested with two xorg.configs from this guide.

https://fitzcarraldoblog.wordpress.com/2015/07/01/switching-between-intel-and-nvidia-graphics-processors-on-a-laptop-with-nvidia-optimus-hardware-running-gentoo-linux/

I did like this in package.use

x11-drivers/xf86-video-intel  uxa dri

----------

## alexanius

Hello. Same issue here.

xorg.conf

xorg.log

dmesg

.config

lspci

grub.cfg

After xorg starts I see only black screen with back lighting. I tried different configurations but still can't get what's wrong.

I'm confused with lines

```
[   29.780176] vgaarb: this pci device is not a vga device
```

from dmesg but Xorg.log shows no errors.

Can someone help, please?

----------

## rhoyerboat

FINALLY got my optimus working again for the first time since -- sheesh I can't even remember, same story, worked, upgrade, broke.

I had the black-no-blacklit screen problem, accompanied by the no space left on device problem with the /etc/X11/xorg.conf.d/20-nvidia.conf file from the Gentoo Optimus Wiki page. 

Setting xrandr --listproviders > xrandrproviders and xrandr --listmonitors > xrandrmonitors in ~/.xinitrc would reveal both providers and 0 monitors.

(credit where do, big thanks go out to the guys on tis list) ... From this list post: https://bugs.freedesktop.org/show_bug.cgi?id=94577

Enabling te glamor USE flag in make.conf and doing an emerge --deep --newuse @world did the trick! Finally hybrid graphics again yaay I would be happier If I had slept better since I decided to work on this old problem of mine again  :Wink: 

TURNS OUT IT WAS IN THE WIKI HOLY COW - that light blue note was just completely invisible to me for some reason. There go a few days of my life for no good reason. Lol

My versions:

```
X.Org X Server 1.18.4  

Release Date: 2016-07-19

```

```

[  2584.317] (II) NVIDIA dlloader X Driver  375.26  Thu Dec  8 17:37:15 PST 2016

```

```

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

01:00.0 VGA compatible controller: NVIDIA Corporation GF119M [Quadro NVS 4200M] (rev a1)

```

----------

## alexanius

Tried to enable glamor. Still get the black screen, but found some interesting things.

First. If I make startx from user, it starts! But xrandr says I have only two possible resolutions (640x480 by default):

```
640x480

320x240
```

I have the following in my .xinitrc:

```
xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto

xrandr --dpi 96

startkde
```

Second. If I strart xdm, I have blackscreen but in my log I get the following EE:

```
[  3835.729] (EE) modeset(G0): eglGetDisplay() failed

[  3835.729] (EE) modeset(G0): glamor initialization failed
```

I have the following lines in my /usr/share/sddm/scripts/Xsetup:

```
xrandr --setprovideroutputsource modesetting NVIDIA-0

xrandr --auto
```

I tried to play with different values of

```
    Option         "AccelMethod" "none"
```

but that had no effets.

It seems I have some progress but I still can't get how to make it.

----------

## CPUFan

I had the same issue, but for another reason.

In my case, I used a display manager with an Xsetup config file not under /etc (but under /usr). The display manager's update caused the (previously working) Xsetup file to be silently removed, which caused the xrandr commands not to be executed anymore. The result was the described black screen at login and the

```
eglGetDisplay() failed 

glamor initialization failed
```

errors.

As a lesson, I'll now config-protect these Xsetup files. I also added a short note in the wiki.

----------

## mbar

Also enabling aggresive PCIe power management on Optimus systems can result in blank screen even if the rest of the configuration (xorg.conf, gdm/xdg autostarts) are OK.

"pcie_port_pm=off" kernel parameter can help.

----------

## firasuke

I've written an article on how to configure bumblebee on gentoo linux on my website and I'm constantly updating it (hopefully will add it to the gentoo wiki once I confirm it's 100% working), you may want to check it out:

https://www.dotslashlinux.com/2017/06/04/setting-up-bumblebee-on-gentoo-linux/

A couple of users have found it helpful, give it a shot and tell me what went wrong  :Razz: 

Good Luck

----------

## alexanius

 *CPUFan wrote:*   

> As a lesson, I'll now config-protect these Xsetup files. I also added a short note in the wiki.

 

Wonderful! Thanks! After I've configured Xorg and it worked for some time I decided to update the system and got black screen again. And it was exactly this issue. Now it works again. Also I think it may be helpful for someone if I post my working Xorg.conf here.

----------

