为什么chrome视频时卡得厉害(by quqi99)
作者:張華 發表于:2021-04-08
版權聲明:可以任意轉載,轉載時請務必以超鏈接形式標明文章原始出處和作者信息及本版權聲明
禁用Meltdown/Spectre提升CPU性能
長時間困繞的一個問題終于解決了,t440p用chrome開會時總是卡得厲害,網上搜索都是說GPU的問題。其實不是,是因為Meltdown/Spectre的補丁造成的CPU性能急劇下降。禁用它之后問題就消失了。
Linux的禁用方法是在grub中添加:mitigations=off
Windows可以使用inspectre來禁用它 - https://www.grc.com/inspectre.htm
GPU加速視頻解碼
當然,如果你的GPU夠好,還可以設置硬解碼, 見: https://my.oschina.net/chipo/blog/3030388
注:參照上面網頁使用了‘ppa:saiarcot895/chromium-dev’提供的一些包之后,很多desktop都報一個opengl相關的錯誤(https://bbs.archlinux.org/viewtopic.php?id=265026), 查找了好幾天,最后證明和這些包有關系(vdpauinfo libvdpau-va-gl1 vdpau-driver-all mesa-vdpau-drivers libvdpau1), 刪除ppa從ubuntu官方庫重新安裝即可。
我的機器的GPU不行,打開了Video Decode并通過“–use-gl=desktop“啟動時就卡,但不以–use-gl啟動似乎就好多了(但打開Video Decode)。
chrome://flags/#ignore-gpu-blocklist
chrome://flags/#enable-accelerated-video-decode
測試集顯和獨顯
t440p的顯卡(集顯是HD 4600, 獨顯是Nvidia GT730m)性能究竟如何,用下列方法測試:
sudo apt-get install glmark2 glmark2 --fullscreen --show-all-options結果是:
- nvidia 422分 - sudo prime-select nvidia
- intel 415分 - sudo prime-select intel
- 禁用nvidia驅動 411分 - rdblacklist=nouveau i965.modeset=1 nouveau.modeset
- 網上也有一個排名 - https://technical.city/zh/video/rating?pg=4#result128
升級CPU
下一步,將t440p自帶的i5-4200M升級到i7-4700mq, 集顯升級后沒有變化還是Intel HD Graphics 4600, 但cpu提升了(i7-4700mq的功耗是47w, i5-4200M是37w, i5-4200M是兩核四線程,7-4700mq是四核八線程,最大頻率也是3.1提到3.4),理論上應該能再減輕卡的問題,見:https://www.cpubenchmark.net/compare/Intel-i5-4200M-vs-Intel-i7-4700MQ/2016vs1923
測試一系列desktop
ubuntu 20.04默認使用的是gnome 3, 但syslog總是看到下列錯誤:
libinput error: client bug: timer event25 debounce short: scheduled expiry is in the past (-14ms), your system is too slow換成deepin錯誤依舊:
Apr 9 19:52:16 t440p com.deepin.daemon.Accounts[2635]: libinput error: client bug: timer event25 debounce short: scheduled expiry is in the past (-14ms), your system is too slow接著再換成ubuntu-budgie但它的dock總是出一些問題不知道怎么描述,
最后又換回kde, kde剛開始感覺很爽,但用了一兩天發現chrome cpu也忽然升高風扇老轉一會自己又恢復,不清楚什么原因。
沒一個桌面是好用的,相比之前ubuntu-desktop還算是好的,所以最后回到了它,但它現在也報下列錯:
話說,在切換成deepin時遇到一個坑,我在ubuntu20.04一直是使用hwe最新kernel的,換到deepin后遇到下列錯誤:
hua@t440p:~$ /usr/bin/deepin-anything-monitor [2021-04-09, 16:53:33.874] [default-critical] [deepin_anything_server::Server::run: 54]: Failed on open: /proc/vfs_changes "No such file or directory"這是由于hwe的版本太高導致無法安裝deepin-anything-dkms造成的, 所以切回5.4.0-65內核后用下列方法安裝成功
sudo add-apt-repository ppa:ubuntudde-dev/stable sudo apt install ubuntudde-dde -y sudo dpkg-reconfigure lightdm sudo apt remove startdde ubuntudde-ddedeb [by-hash=force] http://packages.deepin.com/deepin lion main contrib non-free deb-src http://packages.deepin.com/deepin lion main contrib non-freesudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 425956BB3E31DF51 sudo apt install linux-headers-$(uname -r) linux-tools-$(uname -r) -y sudo apt install deepin-anything-dkms dde-file-manager ubuntudde-dde deepin-anything-server ubuntudde-desktop ubuntudde-dde-extras -y sudo apt install deepin-anything-server deepin-anything-server-dev deepin-anything-libs deepin-anything-dkms deepin-anything-dev -y sudo apt reinstall deepin-anything-dkms安裝KDE
sudo apt install kubuntu-desktop kde-standard安裝Ubuntu desktop, 并使用gnome-tweaks設置ubuntu dock為始終顯示
sudo apt install --reinstall ubuntu-desktopubuntu desktop沒什么負載時報下列問題,難道是cpu要清灰啦?
Apr 10 08:26:37 t440p kernel: [37334.508417] mce: CPU1: Core temperature above threshold, cpu clock throttled (total events = 36350) Apr 10 08:26:37 t440p kernel: [37334.508420] mce: CPU0: Core temperature above threshold, cpu clock throttled (total events = 36348) Apr 10 08:26:37 t440p kernel: [37334.508424] mce: CPU3: Package temperature above threshold, cpu clock throttled (total events = 43764)安裝gnome 3
sudo apt install gnome-session gdm3 -y安裝ubuntu-budgie
sudo apt install ubuntu-budgie-desktop #sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm #sudo apt autoremove #sudo apt install --reinstall gdm3可能更順暢一點的是manjaro kde,并不想重裝,放棄!
總結
如何擁有一個順暢的ubuntu辦公環境:
- GPU加速都打開,升級 chrome到最新89版本,這個里面有那個patch, 所以不要使用ppa:saiarcot895/chromium-dev
- 使用mitigations=off,并從i5升級到了i7
- 使用gnome,不使用kde, ubuntu desktop, deepin等其他桌面,試來試去還是gnome最好用
- 使用wayland不使用xorg, 因為有兩個顯示器使用wayland支持只共享單個屏幕 (注:wayland還是bug太多,共享單個屏幕是黑的)
- 使用lightdm不使用gdm, 因為wayland+gdm3組合會造成在chrome經常復制時hang在那,另外使用 gdm3在t440p上經常會發生login loop的問題(在臺式機上因一個問題卻只能使用gdm3,忘了什么問題了)
- 禁用gnome ubuntu-appindicators plugin, 這個插件在syslog里報錯太多。gnome-extensions disable ubuntu-appindicators@ubuntu.com
- gedit支持最近打開的文件 - gsettings set org.gnome.desktop.privacy remember-recent-files true
- 設置微軟字體
- 安裝一些gnome plugin, 并在gnome-tweak的插件, 并安裝農歷插件
- 其他
Reference
[1] https://blog.csdn.net/quqi99/article/details/54950383
[2] https://blog.csdn.net/quqi99/article/details/98235190
[3] https://blog.csdn.net/quqi99/article/details/25320181
總結
以上是生活随笔為你收集整理的为什么chrome视频时卡得厉害(by quqi99)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 笔记(数据库)
- 下一篇: Maven仓库管理器-Nexus