vscode: VSCode stopped opening - The GPU process has crashed

Does this issue occur when all extensions are disabled?: yes

  • VS Code Version: Insiders 1.67.0.0 and 1.66.0.0
  • OS Version: Microsoft Windows 10 1803 OS build 17134.2208

Steps to Reproduce: unknown, VS Code started crashing on start randomly and keeps crashing after reinstallation and system restart.

Here’s the output from .\code-insiders --verbose --log debug --disable-extensions

[main 2022-03-31T18:58:40.742Z] [File Watcher (node.js)] Request to start watching: c:\Users\localuser\AppData\Roaming\Code - Insiders\User (excludes: <none>, includes: <all>),c:\Users\localuser\AppData\Roaming\Code - Insiders\User\settings.json (excludes: <none>, includes: <all>)
[main 2022-03-31T18:58:40.773Z] Starting VS Code
[main 2022-03-31T18:58:40.773Z] from: c:\Users\localuser\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app
[main 2022-03-31T18:58:40.773Z] args: {
  _: [],
  diff: false,
  add: false,
  goto: false,
  'new-window': false,
  'reuse-window': false,
  wait: false,
  help: false,
  'list-extensions': false,
  'show-versions': false,
  'pre-release': false,
  version: false,
  verbose: true,
  log: 'debug',
  status: false,
  'prof-startup': false,
  'no-cached-data': false,
  'prof-v8-extensions': false,
  'disable-extensions': true,
  'disable-gpu': false,
  'ms-enable-electron-run-as-node': false,
  telemetry: false,
  debugRenderer: false,
  logExtensionHostCommunication: false,
  'skip-release-notes': false,
  'skip-welcome': false,
  'disable-telemetry': false,
  'disable-updates': false,
  'disable-keytar': false,
  'disable-workspace-trust': false,
  'disable-crash-reporter': false,
  'crash-reporter-id': '058d47ce-d8d0-4a63-b37b-79030020e5da',
  'skip-add-to-recently-opened': false,
  'unity-launch': false,
  'open-url': false,
  'file-write': false,
  'file-chmod': false,
  'driver-verbose': false,
  force: false,
  'do-not-sync': false,
  trace: false,
  'force-user-env': false,
  'force-disable-user-env': false,
  'open-devtools': false,
  __sandbox: false,
  'no-proxy-server': false,
  'no-sandbox': false,
  nolazy: false,
  'force-renderer-accessibility': false,
  'ignore-certificate-errors': false,
  'allow-insecure-localhost': false,
  'disable-dev-shm-usage': false,
  logsPath: 'C:\\Users\\localuser\\AppData\\Roaming\\Code - Insiders\\logs\\20220331T205840'
}
[main 2022-03-31T18:58:40.776Z] Resolving machine identifier...
[main 2022-03-31T18:58:40.777Z] Resolved machine identifier: 0e52bb2c9ce3e4a73c11248900ce3073302db7fb87a859dde7d3489fda7d6dc9
[main 2022-03-31T18:58:40.780Z] Main->SharedProcess#connect
[26408:0331/205840.794:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205840.794:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 1 time(s)
[main 2022-03-31T18:58:40.802Z] [File Watcher (node.js)] Error: ENOENT: no such file or directory, stat 'c:\Users\localuser\AppData\Roaming\Code - Insiders\User\settings.json'
[main 2022-03-31T18:58:40.807Z] [File Watcher (node.js)] Started watching: 'c:\Users\localuser\AppData\Roaming\Code - Insiders\User'
[main 2022-03-31T18:58:40.809Z] StorageMainService: creating global storage
[main 2022-03-31T18:58:40.821Z] lifecycle (main): phase changed (value: 2)
[main 2022-03-31T18:58:40.826Z] windowsManager#open
[main 2022-03-31T18:58:40.827Z] windowsManager#open pathsToOpen [ [Object: null prototype] {} ]
[main 2022-03-31T18:58:40.828Z] windowsManager#doOpenEmpty {
  restore: false,
  remoteAuthority: undefined,
  filesToOpen: undefined,
  forceNewWindow: false
}
[main 2022-03-31T18:58:40.831Z] IPC Object URL: Registered new channel vscode:371ae0ee-d0b5-4022-b265-41a2a3e1a2c9.
[main 2022-03-31T18:58:40.832Z] window#validateWindowState: validating window state on 1 display(s) {
  width: 1024,
  height: 768,
  mode: 1,
  x: 448,
  y: 156,
  hasDefaultState: true
}
[main 2022-03-31T18:58:40.832Z] window#validateWindowState: 1 monitor working area { x: 0, y: 0, width: 1920, height: 1040 }
[main 2022-03-31T18:58:40.833Z] window#ctor: using window state {
  width: 1024,
  height: 768,
  mode: 1,
  x: 448,
  y: 156,
  hasDefaultState: true
}
[main 2022-03-31T18:58:40.895Z] window#load: attempt to load window (id: 1)
[main 2022-03-31T18:58:40.915Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 0, emptyToOpen: 1)
[main 2022-03-31T18:58:40.916Z] lifecycle (main): phase changed (value: 3)
[main 2022-03-31T18:58:40.930Z] update#setState idle
[main 2022-03-31T18:58:40.931Z] resolveShellEnv(): skipped (Windows)
[main 2022-03-31T18:58:40.978Z] ExtensionHostStarterWorker created
[26408:0331/205841.194:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205841.194:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 2 time(s)
[26408:0331/205841.610:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205841.610:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 3 time(s)
[26408:0331/205841.862:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205841.862:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 4 time(s)
[main 2022-03-31T18:58:41.968Z] resolveShellEnv(): skipped (Windows)
[26408:0331/205842.063:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205842.063:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 5 time(s)
[26408:0331/205842.255:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205842.255:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 6 time(s)
[26408:0331/205842.475:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205842.475:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 7 time(s)
[26408:0331/205842.700:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205842.700:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 8 time(s)
[26408:0331/205842.919:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[26408:0331/205842.919:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 9 time(s)
[26408:0331/205842.919:FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 7
  • Comments: 23 (4 by maintainers)

Most upvoted comments

Googling “GPU process launch failed: error_code=40” leads to this Electron issue, after trying --no-sandbox flag vscode seems to work normally.

Does the issue repro when you launch the application with code --disable-gpu-sandbox ? We recommend to avoid --no-sandbox flag as it disables application sandbox for all processes, since this issue is isolated to the gpu process --disable-gpu-sandbox should serve as an alternative.

@jjowahye I believe you can add launch flags using the Target field in a Windows Shortcut properties, allowing you just to click the shortcut image

@hizeph the gpu process crash in this issue is isolated to windows, in your case the process is crashing due to SIGTRAP on linux due to other reasons, can you open a separate issue and also attach the crash logs following the steps at https://github.com/microsoft/vscode/wiki/Native-Crash-Issues#creating-and-symbolicating-local-crash-reports. Thanks!

Double confirming that replacing --no-sandbox with --disable-gpu-sandbox fixes it, thanks!

I have been having GPU related crashing since like 1.5X, and I start my vscode with command line flags every time since then

code --disable-gpu --disable-gpu-compositing --disable-software-rasterizer --no-sandbox <folder>

can’t tell you what these do, but I can tell you it works for most GPU crashing reasons. this --no-sandbox is the newest addition to the club as of 1.66

“code --no-sandbox” - I think this is a workaround for now but I would rather not have to do this every time I open the application going forward. I am running 1.66 and its showing no pending updates. Is there a way to downgrade to 1.65 for this to be resolved?

encountered the same problem,mark

you can try : cmd—>netsh winsock reset—>delete C:\Users\Administrator\AppData\Roaming\code, delete C:\Users\Administrator.vscode —> reinstall。I tried it, it’s ok

It displays a warning Warning: ‘disable-gpu-sandbox’ is not in the list of known options, but still passed to Electron/Chromium., but Code works ok (no crash).

same issue for me

VS Code Version: Insiders 1.67.0.0 and 1.66.0.0 and 1.65.2 OS Version: Microsoft Windows 10 Pro OS build 19044.1586

PS C:\> code --verbose

[12260:0404/150215.035:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.035:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 1 time(s)
[main 2022-04-04T06:02:15.051Z] [File Watcher (node.js)] Request to start watching: c:\Users\migno\AppData\Roaming\Code\User (excludes: <none>),c:\Users\migno\AppData\Roaming\Code\User\settings.json (excludes: <none>)
[main 2022-04-04T06:02:15.074Z] Starting VS Code
[main 2022-04-04T06:02:15.075Z] from: c:\Users\migno\AppData\Local\Programs\Microsoft VS Code\resources\app
[main 2022-04-04T06:02:15.075Z] args: {
  _: [],
  diff: false,
  add: false,
  goto: false,
  'new-window': false,
  'reuse-window': false,
  wait: false,
  help: false,
  'list-extensions': false,
  'show-versions': false,
  'pre-release': false,
  version: false,
  verbose: true,
  status: false,
  'prof-startup': false,
  'no-cached-data': false,
  'prof-v8-extensions': false,
  'disable-extensions': false,
  'disable-gpu': false,
  'ms-enable-electron-run-as-node': false,
  telemetry: false,
  debugRenderer: false,
  logExtensionHostCommunication: false,
  'skip-release-notes': false,
  'skip-welcome': false,
  'disable-telemetry': false,
  'disable-updates': false,
  'disable-keytar': false,
  'disable-workspace-trust': false,
  'disable-crash-reporter': false,
  'crash-reporter-id': '6b4a02d4-c37e-4b00-89dd-e5e32b8236fd',
  'skip-add-to-recently-opened': false,
  'unity-launch': false,
  'open-url': false,
  'file-write': false,
  'file-chmod': false,
  'driver-verbose': false,
  force: false,
  'do-not-sync': false,
  trace: false,
  'force-user-env': false,
  'force-disable-user-env': false,
  'open-devtools': false,
  __sandbox: false,
  'no-proxy-server': false,
  'no-sandbox': false,
  nolazy: false,
  'force-renderer-accessibility': false,
  'ignore-certificate-errors': false,
  'allow-insecure-localhost': false,
  'disable-dev-shm-usage': false,
  logsPath: 'C:\\Users\\migno\\AppData\\Roaming\\Code\\logs\\20220404T150215'
}
[main 2022-04-04T06:02:15.076Z] Resolving machine identifier...
[main 2022-04-04T06:02:15.077Z] Resolved machine identifier: 096f2330f9469b848b996c13d29e3d890263fa5e3015bb26084a1a79e91c79a2
[main 2022-04-04T06:02:15.078Z] Main->SharedProcess#connect
[main 2022-04-04T06:02:15.093Z] [File Watcher (node.js)] Error: ENOENT: no such file or directory, stat 'c:\Users\migno\AppData\Roaming\Code\User\settings.json'
[main 2022-04-04T06:02:15.098Z] [File Watcher (node.js)] Started watching: 'c:\Users\migno\AppData\Roaming\Code\User'
[main 2022-04-04T06:02:15.099Z] StorageMainService: creating global storage
[main 2022-04-04T06:02:15.105Z] lifecycle (main): phase changed (value: 2)
[main 2022-04-04T06:02:15.106Z] windowsManager#open
[main 2022-04-04T06:02:15.106Z] windowsManager#open pathsToOpen [ [Object: null prototype] {} ]
[main 2022-04-04T06:02:15.107Z] windowsManager#doOpenEmpty {
  restore: false,
  remoteAuthority: undefined,
  filesToOpen: undefined,
  forceNewWindow: false
}
[main 2022-04-04T06:02:15.108Z] IPC Object URL: Registered new channel vscode:7e4c97f4-b73f-400b-9855-c0e4540492d1.
[main 2022-04-04T06:02:15.109Z] window#validateWindowState: validating window state on 2 display(s) {
  width: 1024,
  height: 768,
  mode: 1,
  x: 448,
  y: 156,
  hasDefaultState: true
}
[main 2022-04-04T06:02:15.109Z] window#validateWindowState: multi-monitor working area { x: 0, y: 0, width: 1920, height: 1040 }
[main 2022-04-04T06:02:15.109Z] window#ctor: using window state {
  width: 1024,
  height: 768,
  mode: 1,
  x: 448,
  y: 156,
  hasDefaultState: true
}
[main 2022-04-04T06:02:15.163Z] window#load: attempt to load window (id: 1)
[main 2022-04-04T06:02:15.177Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 0, emptyToOpen: 1)
[main 2022-04-04T06:02:15.178Z] lifecycle (main): phase changed (value: 3)
[main 2022-04-04T06:02:15.194Z] update#setState idle
[main 2022-04-04T06:02:15.195Z] resolveShellEnv(): skipped (Windows)
[12260:0404/150215.229:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.229:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 2 time(s)
[main 2022-04-04T06:02:15.247Z] ExtensionHostStarterWorker created
[12260:0404/150215.328:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.328:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 3 time(s)
[main 2022-04-04T06:02:15.368Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2022-04-04T06:02:15.369Z] [File Watcher (node.js)] [CHANGED] c:\Users\migno\AppData\Roaming\Code\User\globalStorage
[main 2022-04-04T06:02:15.371Z] [File Watcher (node.js)] [raw] ["change"] globalStorage
[main 2022-04-04T06:02:15.371Z] [File Watcher (node.js)] [CHANGED] c:\Users\migno\AppData\Roaming\Code\User\globalStorage
[12260:0404/150215.396:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.396:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 4 time(s)
[main 2022-04-04T06:02:15.420Z] resolveShellEnv(): skipped (Windows)
[main 2022-04-04T06:02:15.427Z] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\migno\AppData\Roaming\Code\User\globalStorage
[12260:0404/150215.472:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.472:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 5 time(s)
[12260:0404/150215.536:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.536:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 6 time(s)
[12260:0404/150215.599:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.599:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 7 time(s)
[12260:0404/150215.677:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.677:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 8 time(s)
[12260:0404/150215.740:ERROR:gpu_process_host.cc(977)] GPU process launch failed: error_code=40
[12260:0404/150215.740:WARNING:gpu_process_host.cc(1288)] The GPU process has crashed 9 time(s)
[12260:0404/150215.740:FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye.