How can I disable GPU rendering in Visual Studio Code

Note that VSCode 1.40 (Oct. 2019) proposes an alternative to the parameter/flag --disable-gpu:

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 a 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!


Under Windows, I can confirm that launching VSCode with --disable-gpu does not create a GPU process:

C:\Users\alex\AppData\Local\Code\app-0.1.0>Code.exe --disable-gpu

Perhaps the same flag works on Linux too?


On Ubuntu, the file to edit is /usr/share/applications/code.desktop.

Change:

Exec=/usr/share/code/code --unity-launch %F

to:

Exec=/usr/share/code/code --disable-gpu --unity-launch %F


For Windows users

Visual studio code is based on chrome, to make it work you'll have to disable hardware acceleration.

Add --disable-gpu --disable-gpu-compositing to the vs code shortcut on your desktop.

enter image description here

Example:

"C:\Program Files (x86)\Microsoft VS Code\Code.exe" --disable-gpu --disable-gpu-compositing

Inside settings.json you can write this:-

"terminal.integrated.gpuAcceleration": "off"