当前位置:网站首页>为什么chrome视频时卡得厉害(by quqi99)
为什么chrome视频时卡得厉害(by quqi99)
2022-07-22 09:01:00 【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
# chrome://gpu/
Canvas: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Out-of-process Rasterization: Hardware accelerated
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Skia Renderer: Enabled
Video Decode: Enabled
Vulkan: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
测试集显和独显
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还算是好的,所以最后回到了它,但它现在也报下列错:
Apr 12 18:08:46 t440p gnome-shell[40666]: Window manager warning: Invalid WM_TRANSIENT_FOR window 0x2c00008 specified for 0x2c00006.
Apr 12 18:08:55 t440p gnome-shell[40666]: message repeated 6 times: [ Window manager warning: Invalid WM_TRANSIENT_FOR window 0x2c00008 specified for 0x2c00006.]
Apr 12 18:09:01 t440p gnome-shell[40666]: gdk_pixbuf_new_from_bytes: assertion 'width > 0' failed
Apr 12 18:09:01 t440p [email protected][40666]: unable to update icon for fcitx-qimpanel
#注:ubuntu-appindicators相关的错误可以在gnome-tweak中将Ubuntu appindicators禁用,或者
gnome-extensions disable [email protected]
话说,在切换成deepin时遇到一个坑,我在ubuntu20.04一直是使用hwe最新kernel的,换到deepin后遇到下列错误:
[email protected]:~$ /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-dde
deb [by-hash=force] http://packages.deepin.com/deepin lion main contrib non-free
deb-src http://packages.deepin.com/deepin lion main contrib non-free
sudo 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-desktop
ubuntu 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 [email protected]
- gedit支持最近打开的文件 - gsettings set org.gnome.desktop.privacy remember-recent-files true
- 设置微软字体
sudo apt-get install --reinstall ttf-mscorefonts-installer
sudo apt-get install xfonts-wqy #文泉驿-点阵宋体
sudo apt-get install ttf-wqy*kk #文泉驿正黑
sudo fc-cache -f -s -v #刷新字体缓存
# 打开gnome-tweak为gnome desktop选择使用文泉驿等宽字体
sudo apt-get install gnome-tweak-tool font-manager gnome-tweak
# 也在chrome设置中搜索“字体”为chrome设置微软字体
# 或使用Stylish将字体设置为Microsoft YaHei, 见:https://blog.csdn.net/pyufftj/article/details/80712303
- 安装一些gnome plugin, 并在gnome-tweak的插件, 并安装农历插件
sudo apt install gnome-shell-extensions
sudo apt install chrome-gnome-shell
先安装依赖(apt install gir1.2-lunar-date-2.0),再安装农历插件https://extensions.gnome.org/extension/675/lunar-calendar/ ,最后需设置ubuntu语言为中文农压显示才不会乱码。
- 其他
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
边栏推荐
- arguments
- "Review of software engineering in Wuhan University of technology" Chapter III software requirements
- The MySQL password is correct, but the startup error is unable to create initial connections of pool Access denied for user ‘root‘@‘localhost
- 开源dns软件PowerDNS BIND9 mydns
- 力扣解法汇总1089-复写零
- 关于scrollTo滚动offsetTop到顶部的距离的bug找了两个小时
- Internet download manager2022 trial (IDM for short)
- Understand relevant concepts of prosody. XMPP, jabber, bosh, etc
- 力扣解法汇总676-实现一个魔法字典
- 女嘉宾报名
猜你喜欢
Lesson 12 MySQL high availability component MHA
"Review of software engineering in Wuhan University of technology" Chapter 6 | coding specification
C # entry series (XXVII) -- Brief Analysis of LINQ
文件描述符的复制
Dr. water
「武汉理工大学 软件工程复习」第二章 | 软件过程模型
Understanding of continue in C language (fishing_1)
【Rust】我该用什么软件开发 Rust | 常用支持 Rust 的编辑器推荐
Use of content model and content collection for dynamic data processing of applet CMS
Installation and introduction of Lin UI component library of wechat applet - Advanced
随机推荐
H5在移动端上禁止缩放
"Review of software engineering in Wuhan University of technology" Chapter 6 | coding specification
QT notes - unpolish() and polish() of QT dynamic attributes
Geowebcache publishes ArcGIS slice data
Date对象简介
力扣解法汇总522-最长特殊序列 II
Reflection + annotation + generics
一线互联网P7面试题总结---补充中
Rocky基础练习题-shell脚本-1
MySQL密碼正確但是啟動報錯Unable to create initial connections of pool.Access denied for user ‘root‘@‘localhost
A survey of network defense decision-making methods based on attack defense game
MySQL修改密码不成功(无效)的解决办法
Internet download manager2022 trial (IDM for short)
Vim编辑器常用快捷方式
Computer network learning notes 7-tcp programming process and interview questions
主动降噪耳机排行榜10强,主动降噪耳机十大品牌
力扣解法汇总1108-IP 地址无效化
Fabric.js 控制元素层级
Using pypyodbc in Ubuntu cannot connect to SQL Server
About the external entity key operation spinbox control in stemwin (fishing_2)