Only one display resolution with Optimus on GT740M/IntelHD4600

I cannot switch to any other resolution but 1920x1080 neither using nvidia-setting (only one displayed) nor xrandr (XOrg crash)
xrandr gives all resolutions:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080      60.0*+
   1400x1050      60.0  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0     60.0  
   960x720        60.0  
   928x696        60.1  
   896x672        60.0  
   800x600        60.0     60.3     56.2  
   700x525        60.0  
   640x512        60.0  
   640x480        60.0     59.9  
   512x384        60.0  
   400x300        60.3     56.3  
   320x240        60.1  
VGA-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)

but xrandr --q1 only one:

SZ:    Pixels          Physical       Refresh
*0   1920 x 1080   ( 650mm x 365mm )  *50  
Current rotation - normal
Current reflection - none
Rotations possible - normal left inverted right 
Reflections possible - X Axis Y Axis

xorg.conf:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:7:0:0"
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"
EndSection

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

Also Metamodes don’t work. Adding one using nvidia-setting crashes X11. So if playing a game at lower resolution than 1920x1080 gives me just a small window with a black border
Any ideas?

kernel 3.12.7-gentoo
nvidia-drivers 331.38
modesetting 0.8.0
xserver 1.14.3
xrandr 1.4.1

nvidia-bug-report.log.gz (47.2 KB)

Hi generix,

Can you please attach a bug report log that has the crash backtrace in it?

Command issued
Name of generated bug report (X11 restarts after crash)

xrandr --output eDP-0 --mode 1400x1050
nvidia-bug-report-1.log.gz

nvidia-settings --assign CurrentMetaMode=“eDP-0: 1920x1080 { ViewPortIn=800x600, ViewPortOut=1920x1080 }”
nvidia-bug-report-2.log.gz

Edit: additional backtrace from gdb in the latter case:

#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007ffd0318458b in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
No symbol table info available.
#2  0x00007ffd03185530 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
No symbol table info available.
#3  0x00007ffd0318a634 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
No symbol table info available.
#4  0x00007ffd0314066b in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
No symbol table info available.
#5  0x00007ffd035d43d6 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
No symbol table info available.
#6  0x000000000043b476 in ?? ()
No symbol table info available.
#7  0x0000000000429f2a in ?? ()
No symbol table info available.
#8  0x00007ffd07de9bf5 in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#9  0x000000000042a271 in _start ()
No symbol table info available.

Regards.
[This file was removed because it was flagged as potentially malicious] (55.5 KB)
nvidia-bug-report-2.log.gz (55.5 KB)

Thanks, generix. Unfortunately, the gdb backtrace doesn’t include the information about where nvidia_drv.so was loaded. Also, your bug report logs don’t include the backtrace, presumably because the X server was restarted before you could run nvidia-bug-report.sh. Usually there’s a usable backtrace in /var/log/Xorg.0.log.old, but it looks like that was missing. Do you have an Xorg.0.log.old on your filesystem that just wasn’t picked up by nvidia-bug-report.sh for some reason?

Edit: if you can’t get a usable backtrace from Xorg.0.log{,.old}, then in gdb, please run “info sharedlibrary” and “info registers” in addition to “backtrace” and paste the complete output from all three.

Odd, it wasn’t included. Sorry, didn’t check.
I’ve rebuilt xorg-server with debug symbols, maybe it helps. If you need that for more packages, don’t hesitate to ask.

logfiles.zip (16.6 KB)