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
50.86k stars 3.15k forks source link

Linux: Zed completely freezes NVIDIA external monitor when launching or resizing window #18106

Open gallardorafael opened 2 months ago

gallardorafael commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Zed completely freezes the external monitor if I resize the window, this happens if I am using Zed in the laptop's screen or in the external monitor, either way the external monitor freezes and the only way to get it back to work is by turning it off and on or by changing the resolution via the display settings of my OS.

This sometimes happen when launching Zed, but it is not as easy to reproduce as when resizing.

The issue do not happen if Zed is using the integrated GPU (Intel), this only happens when using the discrete GPU.

Note that I am launching Zed with MESA_VK_DEVICE_SELECT=xxxx:yyyy (pointing to my NVIDIA GPU) since Zed is picking the Intel graphics by default (which makes it very slow), the "slow" issue gets solved either by setting MESA_VK_DEVICE_SELECT or DRI_PRIME=1, but both options cause the monitor freeze issue.

In the video, you can see that the text cursor stops blinking as soon as I resize the window, and in the real life, I could not see the arrow cursor moving as in the video, but somehow in OBS the arrow is moving, however, I can't click or move anything in the external monitor.

Possible related report, however, version 0.142.x should have solved this, but it is happening to me in 0.153.6

https://github.com/user-attachments/assets/e6749da9-34e0-4335-a89b-74c9f415498f

Environment

(Running with MESA_VK_DEVICE_SELECT set) Zed: v0.153.6 (Zed) OS: Linux X11 pop 22.04 Memory: 15.2 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 4060 Laptop GPU || NVIDIA || 560.35.03

(Running without MESA_VK_DEVICE_SELECT) Zed: v0.153.6 (Zed) OS: Linux X11 pop 22.04 Memory: 15.2 GiB Architecture: x86_64 GPU: Intel(R) Graphics (RPL-S) || Intel open-source Mesa driver || Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log

