QOS
December 29, 2021, 8:33pm
26
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”
QOS
January 15, 2022, 3:34pm
27
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.
QOS
January 28, 2022, 12:50pm
28
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:
dnf remove libreoffice-gtk3
dnf install libreoffice-kf5
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
equbes
February 22, 2022, 7:43pm
29
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
Rudd-O
February 23, 2022, 12:19pm
30
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
gust
February 23, 2022, 3:57pm
31
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).
THANK YOU! So glad you took the time to write that. With one command line my system is flying.
I assume the thread you reference is this one:
…where people have been working on this for years (and I benefit from it in an instant!).
That was definitely it as (per the thread) xenpm get-cpufreq-para was failing on all cores but worked after loading xen-acpi-processor. Vm launch issues are gone.
For anyone unaccustomed to loading kernel modules (like me), these are the commands:
sudo modprobe…
opened 10:23PM - 12 Dec 18 UTC
T: bug
C: Xen
P: major
r4.1-buster-stable
hardware support
r4.1-bullseye-stable
r4.1-dom0-stable
needs diagnosis
pr submitted
r4.1-centos-stream8-cur-test
r4.1-bookworm-stable
r4.2-host-cur-test
affects-4.1
affects-4.2
### Qubes OS version:
<!-- (e.g., `R3.2`)
You can get it from the dom0 te… rminal with the command
`cat /etc/qubes-release`
Type below this line. -->
R4.0
### Affected component(s):
intel_pstate
acpi-cpufreq
xenpm
---
### Steps to reproduce the behavior:
<!-- Use single backticks (`) for in-line code snippets and
triple backticks (```) for code blocks.
Type below this line. -->
Tested on:
- Lenovo T480s
- Lenovo X1 Carbon Gen. 6
- Huawei Matebook X Pro.
All with Intel i7-8550U.
Latest BIOS revisions for the respective systems as of Dec. 2018
Kernel: 4.19.2-3.pvops.qubes.x86_64.
EFI install.
In dom0, `sudo xenpm get-cpufreq-para`
### Expected behavior:
The processor is rated at 1.8 GHz (4.0 turbo), so we would expect to see appropriate scaling in that range, available frequencies from 1800000 - 4000000.
Further, we would expect to see `scaling_driver = intel_pstate`.
### Actual behavior:
The CPU frequencies do not scale correctly. Why?
Frequencies are pinned at 2 GHz max, 400 MHz min, across all cores.
```
# xenpm cpu-freq-para
...
cpu id : 0
affected_cpus : 0
cpuinfo frequency : max [2001000] min [400000] cur [2001000]
scaling_driver : acpi-cpufreq
scaling_avail_gov : userspace performance powersave ondemand
current_governor : ondemand
ondemand specific :
sampling_rate : max [10000000] min [10000] cur [20000]
up_threshold : 80
scaling_avail_freq : 2001000 2000000 1900000 1800000 1700000 1500000 1400000 1300000 1200000 1100000 1000000 800000 700000 600000 500000 *400000
scaling frequency : max [2001000] min [400000] cur [400000]
turbo mode : enabled
...
```
Confirmed with `watch -n1 "cat /proc/cpuinfo | grep \"[c]pu MHz\""`
`xenpm set-scaling-maxfreq` and `-minfreq` have no effect.
`xenpm get-cpufreq-states` shows 16 total/usable P-states.
Changing the governor to `performance` has no effect. Default is `ondemand`
`dmidecode` reports a max of 2 GHz on the Lenovos, and an apparently erroneous speed on the Huawei (~ 8 GHz).
```
# dmidecode | grep -i speed
Speed: 2400 MT/s
Configured Clock Speed: 2400 MT/s
Speed: 2400 MT/s
Configured Clock Speed: 2400 MT/s
Speed: Unknown
Speed: Unknown
Speed: Unknown
Max Speed: 2000 MHz
Current Speed: 1800 MHz
```
The `scaling_driver` is legacy `acpi-cpufreq`. Interestingly, `intel_pstate` can be seen initializing during boot, but it does not take over handling anything. Attempting to `blacklist acpi-cpufreq` in `modprobe.d` has no effect.
```
# dmesg | grep pstate
[ 5.067624] intel_pstate: Intel P-state driver initializing
```
`/sys/devices/system/cpu/intel_pstate/` contains the expected attributes, but as mentioned in the "related issue" linked below, `no_turbo`, `num_pstates`, and `turbo_pct` error `Resource temporarily unavailable`.
`/sys/devices/system/cpu/intel_pstate/status` always returns `off`, and does not respond to `echo "active" >`. This behavior has been tested with various kernel command line parameters, including `intel_pstate=force`, `intel_pstate=disabled`, `intel_pstate=no_hwp`, `intel_pstate=enable` with no change in performance aside from `../cpu/intel_pstate/` attributes disappearing when `no_hwp` or `disabled` were in effect. Also tried `processor.ignore_ppc=1`.
Strangely, none of the appropriate attributes for `cpufreq` exist in `/sys/devices/system/cpu/cpu*/`.
```
# ls /sys/devices/system/cpu/cpu0/
acpi_cppc driver hotplug power topology
cache firmware_node node0 subsystem uevent
```
`lsmod | grep cpufreq` shows no results, trying to `modprobe acpi-cpufreq` or `cpufreq-xen` returns errors. `xen_acpi_processor` is loaded.
```
# modprobe acpi-cpufreq
modprobe: ERROR: could not insert 'acpi_cpufreq': No such device
# modprobe cpufreq-xen
modprobe: FATAL: Module cpufreq-xen not found in directory /lib/modules/4.19.2-3.pvops.qubes.x86_64
```
`cpupower frequency-info` is completely unresponsive, with zero information available about the processor.
```
analyzing CPU 0:
no or unknown cpufreq driver is active on this CPU
CPUs which run at the same hardware frequency: Not Available
CPUs which need to have their frequency coordinated by software: Not Available
maximum transition latency: Cannot determine or is not supported.
Not Available
available cpufreq governors: Not Available
Unable to determine current policy
current CPU frequency: Unable to call hardware
current CPU frequency: Unable to call to kernel
boost state support:
Supported: yes
Active: yes
```
Though it shouldn't have any effect, testing was attempted with `smt=on` and `off`, and `Hyperthreading` enabled/disabled in the BIOS appropriately.
Testing was also performed while toggling various BIOS settings.
- enable/disable `Intel SpeedStep`
- power settings at `Maximum Performance` vs. `Balanced`
It does not appear to be a thermal throttling issue, with idle ~ 37*C and under load ~60*C observed consistently.
`tlp` was tested with no effect on the frequency scaling, regardless of being enabled or disabled. `tlp-stat` yields minimal additional info, with what seems to be an outdated recommendation for the Lenovos to install `tp-smapi kernel modules`, that are in fact deprecated in favor of `thinkpad_acpi`, which appears to be active on the Thinkpads.
```
dmesg | grep thinkpad
[ 19.589434] thinkpad_acpi: ThinkPad ACPI Extras v0.26
[ 19.589439] thinkpad_acpi: http://ibm-acpi.sf.net/
[ 19.589440] thinkpad_acpi: ThinkPad BIOS N22ET50W (1.27 ), EC unknown
[ 19.589441] thinkpad_acpi: Lenovo ThinkPad T480s, model 20L7CTO1WW
[ 19.591883] thinkpad_acpi: radio switch found; radios are enabled
[ 19.591898] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
[ 19.591899] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
[ 19.612278] thinkpad_acpi: rfkill switch tpacpi_wwan_sw: radio is unblocked
[ 19.643468] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one
[ 19.674512] thinkpad_acpi: battery 1 registered (start 0, stop 100)
[ 19.674576] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/
```
`thermald` is not loaded.
### General notes:
https://www.kernel.org/doc/html/v4.12/admin-guide/pm/intel_pstate.html
- This link suggests removing `irqbalance` but I'm skeptical.
https://askubuntu.com/questions/1067866/ubuntu-18-04-steam-games-frame-rate-drop/1073353#1073353?newreg=c7c120f373da4effb7317104571cd573
- https://cateee.net/lkddb/web-lkddb/XEN_ACPI_PROCESSOR.html
Regarding xen_acpi_processor: "It also registers itself as the SMM so that other drivers (such as ACPI cpufreq scaling driver) will not load."
How could `lsmod` report `xen_acpi_processor` as loaded but `xenpm` shows the scaling driver `acpi-cpufreq` ? This might make sense as to the missing `/sys/devices/.../cpufreq` entries.
- The following exchange is dubious at best, the final post gets down to the point of disabling intel microcode. They also suggest the use of `msr-tools`, but that really shouldn't be necessary.
https://bbs.archlinux.org/viewtopic.php?id=231077
- This is good work, but in my opinion, running a script every few seconds in dom0 isn't a legitimate fix.
https://github.com/erpalma/lenovo-throttling-fix
---
### Related issues:
https://github.com/QubesOS/qubes-issues/issues/4491
https://github.com/QubesOS/qubes-issues/issues/450
2 Likes
Rudd-O
February 23, 2022, 5:44pm
32
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?
Rudd-O
February 23, 2022, 5:45pm
33
Ah, ****! It looks like programs started via the qrexec mechanism don’t get any of the systemd session variables! How is this possible?
Rudd-O
February 23, 2022, 5:47pm
34
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:
#!/bin/bash
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
This file has been truncated. show original
Sigh.
EDIT 2: from the frustration comes the fix:
QubesOS:master
← Rudd-O:patch-1
opened 06:00PM - 23 Feb 22 UTC
The standard environment.d facility is currently not respected in Qubes OS 4.1. … This leads to inability to define environment variables when starting apps via qrexec¹.
This should be fixed. Here is the fix — it is a fix that will not have any substantial performance impact (it runs *once*), and uses documented APIs to execute on the fix.
¹ Technically there's `/etc/profile.d` but that's meant to be used for **shells**. There is no guarantee that apps started via qrexec will inherit these variables.
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:
You’re welcome!
If you prefer the tar method, and the app shortcut is the only thing holding you back:
[user@appvm ~]$ mkdir -p /home/user/.local/share/applications
[user@appvm ~]$ cat <<EOF > /home/user/.local/share/applications/discord.desktop
[Desktop Entry]
Type=Application
Terminal=false
Name=Discord
Exec=/PATH/TO/Discord
EOF
This will make the shortcut available to the menu.
Make sure to replace /PATH/TO/Discord appropriately.
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
MitchJ
June 28, 2022, 1:13pm
42
I’ll get rid of my 4k monitor. Thanks…
matik
September 21, 2022, 11:36am
43
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
Rudd-O
December 6, 2022, 10:36pm
44
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:
phl
December 7, 2022, 9:18am
45
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 ?