Optimus manager doesn't work after upgrade

optimus-manager works fine yesterday. But today I upgrade my system by yay, I cant switch my gpu to nvidia.
Here is the output:

$ optimus-manager                                                          ✔ 
Traceback (most recent call last):
  File "/usr/bin/optimus-manager", line 33, in <module>
    sys.exit(load_entry_point('optimus-manager==1.4', 'console_scripts', 'optimus-manager')())
  File "/usr/bin/optimus-manager", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: optimus-manager

I found some upgrade history in pamac, is there something breaking the dependencies?

[2021-12-18T10:10:05+0800] [ALPM] upgraded optimus-manager (1.4-1 -> 1.4-3)
[2021-12-18T10:10:04+0800] [ALPM] upgraded inxi (3.3.10.1-1 -> 3.3.11.1-1)
[2021-12-18T10:10:04+0800] [ALPM] upgraded firefox-i18n-zh-cn (95.0-1 -> 95.0.1-1)
[2021-12-18T10:10:04+0800] [ALPM] upgraded firefox-i18n-en-us (95.0-1 -> 95.0.1-1)
[2021-12-18T10:10:04+0800] [ALPM] upgraded firefox (95.0-1 -> 95.0.1-0.1)

and I also reinstall the package and reboot my system, but it still doesn’t work.

EDIT:
Found some discussions here: AUR (en) - optimus-manager (archlinux.org),

check this - [Stable Update] 2021-12-16 - Kernels, KDE Gear 21.12.0, Gnome Extensions, LibreOffice - #53 by Dune

1 Like

i got the 1.4-3 version and that’s the one that broke it for me.
the Nvidia card doesn’t work and trying to switch to another card in optimus manager-qt brings an error:
unable to connect to optimus manager daemon:
no such file or directory.

systemctl status optimus-manager.service

optimus-manager.service - Optimus Manager Commands Daemon
     Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2021-12-18 17:43:19 IST; 44min ago
    Process: 575 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_daemon_start (code=exited, status=1/FAILURE)
    Process: 659 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_xorg_start (code=exited, status=1/FAILURE)
    Process: 665 ExecStart=/usr/bin/python3 -u -m optimus_manager.daemon (code=exited, status=1/FAILURE)
    Process: 677 ExecStopPost=/usr/bin/python3 -u -m optimus_manager.hooks.post_daemon_stop (code=exited, status=1/FAILURE)
   Main PID: 665 (code=exited, status=1/FAILURE)
        CPU: 135ms

systemd[1]: Starting Optimus Manager Commands Daemon...
python3[575]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.hooks.pre_daemon_start' >
python3[659]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.hooks.pre_xorg_start' (M>
systemd[1]: Started Optimus Manager Commands Daemon.
python3[665]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.daemon' (ModuleNotFoundE>
systemd[1]: optimus-manager.service: Main process exited, code=exited, status=1/FAILURE
python3[677]: /usr/bin/python3: Error while finding module specification for 'optimus_manager.hooks.post_daemon_stop' >
systemd[1]: optimus-manager.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: optimus-manager.service: Failed with result 'exit-code'.

it’s reported here Python lib (optimus-manager) is missing · Issue #457 · Askannz/optimus-manager · GitHub

it is not,
i’ve been using it for around a year now with no issues.
this things happen, and a huge amount of people need it.
this might give you more info:

we could install it from the AUR
https://aur.archlinux.org/packages/optimus-manager/

1 Like

Should I install optimus-manager first from the AUR so that optimus-manager-qt will use it?

right now there seem to be an issue with optimus manager.
some people managed to fix it with suggested solutions and others not.(something to do with python)
for now you can wait for a fix to come.
and yes,you install optimus manager and then optimus-manager-qt will use it,but i don’t know/think the order matters.

2 Likes

From now on that’s where one will need to install it from. I cannot test it properly and there are too many incompatibilities, see the README. It also needs gdm-prime on GNOME which is ony in the AUR. Either it can be supported and we add everything to the repos or none at all.

so what should i do now?:
remove the one i have and install it from the AUR?

Hello, I temporary fix it doing a rollback (downgrade) from 1.4-3 to 1.4-1, I exec this command:

