Home Explore Blog CI



zed

4th chunk of `docs/src/linux.md`
2cbbeff6158bb6d4daf38f88f4833aa4ea56e87d3324717a0000000100000835
On some systems the file `/etc/prime-discrete` can be used to enforce the use of a discrete GPU using [PRIME](https://wiki.archlinux.org/title/PRIME). Depending on the details of your setup, you may need to change the contents of this file to "on" (to force discrete graphics) or "off" (to force integrated graphics).

On others, you may be able to the environment variable `DRI_PRIME=1` when running Zed to force the use of the discrete GPU.

If you're using an AMD GPU and Zed crashes when selecting long lines, try setting the `ZED_PATH_SAMPLE_COUNT=0` environment variable. (See [#26143](https://github.com/zed-industries/zed/issues/26143))
If you're using an AMD GPU, you might get a 'Broken Pipe' error. Try using the RADV or Mesa drivers. (See [#13880](https://github.com/zed-industries/zed/issues/13880))

If you are using Mesa, and want more control over which GPU is selected you can run `MESA_VK_DEVICE_SELECT=list zed --foreground` to get a list of available GPUs and then export `MESA_VK_DEVICE_SELECT=xxxx:yyyy` to choose a specific device.

If you are using `amdvlk` you may find that zed only opens when run with `sudo $(which zed)`. To fix this, remove the `amdvlk` and `lib32-amdvlk` packages and install mesa/vulkan instead. ([#14141](https://github.com/zed-industries/zed/issues/14141)).

For more information, the [Arch guide to Vulkan](https://wiki.archlinux.org/title/Vulkan) has some good steps that translate well to most distributions.

If Vulkan is configured correctly, and Zed is still not working for you, please [file an issue](https://github.com/zed-industries/zed) with as much information as possible.

### I can't open any files

### Clicking links isn't working

These features are provided by XDG desktop portals, specifically:

- `org.freedesktop.portal.FileChooser`
- `org.freedesktop.portal.OpenURI`

Some window managers, such as `Hyprland`, don't provide a file picker by default. See [this list](https://wiki.archlinux.org/title/XDG_Desktop_Portal#List_of_backends_and_interfaces) as a starting point for alternatives.

### Zed isn't remembering my API keys

Title: Linux Troubleshooting: GPU Configuration, AMD GPU Issues, Vulkan Setup, and File/Link Opening Problems
Summary
This section provides further Linux troubleshooting tips for Zed. It covers configuring GPU usage using `/etc/prime-discrete` or the `DRI_PRIME` environment variable, and workarounds for AMD GPU issues, such as setting `ZED_PATH_SAMPLE_COUNT=0` or using RADV/Mesa drivers. It explains how to select a specific GPU using `MESA_VK_DEVICE_SELECT`. It also advises removing `amdvlk` if Zed only opens with `sudo`. The section refers to the Arch Linux Vulkan guide and encourages users to file an issue if problems persist after proper Vulkan configuration. Finally, it addresses issues with opening files and clicking links, explaining the reliance on XDG desktop portals and providing a link to a list of alternatives for window managers like Hyprland.