Skip to content

Commit c9972ca

Browse files
authored
docs: Consolidate and improve organization of Linux GPU issue documentation (#32468)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
1 parent 9334e15 commit c9972ca

File tree

2 files changed

+80
-71
lines changed

2 files changed

+80
-71
lines changed

docs/src/development/linux.md

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -154,69 +154,3 @@ When this zed instance is exited, terminal output will include a command to run
154154
### Cargo errors claiming that a dependency is using unstable features
155155
156156
Try `cargo clean` and `cargo build`.
157-
158-
### Vulkan/GPU issues
159-
160-
If Zed crashes at runtime due to GPU or vulkan issues, you can try running [vkcube](https://github.com/krh/vkcube) (usually available as part of the `vulkaninfo` package on various distributions) to try to troubleshoot where the issue is coming from. Try running in both X11 and wayland modes by running `vkcube -m [x11|wayland]`. Some versions of `vkcube` use `vkcube` to run in X11 and `vkcube-wayland` to run in wayland.
161-
162-
If you have multiple GPUs, you can also try running Zed on a different one to figure out where the issue comes from. You can do so a couple different ways:
163-
Option A: with [vkdevicechooser](https://github.com/jiriks74/vkdevicechooser))
164-
Or Option B: By using the `ZED_DEVICE_ID={device_id}` environment variable to specify the device ID.
165-
166-
You can obtain the device ID of your GPU by running `lspci -nn | grep VGA` which will output each GPU on one line like:
167-
168-
```
169-
08:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [GeForce RTX 3070] [10de:2484] (rev a1)
170-
```
171-
172-
where the device ID here is `2484`. This value is in hexadecimal, so to force Zed to use this specific GPU you would set the environment variable like so:
173-
174-
```
175-
ZED_DEVICE_ID=0x2484
176-
```
177-
178-
Make sure to export the variable if you choose to define it globally in a `.bashrc` or similar
179-
180-
#### Reporting Vulkan/GPU issues
181-
182-
When reporting issues where Zed fails to start due to graphics initialization errors on GitHub, it can be impossible to run the `zed: copy system specs into clipboard` command like we instruct you to in our issue template. We provide an alternative way to collect the system specs specifically for this situation.
183-
184-
Passing the `--system-specs` flag to Zed like
185-
186-
```sh
187-
zed --system-specs
188-
```
189-
190-
will print the system specs to the terminal like so. It is strongly recommended to copy the output verbatim into the issue on GitHub, as it uses markdown formatting to ensure the output is readable.
191-
192-
Additionally, it is extremely beneficial to provide the contents of your Zed log when reporting such issues. The log is usually stored at `~/.local/share/zed/logs/Zed.log`. The recommended process for producing a helpful log file is as follows:
193-
194-
```sh
195-
truncate -s 0 ~/.local/share/zed/logs/Zed.log # Clear the log file
196-
ZED_LOG=blade_graphics=info zed .
197-
cat ~/.local/share/zed/logs/Zed.log
198-
# copy the output
199-
```
200-
201-
Or, if you have the Zed cli setup, you can do
202-
203-
```sh
204-
ZED_LOG=blade_graphics=info /path/to/zed/cli --foreground .
205-
# copy the output
206-
```
207-
208-
It is also highly recommended when pasting the log into a github issue, to do so with the following template:
209-
210-
> **_Note_**: The whitespace in the template is important, and will cause incorrect formatting if not preserved.
211-
212-
````
213-
<details><summary>Zed Log</summary>
214-
215-
```
216-
{zed log contents}
217-
```
218-
219-
</details>
220-
````
221-
222-
This will cause the logs to be collapsed by default, making it easier to read the issue.

docs/src/linux.md

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,18 @@ If you see an error like "/lib64/libc.so.6: version 'GLIBC_2.29' not found" it m
126126

127127
### Graphics issues
128128

129-
### Zed fails to open windows
129+
#### Zed fails to open windows
130130

131131
Zed requires a GPU to run effectively. Under the hood, we use [Vulkan](https://www.vulkan.org/) to communicate with your GPU. If you are seeing problems with performance, or Zed fails to load, it is possible that Vulkan is the culprit.
132132

133-
If you see a notification saying `Zed failed to open a window: NoSupportedDeviceFound` this means that Vulkan cannot find a compatible GPU. You can begin troubleshooting Vulkan by installing the `vulkan-tools` package and running:
133+
If you see a notification saying `Zed failed to open a window: NoSupportedDeviceFound` this means that Vulkan cannot find a compatible GPU. you can try running [vkcube](https://github.com/krh/vkcube) (usually available as part of the `vulkaninfo` or `vulkan-tools` package on various distributions) to try to troubleshoot where the issue is coming from like so:
134134

135-
```sh
135+
```
136136
vkcube
137137
```
138138

139+
> **_Note_**: Try running in both X11 and wayland modes by running `vkcube -m [x11|wayland]`. Some versions of `vkcube` use `vkcube` to run in X11 and `vkcube-wayland` to run in wayland.
140+
139141
This should output a line describing your current graphics setup and show a rotating cube. If this does not work, you should be able to fix it by installing Vulkan compatible GPU drivers, however in some cases (for example running Linux on an Arm-based MacBook) there is no Vulkan support yet.
140142

141143
You can find out which graphics card Zed is using by looking in the Zed log (`~/.local/share/zed/logs/Zed.log`) for `Using GPU: ...`.
@@ -147,16 +149,89 @@ On some systems the file `/etc/prime-discrete` can be used to enforce the use of
147149
On others, you may be able to the environment variable `DRI_PRIME=1` when running Zed to force the use of the discrete GPU.
148150

149151
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))
150-
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))
151152

152-
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.
153+
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))
153154

154155
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)).
155156

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

159+
#### Forcing Zed to use a specific GPU
160+
161+
There are a few different ways to force Zed to use a specific GPU:
162+
163+
##### Option A
164+
165+
You can use the `ZED_DEVICE_ID={device_id}` environment variable to specify the device ID of the GPU you wish to have Zed use.
166+
167+
You can obtain the device ID of your GPU by running `lspci -nn | grep VGA` which will output each GPU on one line like:
168+
169+
```
170+
08:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [GeForce RTX 3070] [10de:2484] (rev a1)
171+
```
172+
173+
where the device ID here is `2484`. This value is in hexadecimal, so to force Zed to use this specific GPU you would set the environment variable like so:
174+
175+
```
176+
ZED_DEVICE_ID=0x2484 zed
177+
```
178+
179+
Make sure to export the variable if you choose to define it globally in a `.bashrc` or similar.
180+
181+
##### Option B
182+
183+
If you are using Mesa, 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.
184+
185+
##### Option C
186+
187+
Using [vkdevicechooser](https://github.com/jiriks74/vkdevicechooser).
188+
189+
#### Reporting graphics issues
190+
158191
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.
159192

193+
When reporting issues where Zed fails to start due to graphics initialization errors on GitHub, it can be impossible to run the `zed: copy system specs into clipboard` command like we instruct you to in our issue template. We provide an alternative way to collect the system specs specifically for this situation.
194+
195+
Passing the `--system-specs` flag to Zed like
196+
197+
```sh
198+
zed --system-specs
199+
```
200+
201+
will print the system specs to the terminal like so. It is strongly recommended to copy the output verbatim into the issue on GitHub, as it uses markdown formatting to ensure the output is readable.
202+
203+
Additionally, it is extremely beneficial to provide the contents of your Zed log when reporting such issues. The log is usually located at `~/.local/share/zed/logs/Zed.log`. The recommended process for producing a helpful log file is as follows:
204+
205+
```sh
206+
truncate -s 0 ~/.local/share/zed/logs/Zed.log # Clear the log file
207+
ZED_LOG=blade_graphics=info zed .
208+
cat ~/.local/share/zed/logs/Zed.log
209+
# copy the output
210+
```
211+
212+
Or, if you have the Zed cli setup, you can do
213+
214+
```sh
215+
ZED_LOG=blade_graphics=info /path/to/zed/cli --foreground .
216+
# copy the output
217+
```
218+
219+
It is also highly recommended when pasting the log into a github issue, to do so with the following template:
220+
221+
> **_Note_**: The whitespace in the template is important, and will cause incorrect formatting if not preserved.
222+
223+
````
224+
<details><summary>Zed Log</summary>
225+
226+
```
227+
{zed log contents}
228+
```
229+
230+
</details>
231+
````
232+
233+
This will cause the logs to be collapsed by default, making it easier to read the issue.
234+
160235
### I can't open any files
161236

162237
### Clicking links isn't working

0 commit comments

Comments
 (0)