zed icon indicating copy to clipboard operation
zed copied to clipboard

Slow on Linux (Intel Integrated Graphics)

Open rayauxey opened this issue 1 year ago • 14 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Running zed on my linux machine is relatively slow compared to other editors. Scrolling lags and even highlighted items while moving the cursor are lagging. I suspect zed is not utilizing the integrated graphics. I have vulkan on my system and vkcube runs perfectly.

Environment

OS: Pop!_OS 22.04 LTS x86_64 CPU: Intel i7-8650U (8) @ 4.200GHz GPU: Intel UHD Graphics 620

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-07-10T20:24:05+03:00 [INFO] Enabling Vulkan Portability
2024-07-10T20:24:05+03:00 [INFO] Enabling color space support
2024-07-10T20:24:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux)
2024-07-10T20:24:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"
2024-07-10T20:24:05+03:00 [INFO] No ray tracing extensions are supported

rayauxey avatar Jul 10 '24 19:07 rayauxey

I'm also experiencing noticeable lag.

elementary OS 7.1 Horus (based on Ubuntu 22.04.3 LTS) CPU: Intel Core(TM) i7-3635QM CPU @ 2.40GHz 4 cores Intel HD Graphics 4000 NVIDIA® GeForce® GT® 640M

Gabriel-p avatar Jul 10 '24 21:07 Gabriel-p

Not sure if it's related to Intel. When running Zed even on external nvidia gpu it starts lagging on cpu-intensive task (Zed log confirms that it runs on external Nvidia GPU).

Arch Linux Intel i7-8550U + NVIDIA GeForce MX150

https://github.com/zed-industries/zed/assets/17229619/486f7880-74ab-45d1-8978-a1c0c29c70ef

0x241F31 avatar Jul 10 '24 21:07 0x241F31

I am also noticing a great amount of lag. My specs:

Screenshot from 2024-07-10 22-17-24

touhidrahman avatar Jul 11 '24 02:07 touhidrahman

+1

DoKoB0512 avatar Jul 11 '24 06:07 DoKoB0512

Can confirm that not related to Intel. Fedora 40 (Gnome / wayland), Intel N200 (4 core, 4 threads), no gpu, works fine

Akiyamka avatar Jul 12 '24 13:07 Akiyamka

It seems to be a Pop OS issue I have downloaded zed on a weaker laptop that uses Fedora and it has good performance.

rayauxey avatar Jul 12 '24 18:07 rayauxey

Not having this issue. image

culebron avatar Jul 12 '24 20:07 culebron

I have same snippet in my logs: 2024-07-13T10:17:05+03:00 [INFO] keep_updated; 2024-07-13T10:17:05+03:00 [INFO] Enabling Vulkan Portability 2024-07-13T10:17:05+03:00 [INFO] Enabling color space support 2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)" 2024-07-13T10:17:05+03:00 [INFO] No ray tracing extensions are supported

though my laptop does not have nvidia. lspci: 00:00.0 Host bridge: Intel Corporation Device a708 (rev 01) 00:02.0 VGA compatible controller: Intel Corporation Device a7a1 (rev 04) 00:06.0 PCI bridge: Intel Corporation Device a74d (rev 01) 00:07.0 PCI bridge: Intel Corporation Device a76e (rev 01) 00:0a.0 Signal processing controller: Intel Corporation Device a77d (rev 01) 00:0d.0 USB controller: Intel Corporation Device a71e (rev 01) 00:0d.2 USB controller: Intel Corporation Device a73e (rev 01) 00:14.0 USB controller: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller (rev 01) 00:14.2 RAM memory: Intel Corporation Alder Lake PCH Shared SRAM (rev 01) 00:14.3 Network controller: Intel Corporation Device 51f1 (rev 01) 00:15.0 Serial bus controller: Intel Corporation Alder Lake PCH Serial IO I2C Controller #0 (rev 01) 00:15.1 Serial bus controller: Intel Corporation Alder Lake PCH Serial IO I2C Controller #1 (rev 01) 00:1c.0 PCI bridge: Intel Corporation Device 51bd (rev 01) 00:1f.0 ISA bridge: Intel Corporation Device 519d (rev 01) 00:1f.3 Audio device: Intel Corporation Device 51ca (rev 01) 00:1f.4 SMBus: Intel Corporation Alder Lake PCH-P SMBus Host Controller (rev 01) 00:1f.5 Serial bus controller: Intel Corporation Alder Lake-P PCH SPI Controller (rev 01) 01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 2d:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)

