Askannz / optimus-manager

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

Project updates #543

Open Askannz opened 1 year ago

Askannz commented 1 year ago

Hi all,

This is @Askannz, creator and current maintainer of optimus-manager. I just wanted to update users about the state of this project.

TLDR

The long version

First off, apologies for the lack of updates for the past…err…couple years? I wish I could blame it on the COVID mayhem but the truth is that I don’t feel qualified to work on this project anymore.

Dealing with bug reports

I originally started optimus-manager because I had an Optimus laptop I wanted to run Archlinux on, and realized Archlinux didn’t have as good a solution as Ubuntu for handling that kind of dual-GPU setup. So I copied Ubuntu’s solution, made a script for myself and published it to Github thinking that maybe others would find it useful. I never imagined this project would become so popular, and I just can’t believe it’s gotten over 2k stars on Github. I’m proud and thankful for it, but frankly also a bit overwhelmed.

Optimus-manager has never been anything more than a bunch of existing scripts cobbled together into a nicer package, and to this day the way it does GPU switching is still pretty hacky (dynamically re-generating Xorg configs, hooking into display managers, calling undocumented ACPI functions…). I think this process works well enough for most users, but it has a lot of moving parts, many of which are still black boxes that I don’t understand very well. My professional skills are mostly in MLops with a sprinkle of data science, so I can only take educated guesses as to what’s going on within the guts of X11, display managers, or the Nvidia driver.

This makes dealing with Github issues pretty frustrating. When people report that optimus-manager doesn’t work on their particular configuration, there is simply not that much I can do. It doesn’t help that problems can have similar symptoms (black screens, freezing, or incorrect GPU switching) but completely different causes, requiring a lot of triage and case-by-case handling. That’s also compounded by quirks of individual brand/models of laptops, by people running optimus-manager on distribution that I don’t use and can’t test (Manjaro), by the capriciousness of the display stack on Linux, or by the fact that it’s difficult to get logs out of a user when the bug they’re trying to report takes down their entire desktop.

Several times I tried to take a day to go through the reports one by one, comb through logs, identify the offending part of the stack, and at least try to offer solutions but it was so absurdly time-consuming I stopped doing it.

Keeping up with the hardware

The good news is that the official support for Optimus on Linux seems to have gotten a little better since I started this project, with recent laptops supporting some kind of power management without having to unload the entire driver. But that brings me to my next point, which is that I don’t have the hardware required to keep up with those advancements.

When I started developing optimus-manager I had 2 Optimus laptops to test it on, each from a different brand and with slightly different hardware configurations. That was convenient because I could try new versions of optimus-manager on both, with different Arch-based distributions, and be reasonably confident it was going to work on other laptops. Back to the present day, one of those laptops is long gone and the other one isn’t doing much better (rather literally falling apart). Furthermore, it only has a Pascal-generation GPU (GTX1060) which is almost 7 years old and doesn’t support the new power management methods added by Nvidia, so I have to rely on users to test the support for those. I don’t even use this laptop daily anymore, having upgraded to a proper desktop station now that I’m done with the student life and don’t have to move around so much.

What now

Because I only use my Optimus laptop very rarely now, optimus-manager is in the unfortunate situation where its creator (me) doesn’t even dogfood it. At this point I’m worried that some day, some update somewhere in the stack is going to break things and I won’t know about it or be able to fix it. Or Nvidia will update their power management again in a way that requires optimus-manager to adapt.

There’s also the question of Wayland support, which people have been asking for for some time. At this point X11 is clearly on the way out, but Wayland is such a different beast I wouldn’t even know where to begin. I suppose I could copy Ubuntu’s implementation once more, but it would likely need a significant rewrite and again I would only be able to test it on my aging hardware.

So if I can’t actively develop optimus-manager, where does that leave the project?

To be honest, I don’t have a good idea of how many people are using optimus-manager today. Newer Optimus laptops have the alternative option of leaving the Nvidia driver running and letting it handle the power management (the equivalent of “hybrid” mode in optimus-manager), which makes optimus-manager redundant in that case. But the Github issues are still active and the AUR package is still reasonably popular so I assume this project is still useful for some folks. That’s why I don’t want to just let it die.

So for now I’ll keep monitoring issues, updating the AUR packages (including the gdm-prime rebase) and if there are low-risk PRs submitted to Github I’ll try to review them. That’s not much of a change over the last few years, but that means you shouldn’t expect large updates or new features for the near future.

For the longer term (assuming optimus-manager is still relevant by then), the right thing to do would be to hand this project to someone who has the hardware and the skills necessary to pick it up (and to be honest I should have done this a long time ago rather than letting Github issues pile up).

If you feel up to the task, please get in touch (either here or at my email which you can find in the PKGBUILD). We can discuss how to do the handover: I can add you as a collaborator to this repository, or archive it and add a redirect to your fork.

ugoenyioha commented 1 year ago

thank you for all the hard work you did on this project. despite the note, I want to be the first to acknowledge how many persons you helped with this project and the impact it had helping us get our laptops working on Linux. thanks again.

mike-lloyd03 commented 1 year ago

Thank you for your hard work in providing Optimus-Manager to the community. This tool made Nvidia GPUs and good battery life at the same time possible. I am mostly on Wayland now but I need X11 for some apps still and I depend on Optimus-Manager in those situations.

