Askannz / optimus-manager

A Linux program to handle GPU switching on Optimus laptops.
MIT License
2.25k stars 165 forks source link

Long Boot Times #525

Closed music-cat-bread closed 1 week ago

music-cat-bread commented 1 year ago

Describe the bug After installing optimus-manager package from aur, it's boot time is @1.720s +8.850s according to systemd-analyze critical-chain

System info Distro: Arch Linux Desktop Manager: KDE Display Manager: SDDM optimus-manager version: 1.4-4 (non git package) optimus-manager config file:

[amd]
DRI=3
driver=modesetting
tearfree=

[intel]
DRI=3
accel=
driver=modesetting
modeset=yes
tearfree=

[nvidia]
DPI=96
PAT=yes
allow_external_gpus=no
dynamic_power_management=fine
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
auto_logout=yes
pci_power_control=no
pci_remove=no
pci_reset=no
startup_auto_battery_mode=integrated
startup_auto_extpower_mode=nvidia
startup_mode=hybrid
switching=none

Logs /var/log/optimus-manager/switch/

[23] INFO: # Xorg pre-start hook
[23] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'hybrid', 'current_mode': None}
[23] INFO: Requested mode is: hybrid
[2507] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[2507] INFO: Unloading modules ['nouveau'] (if loaded)
[2511] INFO: switching=none, nothing to do
[2583] INFO: Setting Nvidia PCI power state to auto
[2631] INFO: Writing "auto" to /sys/bus/pci/devices/0000:01:00.0/power/control
[2640] INFO: Loading module nvidia
[6141] INFO: Loading module nvidia_drm
[8453] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[8453] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20221017T082216', 'requested_mode': 'hybrid'}
[8453] INFO: Xorg pre-start hook completed successfully.
[6] INFO: # Xorg post-start hook
[6] INFO: Running /etc/optimus-manager/xsetup-hybrid.sh
[17] INFO: Writing state {'type': 'done', 'switch_id': '20221017T082216', 'current_mode': 'hybrid'}
[17] INFO: Xorg post-start hook completed successfully.
[9] INFO: # Pre-suspend hook
[9] INFO: Previous state was: {'type': 'done', 'switch_id': '20221017T082216', 'current_mode': 'hybrid'}
[10] INFO: Switching option: none
[11] INFO: Nothing to do
[11] INFO: Writing state {'type': 'pending_post_resume', 'switch_id': '20221017T082216', 'current_mode': 'hybrid'}
[11] INFO: Pre-suspend hook completed successfully.
[14] INFO: # Post-resume hook
[14] INFO: Previous state was: {'type': 'pending_post_resume', 'switch_id': '20221017T082216', 'current_mode': 'hybrid'}
[18] INFO: Nothing to do
[18] INFO: Writing state {'type': 'done', 'switch_id': '20221017T082216', 'current_mode': 'hybrid'}
[18] INFO: Post-resume hook completed successfully.

/var/log/optimus-manager/daemon/

[48] INFO: # Daemon pre-start hook
[48] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[50] INFO: Copying /etc/optimus-manager/optimus-manager.conf to /var/lib/optimus-manager/tmp/config_copy.conf
[56] INFO: Startup mode is: hybrid
[56] INFO: Writing state {'type': 'pending_pre_xorg_start', 'requested_mode': 'hybrid', 'current_mode': None}
[57] INFO: Daemon pre-start hook completed successfully.
[57] INFO: Calling Xorg pre-start hook.
[1] INFO: # Commands daemon
[1] INFO: Opening UNIX socket
[1] INFO: Awaiting commands

My Notes: I have found this PR which adds -n argument to modinfo command, but after running cat /usr/lib/python3.10/site-packages/optimus_manager/checks.py | grep "modinfo" the output is:

f"modinfo {module_name}",
nwildner commented 1 week ago

Hi @music-cat-bread .

If you look at the PR referenced here, it is tagged 1.5 so, 1.4-4 will not have this enabled.

Since no other major version was released after 1.5 and the project is getting back on it's tracks last month, we suggest you to migrate to optimus-manager-git and test it again.

Use the -git package because a lot of PRs got also merged recently.