capacman avatar Jul 13 '24 07:07 capacman

Same issue on my Ubuntu 24, moving up and down the lines even with keyboard feels very laggy. I am using Nvidia 1050ti GPU.

back2Lobby avatar Jul 13 '24 09:07 back2Lobby

Not sure why this got renamed to be a Pop!_OS issue. I'm running elementary OS and I also experience it, as do other people running other systems

Gabriel-p avatar Jul 13 '24 12:07 Gabriel-p

I am having the same problem.

Hardware Model: HP Laptop 15-da0xxx Processor: Intel Core i3-7020U CPU @ 2.30 GHz x 4 Graphics: Mesa Intel HD Graphics 620 (KBL GT2) OS: Pop!_OS 22.04 LTS Windowing System: X11

zytact avatar Jul 14 '24 12:07 zytact

For me, the editor does not start at all when in iGPU mode: OS: openSUSE Tumbleweed 20240712 x86_64 Host: 83GS (LOQ 15IAX9) Kernel: Linux 6.9.7-1-default CPU: 12th Gen Intel(R) Core(TM) i5-12450HX (12) @ 4.40 GHz GPU: Intel UHD Graphics @ 1.30 GHz [Integrated] Windowing System: X11(KDE Plasma 6.1.2)

but it runs well in dGPU mode(RTX 3050 6GB)

AnshumaanMishra avatar Jul 14 '24 17:07 AnshumaanMishra

manjaro/ intel hd also slow

hel8er avatar Jul 14 '24 23:07 hel8er

same issue on Kali / AMD

gaaash avatar Jul 14 '24 23:07 gaaash

I experienced the same issue on NixOS. I have a dedicated graphics card.

Hardware Information:

  • Hardware Model: ASUSTeK COMPUTER INC. P8Z77-V
  • Memory: 16.0 GiB
  • Processor: Intel® Core™ i7-3770K × 8
  • Graphics: NV136
  • Disk Capacity: 3.0 TB

Software Information:

  • Firmware Version: 1616
  • OS Name: NixOS 24.05 (Uakari)
  • OS Build: 24.05.2539.49ee0e94463a
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.6.37

DavidJS01 avatar Jul 15 '24 09:07 DavidJS01

Zed starts almost instantly (<1s) for me.

Hardware Information: Hardware Model: HP Pavilion x360 Convertible 14-cd0xxx Memory: 7677.0 MiB CPU: Intel i3-8130U (4) @ 3.400GHz GPU: Intel UHD Graphics 620

Software Information: OS Name: Arch Linux x86_64 OS Type: 64-bit Window Manager: Hyprland Windowing System: Wayland Kernel Version: 6.9.9-zen1-1-zen

Edit: Scrolling and Rendering is fine for me as well.

MehulKhanna avatar Jul 15 '24 15:07 MehulKhanna

Zed starts at a good speed compared to others on my device, approx <3s

Specs: RAM: 8gb CPU : Intel Xeon processor (of 2017 or 2018) with integrated GPU Os: Arch linux with Kde plasma 6(with latest version of plasma), Wayland

Edit: Scrolling and rendering stuffs also works fine but Sometimes some text rendered half either cut from top or bottom

bajrangCoder avatar Jul 15 '24 15:07 bajrangCoder

i dont think this is about startup speed, its about rendering and latency. In my case scrolling file make zed process to consume %100 percent of the cpu(an entire core) and typing is not smooth

capacman avatar Jul 15 '24 15:07 capacman

I have tried manually accelerating zed but still getting lag.

My machine specs.

