zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.02k stars 2.7k forks source link

[Linux] Extremely laggy when trying to do anything in the editor #16331

Open finnar-bin opened 1 month ago

finnar-bin commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I have a fresh install of PopOS 22.04 and zed is behaving very laggy whenever I try to do anything may it be click files, scrolling through some code etc. I basically can't do anything due to the extreme lag. I'm using a laptop with an amd cpu and nvidia 1650 ti dgpu and I can confirm that zed is using my dgpu when I check the logs. vkcube also renders the cube as expected.

Environment

image

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

2024-08-16T10:59:09.699776542+08:00 [INFO] ========== starting zed ==========
2024-08-16T10:59:09.744816394+08:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-08-16T10:59:09.744936522+08:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-08-16T10:59:09.752344257+08:00 [INFO] Try connect ibus
2024-08-16T10:59:09.753198138+08:00 [INFO] perform;
2024-08-16T10:59:09.753275942+08:00 [INFO] read_command;
2024-08-16T10:59:09.753345993+08:00 [INFO] read_command;
2024-08-16T10:59:09.753552584+08:00 [INFO] socket reader;
2024-08-16T10:59:09.753662375+08:00 [INFO] Opening main db
2024-08-16T10:59:09.754033023+08:00 [INFO] new;
2024-08-16T10:59:09.754674936+08:00 [INFO] keep_updated;
2024-08-16T10:59:09.756425722+08:00 [INFO] Using git binary path: None
2024-08-16T10:59:09.797189251+08:00 [ERROR] No such file or directory (os error 2) about ["/home/nar/.config/github-copilot"]
2024-08-16T10:59:09.799274089+08:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-08-16T10:59:09.806374731+08:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-08-16T10:59:09.807591509+08:00 [INFO] Opening main db
2024-08-16T10:59:09.807747395+08:00 [INFO] perform;
2024-08-16T10:59:09.807818144+08:00 [INFO] read_command;
2024-08-16T10:59:09.807884843+08:00 [INFO] read_command;
2024-08-16T10:59:09.80807551+08:00 [INFO] socket reader;
2024-08-16T10:59:09.817039452+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817111319+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817152805+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817222297+08:00 [INFO] Using Visual { id: 507, colormap: 0, depth: 32 }
2024-08-16T10:59:09.817270139+08:00 [INFO] Creating colormap 33554435
2024-08-16T10:59:09.8174944+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817535816+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817570597+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817604889+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817637295+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817675359+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.817832851+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:09.818384809+08:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-08-16T10:59:09.868902187+08:00 [INFO] Enabling Vulkan Portability
2024-08-16T10:59:09.868958479+08:00 [INFO] Enabling color space support
2024-08-16T10:59:09.926604506+08:00 [INFO] Adapter "NVIDIA GeForce GTX 1650 Ti"
2024-08-16T10:59:09.92667316+08:00 [INFO] No ray tracing extensions are supported
2024-08-16T10:59:09.929213574+08:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:/home/nar/.local/bin:/home/nar/.autojump/bin:/home/nar/.volta/bin:/home/nar/.volta/bin:/home/nar/.local/bin:/home/nar/.autojump/bin:/home/nar/.volta/bin:/home/nar/.local/bin:/home/nar/.autojump/bin:/home/nar/.volta/bin:/home/nar/.local/bin:/home/nar/.local/share/pnpm:/home/nar/.volta/bin:/home/nar/.volta/bin:/home/nar/.volta/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/nar/go/bin:/home/nar/go/bin:/home/nar/go/bin:/home/nar/go/bin
2024-08-16T10:59:10.095530405+08:00 [INFO] Using surface present mode IMMEDIATE
2024-08-16T10:59:10.095718069+08:00 [WARN] Unable to forbid exclusive full screen
2024-08-16T10:59:10.174235169+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-16T10:59:10.174317373+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-16T10:59:10.174357532+08:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-08-16T10:59:10.24680527+08:00 [INFO] Refreshing at 6944 micros
2024-08-16T10:59:10.248146715+08:00 [INFO] Using GPU: GPUSpecs { is_software_emulated: false, device_name: "NVIDIA GeForce GTX 1650 Ti", driver_name: "NVIDIA", driver_info: "555.58.02" }
2024-08-16T10:59:10.261252884+08:00 [WARN] Acquire failed because the surface is out of date
2024-08-16T10:59:10.26514033+08:00 [INFO] Using surface present mode IMMEDIATE
2024-08-16T10:59:10.265364312+08:00 [WARN] Unable to forbid exclusive full screen
2024-08-16T10:59:10.290130165+08:00 [INFO] Using surface present mode IMMEDIATE
2024-08-16T10:59:10.290637004+08:00 [WARN] Unable to forbid exclusive full screen
2024-08-16T10:59:10.357496657+08:00 [INFO] XConnected server on 29360139, transport version: 0.0, TRANSPORT_MAX: 20
2024-08-16T10:59:10.370979971+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:10.371101145+08:00 [INFO] Opening main db
2024-08-16T10:59:10.379371702+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:10.37954002+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:10.380137653+08:00 [INFO] Opening main db
2024-08-16T10:59:10.384972708+08:00 [INFO] Node runtime install_if_needed
2024-08-16T10:59:10.412244612+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:10.465759517+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T10:59:10.46634409+08:00 [INFO] perform;
2024-08-16T10:59:10.466421893+08:00 [INFO] read_command;
2024-08-16T10:59:10.466605017+08:00 [INFO] read_command;
2024-08-16T10:59:10.466711526+08:00 [INFO] socket reader;
2024-08-16T10:59:11.019651984+08:00 [INFO] starting language server. binary path: "/home/nar/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node", working directory: "/", args: ["/home/nar/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-08-16T10:59:12.011411179+08:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-16T02:59:11.531Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-08-16T02:59:11.531Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-08-16T10:59:12.011586063+08:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "0c70e0f8-3f62-426e-abe9-5b4952f0cf90",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-08-16T10:59:12.064099021+08:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-16T02:59:12.020Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-08-16T02:59:12.020Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-08-16T10:59:25.016988504+08:00 [ERROR] window not found
2024-08-16T10:59:25.017155775+08:00 [ERROR] window not found

finnar-bin commented 1 month ago

I forgot to note that I'm currently running X11.

I just tried enabling Wayland in PopOS and it seems like Zed works perfectly fine in wayland but the caveat is that it only works fine so long as it's using the igpu and not my gtx 1650 ti. Running zed using my dgpu by adding DRI_PRIME=1 causes it to not run at all and I'm getting this on the logs

zed.log
2024-08-16T14:43:20.885911174+08:00 [INFO] ========== starting zed ==========
2024-08-16T14:43:20.937011119+08:00 [INFO] perform;
2024-08-16T14:43:20.937190961+08:00 [INFO] Opening main db
2024-08-16T14:43:20.937277355+08:00 [INFO] read_command;
2024-08-16T14:43:20.937368987+08:00 [INFO] read_command;
2024-08-16T14:43:20.937557908+08:00 [INFO] socket reader;
2024-08-16T14:43:20.937839787+08:00 [INFO] new;
2024-08-16T14:43:20.938514176+08:00 [INFO] keep_updated;
2024-08-16T14:43:20.938744652+08:00 [INFO] Using git binary path: None
2024-08-16T14:43:20.975365499+08:00 [ERROR] No such file or directory (os error 2) about ["/home/nar/.config/github-copilot"]
2024-08-16T14:43:20.97720987+08:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-08-16T14:43:20.98243254+08:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-08-16T14:43:20.983654625+08:00 [INFO] perform;
2024-08-16T14:43:20.983776707+08:00 [INFO] read_command;
2024-08-16T14:43:20.986331087+08:00 [INFO] read_command;
2024-08-16T14:43:20.988499802+08:00 [INFO] socket reader;
2024-08-16T14:43:20.992086995+08:00 [INFO] Opening main db
2024-08-16T14:43:21.001236497+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.001675241+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.001764638+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.00184279+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.001922899+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.0020014+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.002082835+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.002163362+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.002295363+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.002397471+08:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-08-16T14:43:21.002479395+08:00 [WARN] request completed with error: failed to connect to the server
2024-08-16T14:43:21.08965675+08:00 [INFO] Enabling Vulkan Portability
2024-08-16T14:43:21.089745658+08:00 [INFO] Enabling color space support
2024-08-16T14:43:21.115441564+08:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:/home/nar/.local/bin:/home/nar/.autojump/bin:/home/nar/.volta/bin:/home/nar/.volta/bin:/home/nar/.local/bin:/home/nar/.local/share/pnpm:/home/nar/.autojump/bin:/home/nar/.volta/bin:/home/nar/.volta/bin:/home/nar/.volta/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/nar/go/bin:/home/nar/go/bin
2024-08-16T14:43:21.170252532+08:00 [INFO] Adapter "NVIDIA GeForce GTX 1650 Ti"
2024-08-16T14:43:21.170331802+08:00 [INFO] No ray tracing extensions are supported
2024-08-16T14:43:21.344735751+08:00 [INFO] Using surface present mode MAILBOX
2024-08-16T14:43:21.354516899+08:00 [ERROR] {
  "thread": "main",
  "payload": "called `Result::unwrap()` on an `Err` value: ERROR_SURFACE_LOST_KHR",
  "location_data": {
    "file": "/home/actions-runner/.cargo/git/checkouts/blade-b2bcd1de1cf7ab6a/ac25c77/blade-graphics/src/vulkan/init.rs",
    "line": 835
  },
  "backtrace": [
    "core::panicking::panic_fmt",
    "core::result::unwrap_failed",
    "blade_graphics::hal::init::::resize",
    "gpui::platform::blade::blade_renderer::BladeRenderer::new",
    "gpui::platform::linux::wayland::window::WaylandWindow::new",
    "::open_window",
    "gpui::platform::linux::platform::::open_window",
    "gpui::window::Window::new",
    "workspace::Workspace::new_local::{{closure}}::{{closure}}",
    "async_task::raw::RawTask::run",
    "::run",
    "gpui::platform::linux::platform::::run",
    "gpui::app::App::run",
    "zed::main",
    "std::sys_common::backtrace::__rust_begin_short_backtrace",
    "std::rt::lang_start::{{closure}}",
    "std::rt::lang_start_internal",
    "main",
    "__libc_start_main",
    "_start"
  ],
  "app_version": "0.148.1",
  "release_channel": "Zed",
  "os_name": "Linux Wayland",
  "os_version": "pop 22.04",
  "architecture": "x86_64",
  "panicked_on": 1723790601354,
  "installation_id": "6d5d2866-b7bc-4573-8c40-b522b8342d88",
  "session_id": "8503f328-bcb9-4a48-ac02-2b20ee653ce8"
}