Whichever way you go, best of luck to you and thank you again.

shashanknimje commented 1 year ago

Thank you so very much for all your hard work on this project! It is because of you that it's possible for a lot of us to use Arch Linux on our daily drivers. Thanks much once again!

LukeFernandes commented 11 months ago

Thanks very much for taking the time to write this update, and for all your work on this. It's really appreciated and as @shashanknimje says, without it we wouldn't be able to use Arch/its variants as our daily drivers. I'm not sure there's an alternative yet (bumblebee doesn't really work and hasn't for a long time), especially for those of us on Pascal or older. So I think it's important this project doesn't die. Occasional maintenance from you is very appreciated. Of course it would be great if someone could jump in to maintain it :). I don't feel knowledgeable enough to do that.

VorpalBlade commented 11 months ago

Thank you for this existing at all.

But the Github issues are still active and the AUR package is still reasonably popular so I assume this project is still useful for some folks. That’s why I don’t want to just let it die.

Yeah, my old Thinkpad T480 with a MX150 still works perfectly fine and I use it daily. I don't plan to upgrade until it falls apart or is unusably slow, which will likely be at least 5 more years. I don't do anything 3D heavy on it, in fact I keep it in intel-only mode 99% of the time (which is thankfully possible since on this laptop the external display outputs are connected directly to the intel GPU). Still, optimus-manager is there the few times I need something more. Never got hybrid (or pure nvidia) mode working properly with suspend & resume on this laptop though (but it didn't work properly under Ubuntu either).

ghost commented 8 months ago

huge thanks @Askannz for you work. i've been using optimus-manager for years on my one and only Lenovo laptop carrying the ancient GTX950, pushing it to the limit for oh so many hours of 3D gaming fun, while still allowing me to have a good battery time for work unplugged. never had much luck with hybrid mode but being able to switch between GPUs with a simple relog has been a lifesaver and enabled me to use Arch all this time. i have almost zero programming knowledge so won't be picking up the slack, but at least know your time and effort, and from anyone who contributed to the project, has been greatly appreciated!

michaldybczak commented 4 months ago

Thank you for optimus-manager. I've been using it for years, and it worked very well. With time, the old laptop became more stationary, so battery savings are not so important anymore, and hybrid session worked quite well, even on Wayland. So I decided to retire optimus-manager and stay on hybrid session permanently. However, it turned out, that without optimus-manager, multimonitor setup wasn't working, both on X11 and Wayland. With optimus-managager, all worked. I tried to emulate the optimus-manager setup, using its hybrid configs, the same packages, etc. Nothing. Apparently, there is a kernel parameter needed for it to work, but the graphical session won't start with it (black screen), which is a known bug, that was fixed very recently, and I'm still waiting for it to arrive. Somehow, with optimus-manager it was working like a charm, without this kernel parameter, so I keep using as long as it is needed. It literally saved me. It's sad to hear that the project is retired, but I understand, things must come to an end sometimes and old hardware is used less and less. After a couple of years, optimus-manager probably won't be needed anymore, but at this very moment, it's still very helpful, even if it's for multimonitor-support only. Thank you!

es20490446e commented 3 months ago

I have offered to look over this project 👀

When I finish a couple of tasks I have in progress I will start looking into pending pull requests.

In that regard I want to be able to merge any contribution that doesn't have issues in a couple of days max.

es20490446e commented 3 months ago

All pending pull requests have been merged and tested 👍

From now on each merge is a stable release. So if you are using the AUR, rather install the git package.

es20490446e commented 2 months ago

When opening a pull request make sure to mention me: @es20490446e

Otherwise I don't get noticed.

MrDiver commented 2 months ago

Thank you <3

ZYZ64738 commented 1 month ago

All pending pull requests have been merged and tested 👍

From now on each merge is a stable release. So if you are using the AUR, rather install the git package.

Hi - thx for your work. But for me int's not clear how to install the package without using AUR. In the README its mentioned

"Install the optimus-manager package. In the AUR ..."

If I use the AUR-Version my system gets stuck while booting - so I want to try this updated version but I have no clue howto install it.

es20490446e commented 1 month ago

In the application "Terminal" enter:

curl -s https://raw.githubusercontent.com/Askannz/optimus-manager/master/package/install.sh | bash
nwildner commented 1 week ago

Just to add some more information to this thread as well. @Askannz added me as a contributor to this repository and I'll be doing the "Support Engineer" role here, pinging folks from long standing issues that are lingering or don't reproduce anymore, to check if the initial reporter still has interest on the case or if the case can't be reproduced anymore because the issue was solved.

This is to keep the queue in a sane state without a lot of backlog.

Feel free to reopen cases that could be relevant to you but please, do not necrobump only to ask random stuff.

es20490446e commented 1 week ago

Glad to have you onboard 👍

es20490446e commented 1 week ago

optimus-manager-git on the AUR works fine again.

es20490446e commented 1 week ago

Since now every commit is tested for stability, the regular optimus-manager package in the AUR is no longer needed. Hence I have requested its removal.

If you are using that one, switch to optimus-manager-git.

nwildner commented 5 days ago

Quick update. Last 7 days we closed 55 cases. Reasons involved:

So far, reporters and case contributors have been very receptive with the fact we're making some clean up here to put the project back on track.

I'm still monitoring some issues where the reported didn't came back, and I'll close them on the next week or so.