V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
DoraJDJ
V2EX  ›  Visual Studio Code

如何禁止 VSCode 使用 GPU 渲染(硬件加速)?

  •  
  •   DoraJDJ · 2016-07-08 22:35:16 +08:00 · 9040 次点击
    这是一个创建于 2848 天前的主题,其中的信息可能已经有所发展或是发生改变。

    今天在安利之下试了一下 VSCode ,发现比 Atom 的性能好多了。

    不过我还发现,我每次在使用 Electron 应用(例如 VSCode 还有 Atom )的时候,只要切换到其他应用经常就会卡顿,退出程序的时候还会弹出程序未响应。

    根据上次 Chrome 卡崩 X 服务器的经历,我怀疑 VSCode 默认启用了硬件加速。

    虽然我在上网查找了下,在指令后面添加 --disable-gpu 这个参数后可以禁用硬件加速,但我发现之后创建的其他进程里并没有带上这个参数:

    10767 /usr/share/code/code --disable-gpu
    10769 /usr/share/code/code --type=zygote --no-sandbox
    10823 /usr/share/code/code /usr/share/code/resources/app/out/bootstrap --type=SharedProcess
    10832 /usr/share/code/code --type=renderer --no-sandbox --lang=zh-CN --node-integration=true --background-color=#1E1E1E --num-raster-threads=1 --content-image-texture-target=3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553 --video-image-texture-target=3553 --disable-accelerated-video-decode --disable-gpu-compositing --channel=10767.0.151851640 --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd
    
    [dorajdj@yudachi-bomber code]$ pgrep -a code
    10863 /usr/share/code/code --disable-gpu
    10865 /usr/share code/code --type=zygote --no-sandbox
    10919 /usr/share/code/code /usr/share/code/resources/app/out/bootstrap --type=SharedProcess
    10927 /usr/share code/code --type=zygote --no-sandbox
    10948 /usr/share/code/code /usr/share/code/resources/app/out/bootstrap --type=extensionHost
    10991 /usr/share/code/code /usr/share/code/resources/app/out/bootstrap --type=watcherService
    10993 /usr/share/code/code /usr/share/code/resources/app/out/bootstrap git /home/dorajdj/[已过滤] utf8 /usr/share/code/code
    

    启动的时候鼠标还是会有明显卡顿。

    不知道是什么原因造成的,莫非我的渣配置只能告别 Electron 应用了吗?

    2 条回复    2016-07-09 11:08:21 +08:00
    xiamx
        1
    xiamx  
       2016-07-09 08:32:55 +08:00
    为啥不升级下配置呢
    DoraJDJ
        2
    DoraJDJ  
    OP
       2016-07-09 11:08:21 +08:00 via Android
    @xiamx 破笔记本,我已经觉得没救了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3034 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:13 · PVG 19:13 · LAX 04:13 · JFK 07:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.