Thinkpad T440p安装Linux的种种问题(by quqi99)

作者:张华  发表于:2014-05-08
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明

(http://blog.csdn.net/quqi99 )

Thinkpad T440p里使用了一些最新的硬件,这些硬件厂商对Linux高度不兼容, 下面是安装ubuntu 14.04与win8双系统时遇到的一些问题。
1, 要在BIOS(F1键)里disable掉UEFI Security Boot特性, 之前按F12选usb进行安装。

    注:当无法进grub选择菜单时,若是bios可按shift启动,若是uefi可按esc启动(若一直按着esc并不会进grub菜单而是进grub CLI, 所以实际是在提示按enter键时按一下esc键).20220308遇到了这么一个问题,grub-install默认设置了GRUB_DEFAULT=2, 这个第2个grub item刚好是'UEFI Firmware Settings'所以就造成开机反复进入UEFI而不是grub, 通过这里说的按ESC键可进入grub来修复.
   UEFI是下一代的BIOS,它内操置了一些操作系统的公钥,操作系统要用私钥签名,UEFI硬件用公钥检测操作系统的完整性,可信才加载系统。
本来是一个很好的技术,但是被微软给滥用了。微软先强制将它自己的公钥加到UEFI DB中,然后再要求厂商预安装Win8之后强制厂商将UEFI Security Boot特性打开,这样就无法安装其他没有公钥的操作系统了,然后强制其它厂商向微软申请公钥,也不允许用户自定义公钥文件。对于一些支持win8的移动硬件,微软甚至都强制不提供disable UEFI Security Boot的开关界面。
2, Thinkpad T440p使用了Realtek公司的rtl8192ee 10ec:818b网卡,
   root@laptop:/home/hua# lspci -nn |grep Wireless
   04:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8192EE PCIe Wireless Network Adapter [10ec:818b]
   Realtek公司却没有提供相应的Linux驱动(附录一是一个极不稳定的驱动,基本没法用),也就是目前:
   有固件:/lib/firmware/rtlwifi/rtl8192eefw.bin
   但无驱动:/lib/modules/3.13.0-24-generic/kernel/drivers/net/wireless/rtlwifi/rtl8192ee/rtl8192ee.ko
   Realtec公司的rtl8192ee驱动将出现在linux 3.16版本的内核里,3.16内核目前还没有出,实在没办法解决,只好先又买了个TL-WN725N USB无线网卡对付着用。
3, Thinkpad T440p除了主板里的集成显卡以外,还有一个nvidia的显卡,默认使用的是开源的bumblebee驱动,我遇到的会造成这两种问题:
   一是例如执行lspci命令之后都会造成所有的usb设备都无法用,如usb网卡,如usb数标。
   二是由于acpi call失败造成无法正常关机,且每次造成磁盘数据损坏导致在开机时需要修复

   三是合上电脑再打开桌面消失

   四是发热厉害

   五是不安装它可能启动ubuntu不成功,需要在grub中临时将quiet splash改成nomodeset即可,将nvidea驱动安装后就不需要了。
   网上有人遇到了和我一样的问题,见:https://github.com/Bumblebee-Project/bbswitch/issues/78,但它的办法是在仍然用bumblebee驱动的前提下寻求解决(见附录二),我是直接安装nvidia linux驱动(值得一提的是,nvidia也是一个起初对linux极不友好的一家公司,linux之父在公开场合还曾经骂地这家公司,见:http://www.ithome.com/html/it/19249.htm,但是现在居然有nvidia linux驱动了,赞一个)。
  sudo apt-get purge bumblebee*
  sudo apt-get purge libvdpau-va-gl12  sudo apt-get install nvidia-319 nvidia-settings-319 nvidia-prime

20140709更新:

安装nvidia驱动后在移动电脑时桌面lightadm很容易死,可进控制台(ctrl + alt + f1)后通过apport-cli命令收集日志,或者查看/var/crash的相关日志发现是lightadm crash了,现在的做法是禁用掉nvidia的一切驱动,切换到intel的集成显卡,在/etc/default/grub中更新下列一行,然后更新grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash rdblacklist=nouveau i965.modeset=1 nouveau.modeset"

另外我也更新了kernel到3.14.1-031401-generic



附录一,目前极不稳定的一个rtl8192ee linux驱动
参考:http://ubuntuforums.org/showthread.php?t=2198221
wget http://netbook-remix.archive.canonical.com/updates/pool/public/o/oem-wireless-rtl-92ce-92se-92de-8723ae-88ee-8723be-92ee-dkms/oem-wireless-rtl-92ce-92se-92de-8723ae-88ee-8723be-92ee-dkms_0017.1016.2013~sutton1.tar.gz
sudo modprobe rtl8192ee
sudo modprobe -rv rtl8192ee
sudo modprobe -v rtl8192ee swenc=1 fwlps=0 ips=0


附录二,仍使用开源的nvidia驱动nouveau的前提下解决acpi问题
git clone https://github.com/mkottman/acpi_call
cd acpi_call
make
sudo cp acpi_call.ko /lib/modules/`uname -r`/kernel/drivers/acpi
sudo depmod -a
sudo modprobe acpi_call
Create a script with the following in it (e.g. at /usr/local/bin/disable_nvidia.sh, remember chmod +x it):
#!/bin/sh
echo "\_SB.PCI0.PEG.VID._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}" >/proc/acpi/call
echo "\_SB.PCI0.PEG.VID.GPOF" >/proc/acpi/call
exit 0
Call the script from /etc/rc.local
Add rdblacklist=nouveau i965.modeset=1 nouveau.modeset to the GRUB_CMDLINE_LINUX_DEFAULT flags in /etc/default/grub, also for full KVM support (e.g. better brightness control etc.) I've found adding acpi_osi=\"!Windows 2012\" helps too.
run sudo update-grub

2014-06-21更新:

解决办法已经出来了,见

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1239578

2014-07-29更新

有些型号的机器即使像上面disable UEFI Security Boot特性也是安装不了的,那是因为遇到了一个UEFI的bug,原因如下:

Some EFI-based computers, including some HPs, have broken EFIs that
don't accept anything but the fallback boot loader
(EFI/boot/bootx64.efi on the EFI System Partition) or the Windows boot
loader (EFI/Microsoft/boot/bootmgfw.efi on the ESP). If yours suffers
from this defect, you'll need to copy EFI/ubuntu/grubx64.efi (or
EFI/ubuntu/shimx64.efi, if Secure Boot is active) to one or both of
those names. (If Secure Boot is active, also copy
EFI/ubuntu/grubx64.efi to the same directory where you copy GRUB, but
keep its filename as grubx64.efi).