OS: Pop!_OS 22.04 LST x86_6 Gnome 42.9 GPU: Interl UHD Graphics 620 Memomry: 16gb CPU: Intel i7-8650U (8) @ 4

shadmeoli avatar Jul 15 '24 19:07 shadmeoli

I think i found the solution at least for me. As i mentioned before in my zed logs i found below lines:

2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"

My laptop,system76 lemur pro, does not have any nvidia and i searched source code and found that zed is using blade library. https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L128 line is printing above warning. That warning is behind an if condition https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L116 and in some part it is checking for file called "/etc/prime-discrete" with a content "on" https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L50

I edit the file /etc/prime-discrete and change the on string to off(actually any content other than on can work). Now in my zed logs i can see below line and cpu usage is about 2-3% :) which is nice

2024-07-15T22:30:36+03:00 [INFO] Adapter "Intel(R) Graphics (RPL-U)"

In the mean time you should be careful if you have nvidia prime because /etc/prime-discrete file should be related to that tech .

capacman avatar Jul 15 '24 19:07 capacman

I think i found the solution at least for me. As i mentioned before in my zed logs i found below lines:

2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"

My laptop,system76 lemur pro, does not have any nvidia and i searched source code and found that zed is using blade library. https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L128 line is printing above warning. That warning is behind an if condition https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L116 and in some part it is checking for file called "/etc/prime-discrete" with a content "on" https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L50

I edit the file /etc/prime-discrete and change the on string to off(actually any content other than on can work). Now in my zed logs i can see below line and cpu usage is about 2-3% :) which is nice

2024-07-15T22:30:36+03:00 [INFO] Adapter "Intel(R) Graphics (RPL-U)"

In the mean time you should be careful if you have nvidia prime because /etc/prime-discrete file should be related to that tech .

This actually works.

shadmeoli avatar Jul 15 '24 19:07 shadmeoli

Quite a wide range of iGPU here. I see one that is 7 years old, and one that is 12 years old. That may have an impact on performance due to drivers if they even have vulkan drivers.

But you can see above that some are having LLVM pipe forced (CPU rendering) which will be even slower on old hardware.

Lastly if /etc/prime-discrete is "on", then it is expected that the user has set this so that their X11 desktop uses dGPU not iGPU. However I think here is where you might begin hitting issues - if you have this set (with the assumption that the related Xorg configs are also forced to dGPU) but are running a Wayland desktop it is (the xorg conf) completely ignored by pretty much every vulkan app around.

TLDR: if both iGPU and dGPU drivers fail then vulkan tries to use the last resort which is llvmpipe for cpu rendering and this is very slow.

flukejones avatar Jul 16 '24 00:07 flukejones

I think i found the solution at least for me. As i mentioned before in my zed logs i found below lines:

2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"

My laptop,system76 lemur pro, does not have any nvidia and i searched source code and found that zed is using blade library. https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L128 line is printing above warning. That warning is behind an if condition https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L116 and in some part it is checking for file called "/etc/prime-discrete" with a content "on" https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L50

I edit the file /etc/prime-discrete and change the on string to off(actually any content other than on can work). Now in my zed logs i can see below line and cpu usage is about 2-3% :) which is nice

2024-07-15T22:30:36+03:00 [INFO] Adapter "Intel(R) Graphics (RPL-U)"

In the mean time you should be careful if you have nvidia prime because /etc/prime-discrete file should be related to that tech .

This worked for me too.

zytact avatar Jul 16 '24 16:07 zytact

I think i found the solution at least for me. As i mentioned before in my zed logs i found below lines:

2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"

My laptop,system76 lemur pro, does not have any nvidia and i searched source code and found that zed is using blade library. https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L128 line is printing above warning. That warning is behind an if condition https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L116 and in some part it is checking for file called "/etc/prime-discrete" with a content "on" https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L50

I edit the file /etc/prime-discrete and change the on string to off(actually any content other than on can work). Now in my zed logs i can see below line and cpu usage is about 2-3% :) which is nice

2024-07-15T22:30:36+03:00 [INFO] Adapter "Intel(R) Graphics (RPL-U)"