sudo pacman -U /var/cache/pacman/pkg/optimus-manager-1.4-1-any.pkg.tar.zst

And now I have my two monitor working fine :D. I think this solution work temporary while Manjaro Team fix package.

$optimus-manager --status                                                                                                                                                                                       

Optimus Manager (Client) version 1.4

Current GPU mode : nvidia
GPU mode requested for next login : no change
GPU at startup : nvidia
Temporary config path: no
$sudo pacman -Ss optimus-manager                                                                                                                                                                                

[sudo] password for cybernoob: 
community/optimus-manager 1.4-3 [installed: 1.4-1]
    Management utility to handle GPU switching for Optimus laptops
$systemctl status optimus-manager
                                                                                                                                                                        
● optimus-manager.service - Optimus Manager Commands Daemon
     Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2021-12-18 15:56:34 -03; 6min ago
    Process: 591 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_daemon_start (code=exited, status=0/SUCCESS)
    Process: 692 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_xorg_start (code=exited, status=0/SUCCESS)
   Main PID: 1255 (python3)
      Tasks: 1 (limit: 18496)
     Memory: 62.3M
        CPU: 2.197s
     CGroup: /system.slice/optimus-manager.service
             └─1255 /usr/bin/python3 -u -m optimus_manager.daemon

dic 18 15:56:32 tesla python3[692]: [738] INFO: switching=none, nothing to do
dic 18 15:56:32 tesla python3[692]: [786] INFO: Loading module nvidia
dic 18 15:56:32 tesla python3[692]: [1073] INFO: Loading module nvidia_drm
dic 18 15:56:34 tesla python3[692]: [2852] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
dic 18 15:56:34 tesla python3[692]: [2852] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20211218T155631', 'requested_mode': 'nvidia'}
dic 18 15:56:34 tesla python3[692]: [2852] INFO: Xorg pre-start hook completed successfully.
dic 18 15:56:34 tesla systemd[1]: Started Optimus Manager Commands Daemon.
dic 18 15:56:34 tesla python3[1255]: [1] INFO: # Commands daemon
dic 18 15:56:34 tesla python3[1255]: [1] INFO: Opening UNIX socket
dic 18 15:56:34 tesla python3[1255]: [1] INFO: Awaiting commands

I expect this can help you.

Best Regards.

i was finally able to atleast install optimus-manager 1.4.3 from aur and went past the black screen that i was getting for days but now i am not able to enable the optimus-manager.service.

please help

Ishaan,
while here you see no answers, you can also go to https://aur.archlinux.org/ find your package there, read comments, leave your comments there, subscribe to updates.

Also consider to check the [HowTo] Increase your chances of solving your issue

Worked for me with the v.1.4.3 re-build (the version in the repos), but it’s gone now, ok :grinning_face_with_smiling_eyes:

optimus-manager works perfectly. I had problems after the last update (2016-12-16) and it stopped working, but I did the following:

  1. I have made the necessary changes related to Python 3.10, as described here:
    https://www.reddit.com/r/archlinux/comments/rf6c84/psa_python_310_is_in_core_rebuild_your_aur/
  2. Then I installed and configured optimus-manager 1.4.3 from AUR.
    The video switches to Nvidia when the laptop is plugged in and to Intel when it is on battery. It works without a problem with a second monitor, as it was before update.

i just installed optimus manager from the AUR but it still doesn’t work.
is it ok to upgrade python to 3.10 while Manjaro is on 3.9?

No.

Because OM is and will probably always be buggy.

I think there’s something else here, optimus-manager 1.4-3 should not have been pushed to Stable (maybe it was by mistake?) when only 2 days ago we found in the testing branch that it should be rebuild vs. python 3.10 to work correctly and when we knew that this time

1 Like

I use Manjaro mainly for the Optimus Manager. Because OM is and will probably always be buggy sounds to me now as if I had bet on the wrong horse with Manjaro.

No … nothing to do with ‘compatibility’ … more just the nature of the thing itself.
I think its a solution to a problem that doesnt exist, and its implemented poorly.

Thanks @CyberNoob , rollback worked for me.
I think it is the safest way to rollback and wait for a bug free release

Package used: optimus-manager-git

1 Like