Note that I'm assuming you're doing an Ubuntu-only installation. If
you want to dual-boot with Windows, you've got to copy ITS boot loader
to another name and tweak GRUB to find Windows there. This starts to
get complex, so the Boot Repair tool
(Boot-Repair - Community Help Wiki) may be helpful. It's
got an option to do all this on its Advanced page.

Alternatively, you could install  rEFInd
(http://www.rodsbooks.com/refind) to one of those "magic" locations --
but the installation script won't install there by default, so you'll
need to do it manually or juggle filenames afterwards. (The
mvrefind.sh script can help with that.)

2014-12-01更新:

现在ubuntu 14.10默认的内核版本里已经有该网卡的驱动了,我已经用上了,挺好使的。见: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1239578


2015-03-02更新, 解决一crash问题

之前一直感觉系统容易忽然死机,可能一周一次,没去管它。但今天居然邪门到一个小时内死机6次,不得不深度介入了。根据观察,感觉是Chrome的时候容易死,使用“watch sensors” (需安装sudo dpkg -l |grep sensors 软件包)查看cpu温度在打开chrome之非常容易从56度升到八十几度。于是,不启动chrome,观察两小时,ok,不死机。于是google关键字"ubuntu 14.10 chrome crash", 非常幸运,找到一个bug (https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/1377220 ),原来是chrome新增加了一个根据gpu加速的新特性,针对intel gpu加速不了,退到软加速了,从而导致全局crash的问题。解决办法:修改文件/usr/share/applications/google-chrome.desktop, 将"Exec=/usr/bin/google-chrome-stable"修改成” Exec=env LIBGL_DRI3_DISABLE=1 /usr/bin/google-chrome-stable"即可。

2015-03-03, 像上面那样修改之后,使用htop命令还能看到chrome时不时有gpu字眼的进程蹦出来,这时候温度会上升,于是升级了内核为3.40版本,Index of /~kernel-ppa/mainline/daily/current

20180216更新 - 禁用蓝牙键盘的休眠功能

debian - bluetooth mouse disconnects - Unix & Linux Stack Exchange

sudo sed -i 's/#IdleTimeout=30/IdleTimeout=0/' /etc/bluetooth/input.conf

#$ cat /etc/udev/rules.d/91-local.rules
#ACTION=="add", SUBSYSTEM=="bluetooth", ATTR{product}=="Microsoft Bluetooth Mouse        ", ATTR{power/control}="on"

#sudo udevadm control --reload-rules

sudo apt-get install pulseaudio-module-bluetooth
killall pulseaudio
rfkill list
rfkill unblock xx

20180822更新 - chrome花屏问题

昨晚将ubuntu 16.04升级到ubuntu 18.04之后, 今早发现使用chrome时有轻微花屏, 网上搜索了好多网页都不能解决问题, 最后发现了这个网页(ubuntu14.04--解决Chrome浏览器花屏问题_lsyAndroid的专栏--解决实际开发中自己遇到的问题-CSDN博客)解决了问题. 即在chrome的高级设置中将'Use hardware acceleration when available'前的勾去掉.

20181017更新 - IBM小红点TrackPoint休眠后左键失效问题

注: 其实下面的方法一个也不使, 真正解决问题的是这条命令: 

gsettings set org.gnome.desktop.peripherals.touchpad click-method disabled

自从将Ubuntu从16.04升级到18.04之后, 在电脑休眠之后会发现小红点左键失效, 今天终于解决这个头疼的问题. 方法如下:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1791427
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1788928

1, comment the line 'blacklist i2c_i80' from the file /etc/modprobe.d/blacklist.conf due to the lp bug #1786574

2, configure the management tool tlp not to autosuspend usb
$ grep -r 'USB_AUTO' /etc/default/tlp 
USB_AUTOSUSPEND=0
USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1

3, upgrade libinput from the page https://launchpad.net/ubuntu/+source/libinput
wget https://launchpad.net/ubuntu/+archive/primary/+files/libinput-bin_1.12.1-1_amd64.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/libinput10_1.12.1-1_amd64.deb
sudo dpkg -i libinput*

4, https://bugzilla.redhat.com/show_bug.cgi?id=1560723

$ sudo chmod 755 /lib/systemd/system-sleep/trackpad
$ cat /lib/systemd/system-sleep/trackpad
#!/bin/sh
if [ "${1}" == "post" ]; then
  echo -n none > /sys/devices/platform/i8042/serio1/drvctl
  sleep 1
  echo -n reconnect > /sys/devices/platform/i8042/serio1/drvctl
fi

5, https://medium.com/@pck/ubuntu-18-04-fix-for-right-click-not-working-touchpad-issues-40037ff249e1
sudo apt install gnome-tweak-tool
$ gsettings get org.gnome.desktop.peripherals.touchpad click-method
'fingers'
gsettings set org.gnome.desktop.peripherals.touchpad click-method disabled
It equals run the command 'gnome-tweaks', navigate to the “Keyboard & Mouse” sub-menu in the left menu, and select “Area” from the the touchpad’s “Click Emulation” menu in the right side panel. 
Also configure Touchpad disable when typing - https://askubuntu.com/questions/1052665/touchpad-not-getting-disabled-while-typing-on-thinkpad-e450-with-ubuntu-18-04

20201107更新

chrome上网慢用fast.com测速在30K到18M之间不稳定,而用firefox总有69M,但重启机器后,chrome恢复到94M左右。

20210201更新

机器太慢,报:

Feb 1 09:36:48 t440p gnome-shell[3675]: libinput error: client bug: timer event25 debounce: scheduled expiry is in the past (-6ms), your system is too slow

perf data显示它和chrom有关,故设置:

chrome://settings/?search=hardware selects 'Use hardware acceleration when available'
chrome://flags/#disable-accelerated-video-decode selects 'Hardware-accelerated video decode'

但上面没解决问题,真正解决问题的是disable GPU

https://blog.csdn.net/weixin_39726131/article/details/111653527

chrome://settings/?search=hardware uncheck 'Use hardware acceleration when available'
chrome://flags/ search 'gpu' then disable 'Accelerated 2D canvas'  and 'GPU rasterization'

shift + esc to see chrome task

Chrome 浏览器默认开启了“GPU 渲染”的特性,当开启了硬件加速选项之后,所有的 WEB 网页内容都会使用显卡 GPU 来进行解析渲染, 当GPU性能不好时反而慢,不如直接使用CPU

20210202更新 - GPU问题总结

shift + esc打开看到GPU Process在开hangout时cpu超100%,另外风扇响个不停(cpu温度从70多升到80多),这都是gpu性能差但chrome又强制打开了gpu硬件加速造成的,关闭gpu加速即可。

chrome 使用gpu 加速_解决Chrome假死问题_weixin_39866974的博客-CSDN博客

1, 打开chrome://flags/ 搜索GPU,disable掉所有和GPU相关的设置

2,在/usr/share/applications/google-chrome.desktop中添加参数:--disable-gpu --disable-software-rasterizer

20210224改用回到旧版本83.0.4103.116-1

wget https://www.slimjet.com/chrome/download-chrome.php?file=files%2F83.0.4103.116%2Fgoogle-chrome-stable_current_amd64.deb
apt-cache policy google-chrome-stable
chrome://flags/   #search 'gpu' then reset all setting
sudo rm -rf /etc/apt/sources.list.d/google-chrome.list*  #disable auto update

20210407更新 - 进一步解决GPU问题

即使从(chrome://flags)搜索打开了所有GPU设置,但从这里( chrome://gpu/ )看到的Video Decode依然是'Software only. Hardware acceleration disabled'
1, chrome88之前的版本不支持,见-https://www.omgubuntu.co.uk/2018/10/hardware-acceleration-chrome-linux
2, 自chrome88版本支持了 - https://www.linuxuprising.com/2021/01/how-to-enable-hardware-accelerated.html

1, 打开下列设置

chrome://flags/#ignore-gpu-blocklist
chrome://flags/#enable-accelerated-video-decode

2, 安装VA-API Driver用来解码视频
需要引入这个patch - https://chromium-review.googlesource.com/c/chromium/src/+/532294

a, 从这里PPA安装libvdpau - https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
目前安装的是1.3-1ubuntu2, 所以下载:
http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu/pool/main/libv/libvdpau/libvdpau1_1.4-2~ubuntu20.04.1_amd64.deb

b, 从这里个PPA安装vdpau-va-driver - http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu/pool/main/libv/libvdpau/
目前安装的是0.7.4-6ubuntu1,所以下载:
http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu/pool/main/v/vdpau-video/vdpau-va-driver_0.7.4-7ubuntu1~ppa2~20.04.1_amd64.deb

c, 安装最新的nvidia驱动

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt install -y libvulkan1 libvulkan-dev mesa-vulkan-drivers
sudo apt install -y libva-drm2 libva-x11-2 
sudo ubuntu-drivers autoinstall
sudo prime-select nvidia
prime-select query

3, Launch the web browser using the --use-gl=desktop flag to enable VA-API hardware acceleration.

google-chrome-stable --use-gl=desktop

或修改/usr/share/applications/google-chrome.desktop
Exec=/usr/bin/google-chrome-stable --use-gl=desktop

另外:注意在chrome://flags检查没有enable Vulkan

4, 设置GOVERNOR="performance"

sudo cpupower -c all frequency-set -g performance
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
sudo systemctl restart cpufrequtils
sudo systemctl disable ondemand

5, 调试,用top命令看进程,在chrome上用shift+esc看chrome里的线程

但这样CPU下去了但视频还是卡得厉害, 
所以将--use-gl=desktop去掉,这样视频顺畅一些了但CPU又上去了,当然此时还是有--enable-features=VaapiVideoDecoder的

6, 另外,关闭mitigations=off提升性能, 同时关闭nokaslr避免调试困难(地址乱序,addr2line不好解)
GRUB_CMDLINE_LINUX_DEFAULT="elevator=noop psmouse.synaptics_intertouch=1 mitigations=off nohpet nokaslr"

Reference

[1] 为什么chrome视频时卡得厉害(by quqi99)_技术并艺术着-CSDN博客

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 20
    评论
评论 20
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

quqi99

你的鼓励就是我创造的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值