microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.75k stars 29.1k forks source link

Cannot start on Wayland (KDE and GNOME) #179174

Closed AdelKS closed 1 year ago

AdelKS commented 1 year ago

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

Running vscode --verbose with .config/code-flags.conf filled with --ozone-platform-hint=auto gives this output

code --verbose                                                                                     !10005
Warning: 'ozone-platform-hint' is not in the list of known options, but still passed to Electron/Chromium.
[30840:0404/194050.368377:WARNING:wayland_object.cc(94)] Binding to wl_output version 2 but version 3 is available.
[30840:0404/194050.368430:WARNING:wayland_object.cc(94)] Binding to gtk_shell1 version 4 but version 5 is available.
[30840:0404/194050.368437:WARNING:wayland_object.cc(94)] Binding to zwp_pointer_gestures_v1 version 1 but version 3 is available.
[30840:0404/194050.368441:WARNING:wayland_object.cc(94)] Binding to wl_seat version 5 but version 8 is available.
[30840:0404/194050.368448:WARNING:wayland_object.cc(94)] Binding to zwp_linux_dmabuf_v1 version 3 but version 4 is available.
[30840:0404/194050.368619:WARNING:wayland_drm.cc(96)] Failed to get drm magic
[30840:0404/194050.441404:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
[main 2023-04-04T17:40:50.522Z] [File Watcher (node.js)] Request to start watching: /home/adel/.config/Code/User (excludes: <none>, includes: <all>),/home/adel/.config/Code/User/settings.json (excludes: <none>, includes: <all>)
[main 2023-04-04T17:40:50.531Z] Starting VS Code
[main 2023-04-04T17:40:50.531Z] from: /opt/visual-studio-code/resources/app
[main 2023-04-04T17:40:50.531Z] args: {
  _: [],
  diff: false,
  merge: 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,
  'enable-smoke-test-driver': 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,
  'skip-add-to-recently-opened': false,
  'unity-launch': false,
  'open-url': false,
  'file-write': false,
  'file-chmod': false,
  force: false,
  'do-not-sync': false,
  trace: false,
  'force-user-env': false,
  'force-disable-user-env': false,
  'open-devtools': false,
  'disable-gpu-sandbox': false,
  '__enable-file-policy': false,
  'enable-coi': 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,
  'profile-temp': false,
  logsPath: '/home/adel/.config/Code/logs/20230404T194050'
}
[main 2023-04-04T17:40:50.532Z] Resolving machine identifier...
[main 2023-04-04T17:40:50.533Z] Resolved machine identifier: 6e2cd50aeb3735713cb356e7660b22cee9566b3849605dd44a8db8dbf05f8554
[main 2023-04-04T17:40:50.533Z] [SharedProcess] using utility process
[main 2023-04-04T17:40:50.533Z] Main->SharedProcess#connect
[main 2023-04-04T17:40:50.536Z] [File Watcher (node.js)] Started watching: '/home/adel/.config/Code/User'
[main 2023-04-04T17:40:50.537Z] [File Watcher (node.js)] Started watching: '/home/adel/.config/Code/User/settings.json'
[main 2023-04-04T17:40:50.538Z] StorageMainService: creating application storage
[main 2023-04-04T17:40:50.542Z] ElectronURLListener: waiting for window to be ready to handle URLs...
[main 2023-04-04T17:40:50.542Z] lifecycle (main): phase changed (value: 2)
[main 2023-04-04T17:40:50.542Z] windowsManager#open
[main 2023-04-04T17:40:50.545Z] windowsManager#open pathsToOpen [
  {
    workspace: { id: '407ca6921032c8db30a7e402d67bf9ed', configPath: [v] },
    type: 1,
    exists: true,
    remoteAuthority: undefined,
    transient: undefined
  }
]
[main 2023-04-04T17:40:50.545Z] windowsManager#doOpenFolderOrWorkspace {
  folderOrWorkspace: {
    workspace: { id: '407ca6921032c8db30a7e402d67bf9ed', configPath: [v] },
    type: 1,
    exists: true,
    remoteAuthority: undefined,
    transient: undefined
  },
  filesToOpen: undefined
}
[main 2023-04-04T17:40:50.546Z] IPC Object URL: Registered new channel vscode:c7b19a40-30f1-4a4e-99f3-623113a1cfcc.
[main 2023-04-04T17:40:50.546Z] window#validateWindowState: validating window state on 1 display(s) { mode: 0, x: 0, y: 32, width: 854, height: 688 }
[main 2023-04-04T17:40:50.546Z] window#validateWindowState: 1 monitor working area { x: 0, y: 0, width: 1280, height: 720 }
[main 2023-04-04T17:40:50.547Z] window#ctor: using window state { mode: 0, x: 0, y: 32, width: 854, height: 688 }
[30840:0404/194050.547323:WARNING:wayland_surface.cc(126)] Server doesn't support zcr_alpha_compositing_v1.
[30840:0404/194050.547331:WARNING:wayland_surface.cc(137)] Server doesn't support overlay_prioritizer.
[30840:0404/194050.547334:WARNING:wayland_surface.cc(147)] Server doesn't support surface_augmenter.
[30840:0404/194050.547339:WARNING:wayland_surface.cc(126)] Server doesn't support zcr_alpha_compositing_v1.
[30840:0404/194050.547341:WARNING:wayland_surface.cc(137)] Server doesn't support overlay_prioritizer.
[30840:0404/194050.547342:WARNING:wayland_surface.cc(147)] Server doesn't support surface_augmenter.
[30840:0404/194050.547519:WARNING:cursor_loader.cc(119)] Failed to load a platform cursor of type kNull
[main 2023-04-04T17:40:50.557Z] window#load: attempt to load window (id: 1)
[main 2023-04-04T17:40:50.564Z] StorageMainService: creating workspace storage (407ca6921032c8db30a7e402d67bf9ed)
[main 2023-04-04T17:40:50.565Z] windowsManager#open used window count 1 (workspacesToOpen: 1, foldersToOpen: 0, emptyToRestore: 0, emptyToOpen: 0)
[main 2023-04-04T17:40:50.565Z] lifecycle (main): phase changed (value: 3)
[main 2023-04-04T17:40:50.565Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2023-04-04T17:40:50.565Z] update#setState idle
[main 2023-04-04T17:40:50.629Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[30881:0404/194051.591015:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is
[30881:0404/194051.592870:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
[30881:0404/194051.628565:ERROR:gl_surface_egl.cc(852)] EGL Driver message (Error) eglCreateImageKHR: createImageFromDmaBufs failed
[30881:0404/194051.628642:ERROR:gl_image_egl.cc(38)] Error creating EGLImage: EGL_BAD_MATCH
[30881:0404/194051.628698:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(205)] Failed to create GLImage 2048x1792, RGBA_8888, usage SCANOUT
[30840:0404/194051.628799:ERROR:wayland_event_watcher.cc(36)] libwayland: [destroyed object]: error 7: failed to import supplied dmabufs: Arguments are inconsistent (for example, a valid context requires buffers not supplied by a
[30881:0404/194051.628854:ERROR:gl_surface_egl.cc(852)] EGL Driver message (Error) eglCreateImageKHR: createImageFromDmaBufs failed
[30881:0404/194051.628894:ERROR:gl_image_egl.cc(38)] Error creating EGLImage: EGL_BAD_MATCH

I will attach some more information after reading #146890

Thank you for your work and help

kstbhh commented 1 year ago

Facing the same issue on Arch Linux (GNOME 43.5)

UPDATE: Just tested the insider version, it seems to be working on insiders. This issue probably has something to do with electron

sharp2448 commented 1 year ago

Most likely Wayland's update 1.22 does this.

I'm also running Arch Linux with KDE and Wayland.

I have first noticed this behavior on Firefox with ENV var MOZ_ENABLE_WAYLAND=1 https://bugzilla.mozilla.org/show_bug.cgi?id=1826583

Same happens with VSCode obviously....

AdelKS commented 1 year ago

I changed the Optimus mode from Hybrid to Integrated mode using supergfxctl, and vscode now works under wayland on Gnome, maybe an update fixed this and has nothing to do with Optimus, will update this answer.

Edit: I confirm that it's Optimus related. When moving to integrated graphics only, vscode works in wayland mode in both KDE and GNOME. When switching between hybrid and integrated firefox stops working too, and I need to reset its settings so it can start. Not sure what's happening.

deepak1556 commented 1 year ago

Closing per above comment given issue is not from VSCode.