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

100% CPU usage on ZED #3336

Closed
mcphee11 opened this issue Jul 24, 2024 · 12 comments
Closed

100% CPU usage on ZED #3336

mcphee11 opened this issue Jul 24, 2024 · 12 comments

Comments

@mcphee11
Copy link

100% CPU usage on ZED

NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os

https://zed.dev/
ZED Version 0.144.4

When running ZED on POP it makes the CPU jump up to 100% even when only opening the app and opening a single index.js file. I commented on an open issue with ZED @ zed-industries/zed#14240 (comment) the POP support team recommend I also open a case with the POP team as the kernal is different then Ubuntu so hoping you can help shed some light on this.

To Reproduced simply open a folder in zed on POP then open a file and scroll through the file and the CPU maxes. with VSCode this does not happen.

@mcphee11
Copy link
Author

I got a solution linked from anohter thread here: zed-industries/zed#14088 (comment) this seems to do the job. simply change the /etc/prime-discrete to off and happy days. Other people with POP_OS as also saying that this now works but it would be good to know why this is on by default? is this going to break somthing else? I can undersatnd being a default on the OS but im using a System76 supplied device so I would of thought the OS defaults would be what they need to be for best operation.

@finnar-bin
Copy link

@mcphee11 out of curiosity and since I'm not using a pop_os device, do you have an nvidia gpu? I keep seeing the workaround to turn prime-discrete off to resolve the issue with zed but since I have an nvidia gpu I'm hesitant in case it might break something.

@mcphee11
Copy link
Author

@mcphee11 out of curiosity and since I'm not using a pop_os device, do you have an nvidia gpu? I keep seeing the workaround to turn prime-discrete off to resolve the issue with zed but since I have an nvidia gpu I'm hesitant in case it might break something.

No im not using a nvidia gpu in my laptop, I have been looking into this more and while i have not tested it yet i think moving from x11 to Wayland might also be an answer. not sure if your on x11 but i assume you are if your running pop 22.04

@finnar-bin
Copy link

Yeah I'm on x11. I'll try if I can successfully move to wayland since I remember having a ton of issues with it a while back and I'm not sure if it's worth moving to it just to get zed working. Thanks for the update btw.

@mcphee11
Copy link
Author

So I just changed to Wayland and well once i turned the "prime-discrete" back on the CPU was high again then i turned it off and it then went low again. So im not wure how successful this will be for you. As im not running a nvidia gpu having this off does not seem to affect me but i understand your view. I was hoping one of the POP Devs could way in here as im out of my depth really and dont want to recommend something without knowing the full impacts. Goodluck and hopfully a POP member will comment to clear this up a little. Cheers

@finnar-bin
Copy link

I see, yeah I don't think I'd want to jump into wayland just yet. Thanks for the response though, I appreciate it.

@AndrewOt
Copy link

I am also running into this issue. For me, setting /etc/prime_discrete to off does not work
zed-industries/zed#17553

@AndrewOt
Copy link

tagging: @jackpot51

@AndrewOt
Copy link

AndrewOt commented Oct 4, 2024

@notpeter in the Zed repo was kind enough to point out that Pop!_OS ships with an older version of Mesa (my current installed version is 24.0.3) and that vulkan extension wasn't supported until Mesa the 24.1 release. So, we'll have to wait for the Pop maintainers to update this in the graphics driver packaging before we can run Zed on the GPU.

(I didn't know this before, but Mesa is an open source implementation of the Vulkan spec.)

@mcphee11
Copy link
Author

@notpeter in the Zed repo was kind enough to point out that Pop!_OS ships with an older version of Mesa (my current installed version is 24.0.3) and that vulkan extension wasn't supported until Mesa the 24.1 release. So, we'll have to wait for the Pop maintainers to update this in the graphics driver packaging before we can run Zed on the GPU.

(I didn't know this before, but Mesa is an open source implementation of the Vulkan spec.)

Interesting... How can i check what version of Mesa is running on my PopOS? I have just updated Zed to the latest as well as i do keep my PopOS up to date with updates and the CPU issue seems to no longer be an issue for me. Even with the "prime_discrete" back to its default of "on" which is great news as now I can run Zed without my fans running all the time. It would be nice to know why its now fixed though. I assume your right and Mesa is now updated... once i confirm the version ill close this issue if they align.

@AndrewOt
Copy link

@mcphee11 you can run vulkaninfo --summary

If you look at the issue linked above, I resolved the problem by upgrading my Nvidia driver.

@mcphee11
Copy link
Author

I am going to close this case as this issue no longer happens to me withh Zed 0.157.5 and POP_OS 22.04. Thanks all for the help. For future readers I no longer need to ahve prime_discrete set to off either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants