一半君的总结纸

听话只听一半君

Nvidia propreitery driver Offloading Graphics Display with RandR 1.4 on Thinkpad T450S

如果使用之前的bumblebee, maya 2016以上不是打不开就是viewport看不到,所以只好换官方驱动

已放弃,最后换了Fedora25

根据官方说明,系统需求如下

      X.Org X server version 1.13 or higher.
      A Linux kernel, version 3.13 or higher, with CONFIG_DRM enabled.
      Version 1.4.0 of the xrandr command-line utility.

看了下系统,不是所有条件都满足,所以

安装kernel 4.4

yum --enablerepo=elrepo-kernel install kernel-lt

编辑 /etc/grub2.cfg 在 kernel 命令行后面加上

nouveau.modeset=0 rd.driver.blacklist=nouveau

/etc/X11/xorg.conf

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

此外 /etc/gdm/Init/Default 里在最后一行 “exit 0” 之前加上

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

到这里已经完全正常了,maya 2017正常开启,唯一失败之处是通过mini DP->DVI的外接显示器不正常,可以看到kde启动画面,但之后就一直定在那里,笔记本屏幕一切正常

下面乱搞试试
尝试从 fedora srpm 编译最新版 xorg-x11-drv-intel, 下载地址 https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/source/tree/Packages/x/


yum install xorg-x11-server-devel libXtst-devel libXvMC-devel libXfont-devel libudev-devel xcb-util-devel libXScrnSaver-devel

rpm -i ./xorg-x11-drv-intel-2.99.917-28.20160929.fc26.src.rpm

cd ~/rpmbuild/SPECS/
rpmbuild -ba xorg-x11-drv-intel.spec

before that

git://anongit.freedesktop.org/xorg/util/macros
cd macros/
./autogen.sh 
./configure
make install

就算自己装macros也不行 … 总之没法用新版的intel驱动

ps:

  • lz的笔记本的显卡配置
    $ lshw -numeric -C display
      *-display                 
           description: VGA compatible controller
           product: HD Graphics 5500 [8086:1616]
           vendor: Intel Corporation [8086]
           physical id: 2
           bus info: pci@0000:00:02.0
           version: 09
           width: 64 bits
           clock: 33MHz
           capabilities: msi pm vga_controller bus_master cap_list rom
           configuration: driver=i915 latency=0
           resources: irq:46 memory:f0000000-f0ffffff memory:e0000000-efffffff ioport:4000(size=64)
      *-display
           description: 3D controller
           product: GM108M [GeForce 940M] [10DE:1347]
           vendor: NVIDIA Corporation [10DE]
           physical id: 0
           bus info: pci@0000:04:00.0
           version: a2
           width: 64 bits
           clock: 33MHz
           capabilities: pm msi pciexpress bus_master cap_list
           configuration: driver=nvidia latency=0
           resources: irq:51 memory:f1000000-f1ffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:3000(size=128)
    
  • lz的xorg满足要求
    $ xrandr -v
    xrandr program version       1.4.3
    Server reports RandR version 1.4
    
    $ 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.
    
  • lz先试了下最新的 4.10 kernel,结果nvidia驱动装一半会失败,少个linux/fence.h,所以只能等下个版本的Nvidia驱动了
    $ yum --enablerepo=elrepo-kernel --showduplicates list kernel-ml
    Loaded plugins: fastestmirror, langpacks, nvidia
    Loading mirror speeds from cached hostfile
     * base: mirror2.evolution-host.com
     * elrepo: ftp.osuosl.org
     * elrepo-kernel: ftp.osuosl.org
     * epel: mirrors.kernel.org
     * extras: mirror2.evolution-host.com
     * updates: mirror2.evolution-host.com
    epel/x86_64/primary_db                                                                                                                                                 | 4.6 MB  00:00:06     
    Available Packages
    kernel-ml.x86_64    4.10.5-1.el7.elrepo    elrepo-kernel
    kernel-ml.x86_64    4.10.6-1.el7.elrepo    elrepo-kernel
    

    所以lz装的是 kernel-lt 4.4 按说明是 只要>3.13就行

    $ yum --enablerepo=elrepo-kernel --showduplicates list kernel-lt
    Loaded plugins: fastestmirror, langpacks, nvidia
    Loading mirror speeds from cached hostfile
     * base: mirror.esecuredata.com
     * elrepo: ftp.osuosl.org
     * elrepo-kernel: ftp.osuosl.org
     * epel: mirrors.kernel.org
     * extras: mirror.esecuredata.com
     * updates: mirror.esecuredata.com
    Installed Packages
    kernel-lt.x86_64    4.4.57-1.el7.elrepo    @elrepo-kernel
    Available Packages
    kernel-lt.x86_64    4.4.56-1.el7.elrepo    elrepo-kernel 
    kernel-lt.x86_64    4.4.57-1.el7.elrepo    elrepo-kernel 
    
  • 如果启动失败,进不了x,可以 在出现grube菜单的时候按e, 编辑kernel命令行 最后加个3,然后ctrl+x 临时进入, 如果需要测试自行运行 startx
    可以

    systemctl set-default multi-user.target
    
    # 恢复图形界面模式
    systemctl set-default graphical.target
    

links:
How to Upgrade Linux Kernel to Stable 3.18.4 on CentOS 7.x
Chapter 32. Offloading Graphics Display with RandR 1.4

How to get information about graphics card (GPU) on Linux
375.39 does not build on kernel 4.10

Rebuild a Source RPM – CentOS wiki
Turn off screen panning – Linux Mint Forums
bug #326688 Can’t disable panning on multiple monitors
I have finally found a way to sort out screen tearing on Nvidia with Linux
How to automatically set up external monitor
thinkpad t450s optimus geforce 940m dual monitor freezing centos 7 with 375.39
Can’t disable panning on external HDMI display, on Optimus Laptop with GeForce GTX 870M
How To Setup Dual Monitors With XRandR

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: