thinkpad t450s optimus geforce 940m dual monitor freezing centos 7 with 375.39

I followed the readme http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/README/index.html on driver download page. My thinkpad t450s has nvidia 940m. I installed latest 375.39 and want to try “Offloading Graphics Display with RandR 1.4”, my laptop screen works fine, but my external led monitor connected via a displayport to dvi adapter freezes on kde login. It stops at kde splash screen, and lights up, but you can not drag window or move cursor onto it.

How can I fix this ?

kernel: 4.4.57-1.el7.elrepo.x86_64
driver: 375.39

xrandr: 1.4

$ xrandr -v
xrandr program version       1.4.3
Server reports RandR version 1.4

xorg version: 1.17.2

$ Xorg -version

X.Org X Server 1.17.2
Release Date: 2015-06-16
X Protocol Version 11, Revision 0
Build Operating System:  2.6.32-573.18.1.el6.x86_64 
Current Operating System: Linux localhost.localdomain 4.4.57-1.el7.elrepo.x86_64 #1 SMP Sun Mar 26 10:38:02 EDT 2017 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-4.4.57-1.el7.elrepo.x86_64 root=UUID=6c39834f-116f-4d6c-9c8a-bd103723cd52 ro crashkernel=auto rhgb quiet LANG=en_US.UTF-8 nouveau.modeset=0 rd.driver.blacklist=nouveau
Build Date: 06 November 2016  12:43:39AM
Build ID: xorg-x11-server 1.17.2-22.el7 
Current version of pixman: 0.34.0
        Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.

xorg.conf , same as readme

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

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:4:0:0"
EndSection

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

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

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

and I added these to /etc/gdm/Init/Default, before the last line “exit 0”

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

nvidia-settings, clicking on advanced does not show any new options
http://i.imgur.com/HTyp6l1.png

external screen always like this
http://i.imgur.com/Bj8aQkV.jpg

/var/log/Xorg.0.log
https://pastebin.com/LZUKm8e1

$ xrandr --listproviders
Providers: number : 2                                                                                                                                           
Provider 0: id: 0x204 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 1 name:NVIDIA-0                                                         
Provider 1: id: 0x47 cap: 0x2, Sink Output crtcs: 3 outputs: 5 associated providers: 1 name:modesetting
$ xrandr -q
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 16384 x 16384                                                                                             
eDP-1-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm                                                                
   1920x1080     60.02*+                                                                                                                                        
   1400x1050     59.98                                                                                                                                          
   1280x1024     60.02                                                                                                                                          
   1280x960      60.00                                                                                                                                          
   1024x768      60.04    60.00                                                                                                                                 
   960x720       60.00                                                                                                                                          
   928x696       60.05                                                                                                                                          
   896x672       60.01                                                                                                                                          
   800x600       60.00    60.32    56.25                                                                                                                        
   700x525       59.98                                                                                                                                          
   640x512       60.02                                                                                                                                          
   640x480       60.00    59.94                                                                                                                                 
   512x384       60.00                                                                                                                                          
   400x300       60.32    56.34                                                                                                                                 
   320x240       60.05                                                                                                                                          
DisplayPort-1-0 disconnected (normal left inverted right x axis y axis)                                                                                         
HDMI-1-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 476mm x 268mm                                                                    
   1920x1080     60.00*+                                                                                                                                        
   1680x1050     59.88                                                                                                                                          
   1280x1024     75.02    60.02                                                                                                                                 
   1440x900      59.90                                                                                                                                          
   1280x960      60.00                                                                                                                                          
   1280x720      60.00  
   1024x768      75.08    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    60.00  
   720x400       70.08  
DisplayPort-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)

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