2024-09-19T17:24:12.451929446-06:00 [INFO] ========== starting zed ==========
2024-09-19T17:24:12.461783738-06:00 [WARN] failed to load font 'SymbolsNFM'
2024-09-19T17:24:12.46219258-06:00 [WARN] failed to load font 'SymbolsNFM'
2024-09-19T17:24:12.469554612-06:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-09-19T17:24:12.46957554-06:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-09-19T17:24:12.471791426-06:00 [INFO] Try connect ibus
2024-09-19T17:24:12.472208013-06:00 [INFO] perform;
2024-09-19T17:24:12.472217861-06:00 [INFO] authenticate;
2024-09-19T17:24:12.472241373-06:00 [INFO] read_command;
2024-09-19T17:24:12.472275807-06:00 [INFO] Opening main db
2024-09-19T17:24:12.472458968-06:00 [INFO] new;
2024-09-19T17:24:12.472508227-06:00 [INFO] socket reader;
2024-09-19T17:24:12.472880361-06:00 [INFO] keep_updated;
2024-09-19T17:24:12.473808814-06:00 [INFO] Using git binary path: None
2024-09-19T17:24:12.49345909-06:00 [ERROR] No such file or directory (os error 2) about ["/home/yibbtstll/.config/github-copilot"]
2024-09-19T17:24:12.493512568-06:00 [INFO] initializing context server client
2024-09-19T17:24:12.49355671-06:00 [INFO] Registering built-in prompt template: content_prompt
2024-09-19T17:24:12.493764506-06:00 [INFO] Registering built-in prompt template: edit_workflow
2024-09-19T17:24:12.493925295-06:00 [INFO] Registering built-in prompt template: step_resolution
2024-09-19T17:24:12.494188584-06:00 [INFO] Registering built-in prompt template: terminal_assistant_prompt
2024-09-19T17:24:12.49447149-06:00 [INFO] No prompt template overrides directory found at /home/yibbtstll/.local/share/zed/prompt_overrides. Using built-in prompts.
2024-09-19T17:24:12.49461646-06:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-09-19T17:24:12.496773436-06:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-09-19T17:24:12.496809421-06:00 [INFO] Opening main db
2024-09-19T17:24:12.497987467-06:00 [INFO] Using Visual { id: 559, colormap: 0, depth: 32 }
2024-09-19T17:24:12.498002254-06:00 [INFO] perform;
2024-09-19T17:24:12.498014399-06:00 [INFO] Creating colormap 69206019
2024-09-19T17:24:12.498022892-06:00 [INFO] authenticate;
2024-09-19T17:24:12.498045387-06:00 [INFO] read_command;
2024-09-19T17:24:12.498265692-06:00 [INFO] socket reader;
2024-09-19T17:24:12.51797102-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518014841-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518036939-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.51817137-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518194915-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518215247-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518232027-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518248883-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.51826566-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.518282287-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:12.523125175-06:00 [INFO] Enabling Vulkan Portability
2024-09-19T17:24:12.523137644-06:00 [INFO] Enabling color space support
2024-09-19T17:24:12.576086704-06:00 [INFO] Adapter: "NVIDIA GeForce RTX 4060 Laptop GPU"
2024-09-19T17:24:12.578722495-06:00 [INFO] Ray tracing is supported
2024-09-19T17:24:12.726197024-06:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:/home/yibbtstll/micromamba/condabin:/home/yibbtstll/.nvm/versions/node/v21.3.0/bin:/home/yibbtstll/.cargo/bin:/home/yibbtstll/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/yibbtstll/.local/bin
2024-09-19T17:24:12.772629982-06:00 [ERROR] Failed to send events: HTTP 500
2024-09-19T17:24:12.830738862-06:00 [INFO] Using surface present mode IMMEDIATE
2024-09-19T17:24:12.832478611-06:00 [WARN] Unable to forbid exclusive full screen
2024-09-19T17:24:12.89853328-06:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-09-19T17:24:12.898558688-06:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-09-19T17:24:12.898569363-06:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-09-19T17:24:12.99431257-06:00 [INFO] Refreshing at 10000 micros
2024-09-19T17:24:12.995045488-06:00 [INFO] Using GPU: GPUSpecs { is_software_emulated: false, device_name: "NVIDIA GeForce RTX 4060 Laptop GPU", driver_name: "NVIDIA", driver_info: "560.35.03" }
2024-09-19T17:24:13.023549976-06:00 [INFO] XConnected server on 25165843, transport version: 0.0, TRANSPORT_MAX: 20
2024-09-19T17:24:13.030422473-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:13.030471853-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:13.04844931-06:00 [WARN] GPU frame is out of date
2024-09-19T17:24:13.048923105-06:00 [INFO] Using surface present mode IMMEDIATE
2024-09-19T17:24:13.048987177-06:00 [WARN] Unable to forbid exclusive full screen
2024-09-19T17:24:15.100622146-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:15.100668369-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:15.102849168-06:00 [INFO] Opening main db
2024-09-19T17:24:15.113491877-06:00 [INFO] Node runtime install_if_needed
2024-09-19T17:24:15.132536725-06:00 [INFO] Initializing default prettier with plugins {}
2024-09-19T17:24:15.133144237-06:00 [INFO] Opening main db
2024-09-19T17:24:15.133326914-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:15.133509023-06:00 [ERROR] no worktrees when constructing ProjectLspAdapterDelegate
2024-09-19T17:24:15.152946891-06:00 [INFO] Initializing default prettier with plugins {}
2024-09-19T17:24:15.15344817-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:15.181623987-06:00 [INFO] starting language server. binary path: "/home/yibbtstll/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node", working directory: "/", args: ["/home/yibbtstll/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-09-19T17:24:15.230572522-06:00 [INFO] Initializing default prettier with plugins {}
2024-09-19T17:24:15.231055641-06:00 [WARN] request completed with error: failed to connect to the server
2024-09-19T17:24:15.408235989-06:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-09-19T23:24:15.405Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-09-19T23:24:15.405Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-09-19T17:24:15.409456561-06:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "1549e885-a676-4c0d-a296-e9ea8104961c",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-09-19T17:24:15.431952777-06:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-09-19T23:24:15.413Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-09-19T23:24:15.413Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-09-19T17:24:24.890900545-06:00 [WARN] Unknown request DestroyIcReply { input_method_id: 13, input_context_id: 217 }
2024-09-19T17:24:25.454827725-06:00 [ERROR] window not found

thmo commented 2 weeks ago

Same problem here in a "simpler" setup (workstation with single GPU, two monitors):

Zed: v0.161.1 (Zed) OS: Linux Wayland fedora 41 Memory: 15.5 GiB Architecture: x86_64 GPU: NVIDIA GeForce GT 1030 || NVIDIA || 565.57.01 Zed 0.161.1

The whole graphical interface freezes when trying to resize the Zed window.

Note that this is wayland, not X11, but otherwise quite similar.