100% cpu with every scroll in LibreOffice

Yep, unfortunately “GDK_DEBUG=nogl” does not help. Disabling hardware-acceleration and/or anti-aliasing in the options menus does not help either like SAL_NOOPENGL. The only fix seems to be “SAL_USE_VCLPLUGIN=gen”

FYI: if you uninstall the package “libreoffice-gtk3” in your template VM, you basically have the same effect as “SAL_USE_VCLPLUGIN=gen libreoffice” in every AppVM.

Tnx to a colleague of mine who found out that using QT/KDE as VCLPLUGIN solves the issue even better (looking). Thus, do the following:

  1. dnf remove libreoffice-gtk3
  2. dnf install libreoffice-kf5
  3. export SAL_USE_VCLPLUGIN=kf5

To make that change permanent, do it in your TemplateVM and put the export from step 3 into /etc/profile.d/libreoffice.sh

8 Likes

This works great when launching libreoffice from terminal / launcher, however when opening a file directly within nautilus, that env is never picked up and you get the “basic” UI. I’ve tried setting that env in many places that could be read, but so far I didn’t find any file located outside $HOME (so all appvms based on this template get to work without further changes) that could make it work.

Only workaround I found is to place the env directly at libreoffice executable, with the downside that once the file is replaced due to an update you’d need to change it again, but so far is the only one to make it work in all places (terminal/launcher/nautilus)

/usr/bin/soffice

put the export just before the last exec line

export SAL_USE_VCLPLUGIN=kf5

# oosplash does the rest: forcing pages in, javaldx etc. are
exec $RRCHECK $VALGRINDCHECK $STRACECHECK "$sd_prog/oosplash" "$@"

related:
https://bbs.archlinux.org/viewtopic.php?id=213807

3 Likes

I have the exact same problem. WTF! It’s unusable! (Recently updated to Q4.1 and I can’t use any office apps anymore).

1 Like

Although I would never put it past LibreOffice to be slow, if it’s worse after 4.1 upgrade you might want to make sure you’re not hitting the CPU frequency detection bug (adding xen-acpi-processor kernel module is the remediation if you are).

2 Likes

The variables defined in /etc/environment.d files aren’t visible by Qubes VMs (as verified via both an open terminal and a qvm-run -p). This is despite the fact that systemctl --user show-environment does show the variables as defined. What’s so broken?

Ah, ****! It looks like programs started via the qrexec mechanism don’t get any of the systemd session variables! How is this possible?

Yeah it looks like the qrexec-fork-server totally bypasses the requested user’s session and does its own thing. Why would it do that?

EDIT: Nothing here processes user session environment variables either:

Sigh.

EDIT 2: from the frustration comes the fix:

3 Likes

I work 3 days per month in LibreOffice Calc. This time was the first time (first day in Calc) on Qubes. It was soo slow. 3 seconds each time I clicked somewhere. I hope this will be addressed and resolved soon by the Qubes team.

2 Likes

Unfortunately the proposed solution is not satisfactory (Qubes 4.1 Fedora 34). I just noticed that there is a new Fedora template (Fedora 35). I am going tol test LibreOffice with Fedora 35 and report back.

1 Like

LibreOffice is still lagging on Fedora 35 template and it is not possible to work reasonably with it.

Could you please suggest any alternatives for Fedora and point to a installation guide?

Thank you.

1 Like

Try OnlyOffice.

There isn’t a repo for Fedora but you can download the AppImage in your AppVM.

If you want to add it to the Qubes Appmenu, follow this post:

1 Like

Thank you. Just to be sure: Is my assumption correct that you mean downloading and installing the AppImage in the TemplateVM? Only then can I use it permanently in the AppVM from my understanding.

No. the AppImage doesn’t require installation.

You can download it in any dispvm (if you want to keep your office-vm offline), then move it anywhere persistent in the AppVM, like /home/user or /rw.

If you want, you can move the AppImage to the TemplateVM, but place it in /etc/skel. This way, it’ll be placed in the home directory of every new AppVM created from this template.

Make sure you run chmod +x /PATH/TO/AppImage in order to make it executable. Then you can launch it from terminal or with an app shortcut like a mentioned before.

3 Likes

Thank you very much for the explanation.

I have tested LibreOffice again on Fedora 35 AppVM and I found out it depends on the display settings. It is just very slow over a 4k monitor. I don’t know if this problem can be solved easily, but all other applications run smoothly on 4k.

1 Like

I’ll get rid of my 4k monitor. Thanks…

After uninstalling the libreoffice-gtk3 package libreoffice runs faster, without lags, but the font in the app gui interface is very very small. This applies to vm based on debian 11 and fedora 36. My monitor has a resolution of 1920x1080.

How did you deal with this?

In libreoffice there is currently no way to change the font size in menus etc.

1 Like

Here is the real fix. Put this in /etc/profile.d/libreoffice_kf5.sh in your template qube:

export SAL_USE_VCLPLUGIN=kf5

Then install the following package in your template qube:

dnf install -y libreoffice-kf5

Stop your template qube and your application qube. Start your application qube and open up LibreOffice. It should run almost as fast as it used to.

Writeup is also here:

Does this now work reliably even when starting from within Nautilus (see 100% cpu with every scroll in LibreOffice - #29 by equbes)?

I also see that discussion in Make qubes-session inherit the systemd user session variables. by Rudd-O · Pull Request #151 · QubesOS/qubes-gui-agent-linux · GitHub resulted in you blogging about /etc/environment.d. How is this different from what you just recommended @Rudd-O?