Skip to main content
Topic: convert/rewrite optimus-manager service for s6 (Read 2719 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: convert/rewrite optimus-manager service for s6

Reply #15
bit of a dumb question but how do i apply a patch? i'm not really experienced with git. sorry
Here I edited the pkgbuild and included the patch, all you got to do is extract it, and run makepkg -si

Re: convert/rewrite optimus-manager service for s6

Reply #16
did you attached the file? i dont see a zip file


 

Re: convert/rewrite optimus-manager service for s6

Reply #18
i think the archive's corrupt
sha1sum: 513f0107290867db06a563906f82b2678cf7420e  optimus-manager.tar.gz
Code: [Select]
# tar -xf optimus-manager.tar.gz 
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

could you upload it again?

Re: convert/rewrite optimus-manager service for s6

Reply #19
i think the archive's corrupt
sha1sum: 513f0107290867db06a563906f82b2678cf7420e  optimus-manager.tar.gz
Code: [Select]
# tar -xf optimus-manager.tar.gz 
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

could you upload it again?
http://www.filedropper.com/optimus-manager

Re: convert/rewrite optimus-manager service for s6

Reply #20
well, the systemd error is gone (thx for the patch!), but a new one came up:

Code: [Select]
artix:[artix]:~$ optimus-manager --status

Optimus Manager (Client) version 1.3

Current GPU mode : intel
GPU mode requested for next login : no change
GPU at startup : intel
Temporary config path: no
artix:[artix]:~$ optimus-manager --switch nvidia

Traceback (most recent call last):
  File "/usr/bin/optimus-manager", line 33, in <module>
    sys.exit(load_entry_point('optimus-manager==1.3', 'console_scripts', 'optimus-manager')())
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/__init__.py", line 55, in main
    _gpu_switch(config, args.switch, args.no_confirm)
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/__init__.py", line 69, in _gpu_switch
    run_switch_checks(config, switch_mode)
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/client_checks.py", line 10, in run_switch_checks
    _check_daemon_active()
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/client_checks.py", line 25, in _check_daemon_active
    if not checks.is_daemon_active():
  File "/usr/lib/python3.8/site-packages/optimus_manager/checks.py", line 108, in is_daemon_active
    return _is_service_active("optimus-manager")
NameError: name '_is_service_active' is not defined
artix:[artix]:~$

Re: convert/rewrite optimus-manager service for s6

Reply #21
well, you should define some fake isserviceactive function or disable all code using it.
I would search for all uses of it and tried to remove it, since it is mess.


Re: convert/rewrite optimus-manager service for s6

Reply #23
Did it work?

Re: convert/rewrite optimus-manager service for s6

Reply #24
nope, still doesn't work
(sorry for late reply, was busy with other things)

Code: [Select]
artix:[artix]:~$ optimus-manager --status

Optimus Manager (Client) version 1.3

Current GPU mode : intel
GPU mode requested for next login : no change
GPU at startup : intel
Temporary config path: no
artix:[artix]:~$ optimus-manager --switch nvidia

Traceback (most recent call last):
  File "/usr/bin/optimus-manager", line 33, in <module>
    sys.exit(load_entry_point('optimus-manager==1.3', 'console_scripts', 'optimus-manager')())
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/__init__.py", line 55, in main
    _gpu_switch(config, args.switch, args.no_confirm)
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/__init__.py", line 69, in _gpu_switch
    run_switch_checks(config, switch_mode)
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/client_checks.py", line 10, in run_switch_checks
    _check_daemon_active()
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/client_checks.py", line 25, in _check_daemon_active
    if not checks.is_daemon_active():
AttributeError: module 'optimus_manager.checks' has no attribute 'is_daemon_active'
artix:[artix]:~$


Re: convert/rewrite optimus-manager service for s6

Reply #26
nope, but we're getting closer. looks like the author put in a lot of checks
Code: [Select]
artix:[artix]:~$ optimus-manager --status

Optimus Manager (Client) version 1.3

Current GPU mode : intel
GPU mode requested for next login : no change
GPU at startup : intel
Temporary config path: no
artix:[artix]:~$ optimus-manager --switch nvidia

Traceback (most recent call last):
  File "/usr/bin/optimus-manager", line 33, in <module>
    sys.exit(load_entry_point('optimus-manager==1.3', 'console_scripts', 'optimus-manager')())
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/__init__.py", line 55, in main
    _gpu_switch(config, args.switch, args.no_confirm)
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/__init__.py", line 69, in _gpu_switch
    run_switch_checks(config, switch_mode)
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/client_checks.py", line 13, in run_switch_checks
    _check_patched_GDM()
  File "/usr/lib/python3.8/site-packages/optimus_manager/client/client_checks.py", line 54, in _check_patched_GDM
    dm_name = checks.get_current_display_manager()
AttributeError: module 'optimus_manager.checks' has no attribute 'get_current_display_manager'
artix:[artix]:~$

Re: convert/rewrite optimus-manager service for s6

Reply #27
I haven't looked very closely at this but the dbus 'org.freedesktop.systemd1' part actually should have worked if you have elogind running. elogind exposes this very same API and is able to receive that dbus message. Now this is done in python so I don't know if there's any limitation from python-dbus. I wouldn't think so but I've never looked at it in detail. It works in C however.

Re: convert/rewrite optimus-manager service for s6

Reply #28
just checked. i already have elogind-log and elogind-srv running on startup. maybe something else is the problem? not so sure myself either

Re: convert/rewrite optimus-manager service for s6

Reply #29
I'm going to guess it's probably a python-dbus limitation then. At least with that particular function. Many programs send messages to "org.freedesktop.systemd1" which works without any problems with elogind. Of course, these programs use different dbus implementations (all in C) which is the major difference. I do not know what python-dbus does here exactly with that particular function call.