alacritty: One-time very slow startup and high CPU usage on v0.3.0

Ubuntu 18.04, X11, i3, no compositor

I just updated from Alacritty v0.2.9 to v0.3.0 (using the .deb packages), and thought for a minute or two that the new version was totally broken – launching Alacritty would make a window titlebar appear, but it wouldn’t render anything (the contents of the window were just the last thing to render on that bit of screen), and based on the noise my CPU fan started making it seemed to use 100% of a CPU core. I started a couple of instances and they all did the same thing; I had time to start an alacritty -vvv in xterm, which printed the following and then hung:

$ alacritty -vvv
Created log file at "/tmp/Alacritty-17634.log"
[2019-04-12 00:35] [INFO] Welcome to Alacritty
[2019-04-12 00:35] [INFO] Configuration loaded from "/home/josh/.config/alacritty/alacritty.yml"
[2019-04-12 00:35] [INFO] Device pixel ratio: 1
[2019-04-12 00:35] [INFO] Width: 1920, Height: 1027
[2019-04-12 00:35] [INFO] Initializing glyph cache...

I ctrl-C’d it and ran another instance, and it also hung; a few seconds after I killed that one, all the Alacritty windows I opened previously closed at once (I’d tried to use i3 to close them previously, but obviously they didn’t), and running a new alacritty -vvv worked fine:

$ alacritty -vvv
Created log file at "/tmp/Alacritty-17830.log"
[2019-04-12 00:36] [INFO] Welcome to Alacritty
[2019-04-12 00:36] [INFO] Configuration loaded from "/home/josh/.config/alacritty/alacritty.yml"
[2019-04-12 00:36] [INFO] Device pixel ratio: 1
[2019-04-12 00:36] [INFO] Width: 1920, Height: 1027
[2019-04-12 00:36] [INFO] Initializing glyph cache...
[2019-04-12 00:36] [INFO] ... finished initializing glyph cache in 0.096654427s
// etc etc

After that, everything seems to work normally.

I tried uninstalling/reinstalling Alacritty, but that hasn’t triggered this again. I haven’t tested yet if it happens after a reboot.

I also believe I tried running 3e36d714f and didn’t have this problem, but I couldn’t say for sure (that’s purely based on where my git HEAD is currently, I don’t remember why I would have compiled that commit).

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 27 (11 by maintainers)

Most upvoted comments

After a lot of work I was finally able to pinpoint and eventually solve my problem. It turns out this may not be related to the original problem described in this issue. Apologies for that.

I turned on nouveau debugging by ading nouveau.debug=trace to my kernel parameters in grub. Then after booting I could see that upon starting alacritty (or any of the glutin examples) I noticed the nouveau driver woke up my discrete GPU and this is what was causing the delay. Upon investigating the glutin source code, I was able to pinpoint the exact code that was triggering this and that turned out to be EGL extension enumeration. Basically at startup time it asks for supported GL extensions and that caused my discrete GPU to wake and cause a delay.

Fast forward to today while doing system backups I noticed the nvidia-utils package was installed which wasn’t the case when I did my last backup weeks ago. Upon looking at the files insalled by that package, I noticed /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf was one of them. In that file, I immediately spotted references to Intel i935 which was something I had also spotted in the flamegraphs I posted a while back. Uninstalling that package immediately solved my problem! My guess is that the X11 config installed by this package somehow caused conflicts with nouveau and/or wayland.

Case closed on my side. Though again I apologise for hijacking this issue with a totally different one …

Both glutin v0.21.0 and master exhibit the intermitent startup delay. as such I think we can conclude this is an issue with glutin. Why this wasn’t happening ~2 weeks ago on my machine is still a mystery

@jfchevrette According to your trace it seems like it’s not alacritty problem. Would you mind testing glutin v0.21.0 and master window examples, you can run it with cargo run --example window?

@chrisduerr He is on sway, so he can’t use them. It seems like it’s i965 intel driver. I’m also using it on my laptop though and never experienced such problems.

@jfchevrette Would you mind providing us some information about your system CPU/GPU (multiple GPUs) or something like that. I recommend you to run alacritty under strace and see, when the output slow downs.

@chrisduerr I assumed as much when it worked fine after building from source - please ignore my comment. Apologies if I created any confusion and thanks for the help.

Please note that if you’re getting a lot of fontconfig errors, the problem is that the binary is not compatible with your system and you need to get a different binary or compile it from source.

That is not covered by this issue and is intentional (as in, we can’t do anything about that other than build for more platforms).