Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using MESA_VK_DEVICE_SELECT to select Intel Arc device on linux not working (PopOS) #15629

Closed
1 task done
natemcintosh opened this issue Aug 1, 2024 · 11 comments
Closed
1 task done
Labels
bug [core label] linux linux-x11 Linux X11 support User support (non-defect troubleshooting, documentation, etc)

Comments

@natemcintosh
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Context: PopOS, Intel Arc A750 GPU.

Upon opening Zed I get the "Unsupported GPU" message, stating that I'm currently using software emulation, with a link to the troubleshooting guide for Linux. I follow the link, used MESA_VK_DEVICE_SELECT=list zed --foreground to get a list of GPU devices. I see two devices:

MESA-INTEL: warning: cannot initialize blitter engine
selectable devices:
  GPU 0: 8086:56a1 "Intel(R) Arc(tm) A750 Graphics (DG2)" discrete GPU 0000:03:00.0
  GPU 1: 10005:0 "llvmpipe (LLVM 15.0.7, 256 bits)" CPU 0000:00:00.0

So I grab the device code 8086:56a1 for the discrete GPU, and run export MESA_VK_DEVICE_SELECT="8086:56a1" (I've tried with single quotes and no quotes, and gotten the same result)

I verify that it is in the environment by running

$ echo $MESA_VK_DEVICE_SELECT
8086:56a1

Then run zed, which gives me the same error as before.

Environment

Zed: v0.146.3 (Zed)
OS: Linux X11 pop 22.04
Memory: 31.2 GiB
Architecture: x86_64
GPU: llvmpipe (LLVM 15.0.7, 256 bits) || llvmpipe || Mesa 24.0.3-1pop1171163555922.04~7a9f319 (LLVM 15.0.7)

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

Screenshot from 2024-08-01 12-23-17

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

Zed.log
2024-08-01T12:24:27.204637268-04:00 [INFO] ========== starting zed ==========
2024-08-01T12:24:27.221063338-04:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-08-01T12:24:27.22111772-04:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-08-01T12:24:27.226094752-04:00 [INFO] Try connect ibus
2024-08-01T12:24:27.226472995-04:00 [INFO] perform;
2024-08-01T12:24:27.22651951-04:00 [INFO] read_command;
2024-08-01T12:24:27.226555408-04:00 [INFO] read_command;
2024-08-01T12:24:27.226667394-04:00 [INFO] socket reader;
2024-08-01T12:24:27.226695023-04:00 [INFO] Opening main db
2024-08-01T12:24:27.226830369-04:00 [INFO] new;
2024-08-01T12:24:27.227195654-04:00 [INFO] keep_updated;
2024-08-01T12:24:27.227883927-04:00 [INFO] Using git binary path: None
2024-08-01T12:24:27.248952456-04:00 [INFO] extensions updated. loading 2, reloading 0, unloading 0
2024-08-01T12:24:27.249868397-04:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-08-01T12:24:27.269114901-04:00 [INFO] Opening main db
2024-08-01T12:24:27.269299146-04:00 [INFO] perform;
2024-08-01T12:24:27.26933342-04:00 [INFO] read_command;
2024-08-01T12:24:27.269356794-04:00 [INFO] read_command;
2024-08-01T12:24:27.269424684-04:00 [INFO] socket reader;
2024-08-01T12:24:27.270128101-04:00 [INFO] Using Visual { id: 127, colormap: 0, depth: 32 }
2024-08-01T12:24:27.270141834-04:00 [INFO] Creating colormap 127926275
2024-08-01T12:24:27.292675942-04:00 [INFO] Enabling Vulkan Portability
2024-08-01T12:24:27.292692907-04:00 [INFO] Enabling color space support
2024-08-01T12:24:27.295705861-04:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux)
2024-08-01T12:24:27.295822447-04:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"
2024-08-01T12:24:27.295830313-04:00 [INFO] No ray tracing extensions are supported
2024-08-01T12:24:27.301806693-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:24:27.301838202-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:24:27.301985115-04:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-01T12:24:27.301992648-04:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-01T12:24:27.302000324-04:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-08-01T12:24:27.309175884-04:00 [INFO] set environment variables from shell:/bin/bash, path:/home/nathanmcintosh/.local/bin:/home/nathanmcintosh/.pyenv/shims:/home/nathanmcintosh/.pyenv/bin:/home/nathanmcintosh/.juliaup/bin:/home/nathanmcintosh/.cargo/bin:/home/nathanmcintosh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/nathanmcintosh/.dotnet/tools:/usr/local/go/bin:/usr/local/go/bin
2024-08-01T12:24:27.401977617-04:00 [INFO] Refreshing at 16666 micros
2024-08-01T12:24:27.402478414-04:00 [INFO] Using GPU: GPUSpecs { is_software_emulated: true, device_name: "llvmpipe (LLVM 15.0.7, 256 bits)", driver_name: "llvmpipe", driver_info: "Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319 (LLVM 15.0.7)" }
2024-08-01T12:24:27.402734201-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:24:27.402769223-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:24:27.403002742-04:00 [INFO] XConnected server on 29360189, transport version: 0.0, TRANSPORT_MAX: 20
2024-08-01T12:24:27.436852952-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:24:27.436897712-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:24:27.439169413-04:00 [INFO] Opening main db
2024-08-01T12:24:27.565116871-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:24:27.565154745-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:24:27.567000926-04:00 [INFO] Initializing default prettier with plugins {}
2024-08-01T12:24:27.567233182-04:00 [ERROR] no worktrees when constructing ProjectLspAdapterDelegate
2024-08-01T12:24:27.590857584-04:00 [INFO] Initializing default prettier with plugins {}
2024-08-01T12:24:27.591722529-04:00 [INFO] Node runtime install_if_needed
2024-08-01T12:24:27.660954089-04:00 [INFO] starting language server. binary path: "/home/nathanmcintosh/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node", working directory: "/", args: ["/home/nathanmcintosh/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-08-01T12:24:27.901818255-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-01T16:24:27.899Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-08-01T16:24:27.899Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-08-01T12:24:27.921159366-04:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "e55fd438-a4d2-4c7d-b1ce-623e8628c4dd",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-08-01T12:24:27.958015566-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-01T16:24:27.924Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-08-01T16:24:27.924Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-08-01T12:24:38.965611794-04:00 [WARN] Unknown request DestroyIcReply { input_method_id: 54, input_context_id: 89 }
2024-08-01T12:25:02.282411442-04:00 [INFO] ========== starting zed ==========
2024-08-01T12:25:02.303235536-04:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-08-01T12:25:02.303297553-04:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-08-01T12:25:02.309630275-04:00 [INFO] Try connect ibus
2024-08-01T12:25:02.3102551-04:00 [INFO] perform;
2024-08-01T12:25:02.310328951-04:00 [INFO] read_command;
2024-08-01T12:25:02.310390628-04:00 [INFO] read_command;
2024-08-01T12:25:02.310461754-04:00 [INFO] Opening main db
2024-08-01T12:25:02.310548425-04:00 [INFO] socket reader;
2024-08-01T12:25:02.310766193-04:00 [INFO] new;
2024-08-01T12:25:02.311310284-04:00 [INFO] keep_updated;
2024-08-01T12:25:02.31214312-04:00 [INFO] Using git binary path: None
2024-08-01T12:25:02.343040184-04:00 [INFO] extensions updated. loading 2, reloading 0, unloading 0
2024-08-01T12:25:02.346071729-04:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-08-01T12:25:02.346130073-04:00 [INFO] Opening main db
2024-08-01T12:25:02.36341978-04:00 [INFO] XConnected server on 29360190, transport version: 0.0, TRANSPORT_MAX: 20
2024-08-01T12:25:02.363797499-04:00 [INFO] perform;
2024-08-01T12:25:02.363935128-04:00 [INFO] read_command;
2024-08-01T12:25:02.364021641-04:00 [INFO] Using Visual { id: 127, colormap: 0, depth: 32 }
2024-08-01T12:25:02.364112449-04:00 [INFO] Creating colormap 127926275
2024-08-01T12:25:02.364189884-04:00 [INFO] read_command;
2024-08-01T12:25:02.364437588-04:00 [INFO] socket reader;
2024-08-01T12:25:02.386100278-04:00 [INFO] Enabling Vulkan Portability
2024-08-01T12:25:02.386125134-04:00 [INFO] Enabling color space support
2024-08-01T12:25:02.388929957-04:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux)
2024-08-01T12:25:02.389453123-04:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"
2024-08-01T12:25:02.389470302-04:00 [INFO] No ray tracing extensions are supported
2024-08-01T12:25:02.395456748-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:02.395493616-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:02.395640386-04:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-01T12:25:02.395655674-04:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-01T12:25:02.395670246-04:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-08-01T12:25:02.41529626-04:00 [INFO] set environment variables from shell:/bin/bash, path:/home/nathanmcintosh/.local/bin:/home/nathanmcintosh/.pyenv/shims:/home/nathanmcintosh/.pyenv/bin:/home/nathanmcintosh/.pyenv/bin:/home/nathanmcintosh/go/bin/:/usr/local/go/bin:/home/nathanmcintosh/.juliaup/bin:/home/nathanmcintosh/.cargo/bin:/home/nathanmcintosh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/nathanmcintosh/.dotnet/tools:/usr/local/go/bin:/usr/local/go/bin
2024-08-01T12:25:02.503883209-04:00 [INFO] Refreshing at 16666 micros
2024-08-01T12:25:02.504417672-04:00 [INFO] Using GPU: GPUSpecs { is_software_emulated: true, device_name: "llvmpipe (LLVM 15.0.7, 256 bits)", driver_name: "llvmpipe", driver_info: "Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319 (LLVM 15.0.7)" }
2024-08-01T12:25:02.504709464-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:02.504737007-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:02.541350674-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:02.541388431-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:02.544232592-04:00 [INFO] Opening main db
2024-08-01T12:25:02.674833914-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:02.674895223-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:02.68004765-04:00 [INFO] Initializing default prettier with plugins {}
2024-08-01T12:25:02.68063759-04:00 [INFO] Initializing default prettier with plugins {}
2024-08-01T12:25:02.681106151-04:00 [INFO] Node runtime install_if_needed
2024-08-01T12:25:02.68142604-04:00 [ERROR] no worktrees when constructing ProjectLspAdapterDelegate
2024-08-01T12:25:02.774074528-04:00 [INFO] starting language server. binary path: "/home/nathanmcintosh/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node", working directory: "/", args: ["/home/nathanmcintosh/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-08-01T12:25:03.019858831-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-01T16:25:03.017Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-08-01T16:25:03.017Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-08-01T12:25:03.03937562-04:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "c99e03d6-6e5e-4f54-82d7-5ed932993526",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-08-01T12:25:03.072727736-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-01T16:25:03.042Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-08-01T16:25:03.042Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-08-01T12:25:07.023230264-04:00 [INFO] Opening main db
2024-08-01T12:25:16.18891996-04:00 [WARN] Unknown request DestroyIcReply { input_method_id: 55, input_context_id: 93 }
2024-08-01T12:25:30.93069052-04:00 [WARN] Unknown request DestroyIcReply { input_method_id: 55, input_context_id: 94 }
2024-08-01T12:25:30.997243912-04:00 [WARN] Unknown request DestroyIcReply { input_method_id: 55, input_context_id: 95 }
2024-08-01T12:25:52.900545732-04:00 [WARN] Unknown request DestroyIcReply { input_method_id: 55, input_context_id: 96 }
2024-08-01T12:25:57.0905785-04:00 [INFO] ========== starting zed ==========
2024-08-01T12:25:57.108769747-04:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-08-01T12:25:57.108804708-04:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-08-01T12:25:57.112477803-04:00 [INFO] Try connect ibus
2024-08-01T12:25:57.112940055-04:00 [INFO] perform;
2024-08-01T12:25:57.112982916-04:00 [INFO] read_command;
2024-08-01T12:25:57.113022283-04:00 [INFO] read_command;
2024-08-01T12:25:57.11312027-04:00 [INFO] Opening main db
2024-08-01T12:25:57.113151447-04:00 [INFO] socket reader;
2024-08-01T12:25:57.113341493-04:00 [INFO] new;
2024-08-01T12:25:57.113796866-04:00 [INFO] keep_updated;
2024-08-01T12:25:57.114303562-04:00 [INFO] Using git binary path: None
2024-08-01T12:25:57.133121715-04:00 [INFO] extensions updated. loading 2, reloading 0, unloading 0
2024-08-01T12:25:57.135799441-04:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-08-01T12:25:57.135847755-04:00 [INFO] Opening main db
2024-08-01T12:25:57.140966002-04:00 [INFO] XConnected server on 29360191, transport version: 0.0, TRANSPORT_MAX: 20
2024-08-01T12:25:57.141203347-04:00 [INFO] Using Visual { id: 127, colormap: 0, depth: 32 }
2024-08-01T12:25:57.141252429-04:00 [INFO] Creating colormap 127926275
2024-08-01T12:25:57.141296305-04:00 [INFO] perform;
2024-08-01T12:25:57.141333163-04:00 [INFO] read_command;
2024-08-01T12:25:57.141412384-04:00 [INFO] read_command;
2024-08-01T12:25:57.141496246-04:00 [INFO] socket reader;
2024-08-01T12:25:57.154781794-04:00 [INFO] Enabling Vulkan Portability
2024-08-01T12:25:57.154804344-04:00 [INFO] Enabling color space support
2024-08-01T12:25:57.157597247-04:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux)
2024-08-01T12:25:57.157713482-04:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"
2024-08-01T12:25:57.157721367-04:00 [INFO] No ray tracing extensions are supported
2024-08-01T12:25:57.163932261-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:57.163995814-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:57.164246586-04:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-01T12:25:57.164262053-04:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-08-01T12:25:57.164275033-04:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-08-01T12:25:57.195747738-04:00 [INFO] set environment variables from shell:/bin/bash, path:/home/nathanmcintosh/.local/bin:/home/nathanmcintosh/.pyenv/shims:/home/nathanmcintosh/.pyenv/bin:/home/nathanmcintosh/.pyenv/bin:/home/nathanmcintosh/go/bin/:/usr/local/go/bin:/home/nathanmcintosh/.juliaup/bin:/home/nathanmcintosh/.cargo/bin:/home/nathanmcintosh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/nathanmcintosh/.dotnet/tools:/usr/local/go/bin:/usr/local/go/bin
2024-08-01T12:25:57.274373419-04:00 [INFO] Refreshing at 16666 micros
2024-08-01T12:25:57.274901649-04:00 [INFO] Using GPU: GPUSpecs { is_software_emulated: true, device_name: "llvmpipe (LLVM 15.0.7, 256 bits)", driver_name: "llvmpipe", driver_info: "Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319 (LLVM 15.0.7)" }
2024-08-01T12:25:57.275200669-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:57.27522992-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:57.310719289-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:57.310788978-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:57.318508836-04:00 [INFO] Opening main db
2024-08-01T12:25:57.449146418-04:00 [INFO] Using surface present mode MAILBOX
2024-08-01T12:25:57.449185878-04:00 [WARN] Unable to forbid exclusive full screen
2024-08-01T12:25:57.451815998-04:00 [INFO] Initializing default prettier with plugins {}
2024-08-01T12:25:57.452192101-04:00 [INFO] Initializing default prettier with plugins {}
2024-08-01T12:25:57.452628941-04:00 [INFO] Node runtime install_if_needed
2024-08-01T12:25:57.453011755-04:00 [ERROR] no worktrees when constructing ProjectLspAdapterDelegate
2024-08-01T12:25:57.516636439-04:00 [INFO] starting language server. binary path: "/home/nathanmcintosh/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node", working directory: "/", args: ["/home/nathanmcintosh/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-08-01T12:25:57.777751772-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-01T16:25:57.774Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-08-01T16:25:57.774Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-08-01T12:25:57.778956951-04:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "c615369e-7cc6-4a33-b124-b9dfb7dd3582",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-08-01T12:25:57.809194159-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-01T16:25:57.782Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-08-01T16:25:57.782Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
@natemcintosh natemcintosh added admin read bug [core label] labels Aug 1, 2024
@notpeter
Copy link
Member

notpeter commented Aug 1, 2024

Untested, but can you try adding a ! to force its usage?

export MESA_VK_DEVICE_SELECT="8086:56a1!"

https://docs.mesa3d.org/envvars.html#vulkan-mesa-device-select-layer-environment-variables

@notpeter notpeter added linux support User support (non-defect troubleshooting, documentation, etc) linux-x11 Linux X11 and removed triage labels Aug 1, 2024
@natemcintosh
Copy link
Author

hmmm, interesting, now nothing happens at all when I attempt to open zed. I'll try re-installing and see what I get

@natemcintosh
Copy link
Author

after a reboot, I was able to open zed just by clicking on the app icon, and received the "GPU not supported" warning. Then I shut it down, set the env var with the ! as suggested, and ran zed from the command line, which returned immediately and did not open zed. I also can no longer open zed by clicking on the app icon.

@notpeter
Copy link
Member

notpeter commented Aug 1, 2024

Ouch. Can you confirm there are no copies of zed running in the background (ps aux |grep -i zed) and kill them if they are? Wondering whether something is causing a hung zed process to stick around preventing you from relaunching.

You might also try running zed --foreground to see what's happening or if it's crashing.

@natemcintosh
Copy link
Author

Aha, looks like it is indeed running in the background.

~> zed --foreground
zed is already running

When I use ps aux |grep -i zed to find and kill the background tasks, I can start zed without having first set the env flag. But once I set the env var, it's back to the behavior of nothing showing up.

@ViridianForge
Copy link

ViridianForge commented Aug 6, 2024

I am able to replicate the invisibly running zed when adding the forced usage of MESA_VK_DEVICE_SELECT

> echo $MESA_VK_DEVICE_SELECT
8086:94a49!

I'm attaching my Zed.log from the run using the above just in case its helpful.

Zed.log
2024-08-05T22:11:22.915372581-07:00 [INFO] ========== starting zed ==========
2024-08-05T22:11:22.940471017-07:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-08-05T22:11:22.940507979-07:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-08-05T22:11:22.945634044-07:00 [INFO] Try connect ibus
2024-08-05T22:11:22.945996304-07:00 [INFO] perform;
2024-08-05T22:11:22.946030973-07:00 [INFO] read_command;
2024-08-05T22:11:22.946060401-07:00 [INFO] read_command;
2024-08-05T22:11:22.946196759-07:00 [INFO] socket reader;
2024-08-05T22:11:22.946225224-07:00 [INFO] Opening main db
2024-08-05T22:11:22.946525154-07:00 [INFO] new;
2024-08-05T22:11:22.946946456-07:00 [INFO] keep_updated;
2024-08-05T22:11:22.947764377-07:00 [INFO] Using git binary path: None
2024-08-05T22:11:22.975450766-07:00 [INFO] extensions updated. loading 2, reloading 0, unloading 0
2024-08-05T22:11:22.97810002-07:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-08-05T22:11:22.978152377-07:00 [INFO] Opening main db
2024-08-05T22:11:22.988219314-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.988280602-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.988300967-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.988319622-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.989890263-07:00 [INFO] XConnected server on 27262996, transport version: 0.0, TRANSPORT_MAX: 20
2024-08-05T22:11:22.990434308-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.991432187-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.991468801-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.991496123-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.9915212-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:22.991560248-07:00 [INFO] perform;
2024-08-05T22:11:22.991623093-07:00 [INFO] read_command;
2024-08-05T22:11:22.991676193-07:00 [INFO] read_command;
2024-08-05T22:11:22.99192611-07:00 [INFO] socket reader;
2024-08-05T22:11:22.994407145-07:00 [INFO] Using Visual { id: 130, colormap: 0, depth: 32 }
2024-08-05T22:11:22.994487762-07:00 [INFO] Creating colormap 102760451
2024-08-05T22:11:23.000397876-07:00 [INFO] new;
2024-08-05T22:11:23.001220526-07:00 [INFO] keep_updated;
2024-08-05T22:11:23.017974244-07:00 [INFO] Enabling Vulkan Portability
2024-08-05T22:11:23.018007762-07:00 [INFO] Enabling color space support
2024-08-05T22:11:23.024638779-07:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux)
2024-08-05T22:11:23.024859302-07:00 [INFO] set status on client 0: Authenticating
2024-08-05T22:11:23.025099585-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:23.025665859-07:00 [INFO] perform;
2024-08-05T22:11:23.025712955-07:00 [INFO] read_command;
2024-08-05T22:11:23.025763545-07:00 [INFO] read_command;
2024-08-05T22:11:23.025857791-07:00 [INFO] socket reader;
2024-08-05T22:11:23.034015225-07:00 [INFO] new;
2024-08-05T22:11:23.034674758-07:00 [INFO] keep_updated;
2024-08-05T22:11:23.03519999-07:00 [INFO] set status on client 196135: Connecting
2024-08-05T22:11:23.136948394-07:00 [INFO] set environment variables from shell:/usr/bin/zsh, path:~/local/gbdk/bin:/home/vforge/.pyenv/shims:/home/linuxbrew/.linuxbrew/opt/[email protected]/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:~/local/gbdk/bin:/home/linuxbrew/.linuxbrew/opt/[email protected]/bin:/home/linuxbrew/.linuxbrew/bin:/home/vforge/.cargo/bin:/home/vforge/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/vforge/.local/share/JetBrains/Toolbox/scripts:/home/vforge/.local/share/JetBrains/Toolbox/scripts
2024-08-05T22:11:23.320319654-07:00 [WARN] request completed with error: failed to connect to the server
2024-08-05T22:11:23.544220155-07:00 [INFO] Node runtime install_if_needed
2024-08-05T22:11:23.628745331-07:00 [INFO] starting language server. binary path: "/home/vforge/.local/share/zed/node/node-v22.5.1-linux-x64/bin/node", working directory: "/", args: ["/home/vforge/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-08-05T22:11:23.717502906-07:00 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc
2024-08-05T22:11:23.908455316-07:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-06T05:11:23.904Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-08-06T05:11:23.904Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-08-05T22:11:23.910015702-07:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "3fee10bc-8f9c-46b3-8cac-f66b0ea6e2be",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-08-05T22:11:24.241125023-07:00 [INFO] add connection to peer
2024-08-05T22:11:24.241196835-07:00 [INFO] add_connection;
2024-08-05T22:11:24.241252295-07:00 [INFO] waiting for server hello
2024-08-05T22:11:24.242139162-07:00 [INFO] got server hello
2024-08-05T22:11:24.242207568-07:00 [INFO] set status to connected (connection id: ConnectionId { owner_id: 0, id: 0 }, peer id: PeerId { owner_id: 466, id: 263273 })
2024-08-05T22:11:24.242276158-07:00 [INFO] set status on client 196135: Connected { peer_id: PeerId { owner_id: 466, id: 263273 }, connection_id: ConnectionId { owner_id: 0, id: 0 } }
2024-08-05T22:11:24.245247961-07:00 [ERROR] unable to construct a typed envelope connection_id=0/0 message_id=1
2024-08-05T22:11:24.435197749-07:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-08-06T05:11:24.429Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-08-06T05:11:24.429Z]",
  "extra": [
    "Telemetry initialized"
  ]
}

@lightningpwr28
Copy link

lightningpwr28 commented Aug 9, 2024

I had the same problem as you, and this fixed it.

If vkcube works fine and uses your dgpu, check if the file /etc/prime-discrete exists and has the contents ok\n. If it does, delete it.

I think Pop!_OS installs or sets up some nVidia stuff by default and throws Zed (specifically Zed's blade-graphics/src/vulkan/init.rs) through some loops.

I hope this helps!

@ViridianForge
Copy link

Thanks @lightningpwr28 - based on what you said, I also dug up this associated thread.

I went with switching /etc/prime-discrete from on to off and zed fired back over.

@natemcintosh
Copy link
Author

This worked for me! my /etc/prime-discrete had the contents on\n, and I switched it to off\n, and now my GPU is used by zed! I guess this particular issue is a Pop!_OS particular issue for zed?

@notpeter notpeter changed the title Using MESA_VK_DEVICE_SELECT to select Intel Arc device on linux not working Using MESA_VK_DEVICE_SELECT to select Intel Arc device on linux not working (PopOS) Aug 12, 2024
@bwnjnOEI
Copy link

bwnjnOEI commented Aug 13, 2024

Actually, I want Zed to run on Intel's integrated GPU rather than a discrete GPU (because I need to utilize the saved memory of discrete GPUs for such as model inference and training).

I tried this method from issue but Zed still runs on my discrete GPU.
I know that one of the goals is smooth encoding experience with using a discrete GPU, does it mean that Zed isn't allowed to run on integrated GPU?

selectable devices:
  GPU 0: 10de:2685 "NVIDIA GeForce RTX 4090 D" discrete GPU 0000:01:00.0
  GPU 1: 8086:a780 "Intel(R) Graphics (RPL-S)" integrated GPU 0000:00:02.0
  GPU 2: 10005:0 "llvmpipe (LLVM 15.0.7, 256 bits)" CPU 0000:00:00.0

System: pop_os! 22.04

@louiss0
Copy link

louiss0 commented Jan 27, 2025

Thanks @lightningpwr28 - based on what you said, I also dug up this associated thread.

I went with switching /etc/prime-discrete from on to off and zed fired back over.

This also worked for me as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] linux linux-x11 Linux X11 support User support (non-defect troubleshooting, documentation, etc)
Projects
None yet
Development

No branches or pull requests

6 participants