Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch VS Code with `--disable-gpu` flag by default

I'm having lag spikes in VS Code because of the hardware acceleration.

How can I get VS Code to always launch with the flag --disable-gpu (when launching from the command line and also from the context menu)?

like image 351
fxlemire Avatar asked May 19 '16 21:05

fxlemire


2 Answers

VSCode 1.40 (Oct. 2019) now has the solution I was looking for!

Disable GPU acceleration

We have heard issue reports from users that seem related to how the GPU is used to render VS Code's UI.
These users have a much better experience when running VS Code with the additional --disable-gpu command-line argument.
Running with this argument will disable the GPU hardware acceleration and fall back to a software renderer.

To make life easier, you can add this flag as a setting so that it does not have to be passed on the command line each time.

To add this flag:

  • Open the Command Palette (Ctrl+Shift+P).
  • Run the Preferences: Configure Runtime Arguments command. This command will open an argv.json file to configure runtime arguments.
    You might see some default arguments there already.
  • Add "disable-hardware-acceleration": true.
  • Restart VS Code.

Note: Do not use this setting unless you are seeing issues!

like image 127
fxlemire Avatar answered Nov 03 '22 17:11

fxlemire


For me, this worked:

Go to properties => compatibility => Run this program in compatibility mode for Windows 7

This issue has been going on for 3 years and still no fix. (https://github.com/Microsoft/vscode/issues/15211)

like image 2
Edwin Feliz Avatar answered Nov 03 '22 16:11

Edwin Feliz