In the mean time you should be careful if you have nvidia prime because /etc/prime-discrete file should be related to that tech .

please help me on AMD gpu s i'm using AMD Radeon 7400 HD

gaaash avatar Jul 16 '24 22:07 gaaash

I think i found the solution at least for me. As i mentioned before in my zed logs i found below lines:

2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"

My laptop,system76 lemur pro, does not have any nvidia and i searched source code and found that zed is using blade library. https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L128 line is printing above warning. That warning is behind an if condition https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L116 and in some part it is checking for file called "/etc/prime-discrete" with a content "on" https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L50

I edit the file /etc/prime-discrete and change the on string to off(actually any content other than on can work). Now in my zed logs i can see below line and cpu usage is about 2-3% :) which is nice

2024-07-15T22:30:36+03:00 [INFO] Adapter "Intel(R) Graphics (RPL-U)"

In the mean time you should be careful if you have nvidia prime because /etc/prime-discrete file should be related to that tech .

This worked for me as well using pop_os! on one of system76's meerkat 8's!! I had 100% cpu usage and temps were skyrocketing. I didn't have the same problem on the amd framework13 with pop os.

asenetcky avatar Jul 18 '24 12:07 asenetcky

For me, the editor does not start at all when in iGPU mode: OS: openSUSE Tumbleweed 20240712 x86_64 Host: 83GS (LOQ 15IAX9) Kernel: Linux 6.9.7-1-default CPU: 12th Gen Intel(R) Core(TM) i5-12450HX (12) @ 4.40 GHz GPU: Intel UHD Graphics @ 1.30 GHz [Integrated] Windowing System: X11(KDE Plasma 6.1.2)

but it runs well in dGPU mode(RTX 3050 6GB)

The issue was resolved upon updating the vulkan drivers for my system and reinstalling the intel-specific vulkan drivers Steps followed:

$ sudo zypper rm libvulkan_intel
$ sudo zypper in libvulkan_intel
$ sudo reboot

Now, the lag is almost unnoticeable, although performance is not as good as using the dGPU

AnshumaanMishra avatar Jul 23 '24 14:07 AnshumaanMishra

Hey! If you are using latest kernel + latest intel/amd driver and it still slow, you should create a ticket here https://gitlab.freedesktop.org/mesa/mesa/-/issues it's project which responsible for your drivers. I believe even for hasvk possible improve to perfect Zed work.

stalkerg avatar Jul 28 '24 03:07 stalkerg

I think i found the solution at least for me. As i mentioned before in my zed logs i found below lines:

2024-07-13T10:17:05+03:00 [WARN] Rejecting Intel for not presenting when Nvidia is present (on Linux) 2024-07-13T10:17:05+03:00 [INFO] Adapter "llvmpipe (LLVM 15.0.7, 256 bits)"

My laptop,system76 lemur pro, does not have any nvidia and i searched source code and found that zed is using blade library. https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L128 line is printing above warning. That warning is behind an if condition https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L116 and in some part it is checking for file called "/etc/prime-discrete" with a content "on" https://github.com/kvark/blade/blob/473b71b20d492f753e1f6a938c0e60ac755762b0/blade-graphics/src/vulkan/init.rs#L50

I edit the file /etc/prime-discrete and change the on string to off(actually any content other than on can work). Now in my zed logs i can see below line and cpu usage is about 2-3% :) which is nice

2024-07-15T22:30:36+03:00 [INFO] Adapter "Intel(R) Graphics (RPL-U)"

In the mean time you should be careful if you have nvidia prime because /etc/prime-discrete file should be related to that tech .

this worked for me!

gannhiro avatar Aug 23 '24 17:08 gannhiro

Experienced the same issue on Intel Hardware, Ubuntu 24.10 and Flatpak.

A simple sudo rm /etc/prime-discrete solved the issue for me. Went for deletion over editing the content to off as I neither do have any NVidia hardware nor NVidia Prime library installed and no other installed packaged claimed ownership of this file on my system.

bentolor avatar Jan 13 '25 11:01 bentolor