Should we look to consider EnvyControl for Nvidia Optimus in the wiki?

Greetings lovely community,

I’m a Gnome Nvidia Optimus user, currently using Optimus Manager for my system to allow me to use my Nvidia graphics card for daily use. I don’t use hybrid or intel/integrated mode ever, just the Nvidia mode as it offers the best performance, but I understand different users might want to use the other options from time to time.

Now I recently came across a EF - Linux Made Simple (<–click here to view) video called “EnvyControl: Nvidia Optimus” which is a new optimus switcher for nvidia/intel hybrid setups like my own laptop. He briefly goes over the setup, a few solutions and workarounds and explains in better detail than I can what EnvyControl is.

Now I currently use optimus manager because it works (it hasn’t been updated in a year according to their Github) and it’s what I used from the EndeavourOS wiki that made the most sense to me at the time, but the recent python update from the other month broke peoples systems if they were using optimus manager and didn’t also rebuild their AUR packages before a reboot. I was lucky to have avoided that tiny fiasco, but for other daily Arch updaters that wasn’t the case. Luckily a fix was released shortly after (maybe a day or two if memory serves). Another downside to optimus manager is IF you’re using Gnome, it requires a patched version of GDM from the AUR (gdm-prime and libgdm-prime) as well as of course optimus manager from the AUR as well. These two patched GDM packages are frequently out of date, the maintainer is not the most active unfortunately, but I do not intend to diminish their efforts I know they have a life outside the AUR.

Now EnvyControl (AUR link) (Github link), simplifies a lot of these issues. Though it is still python based, so I’d assume next major python update, you’ll want to rebuild AUR packages before a reboot.

Now according to the Arch wiki here: https://wiki.archlinux.org/title/NVIDIA_Optimus#Available_methods

  • #Using EnvyControl - Similar to optimus-manager but does not require extensive configuration or having a daemon running in the background as well as having to install a patched version of GDM if you are a GNOME user.

For my use case this seems like a better option for users like myself that would prefer not to use a patched GDM system component from the AUR if they don’t have to.

Here’s a brief Q&A on EnvyControl: https://github.com/geminis3/envycontrol/wiki/Frequently-Asked-Questions#tested-distros

It currently supports Arch, Fedora, Ubuntu, and Manjaro. It is still new, so since EndeavourOS is so close to Arch, I’d like to assume it can be supported as well, it just hasn’t been tested and verified to the developer about that just yet is my guess.

Is there anyone out there willing to test this new approach and possibly add an addition to the wiki to include this method if successful? I don’t know how many Gnome + nvidia hybrid users are in this forum, but I’m one of them and will be willing to test this out, but I will need some guidance if that be the case. The thing about Optimus Manger, EnvyControl, Prime render offload, etc is that (from the Arch wiki):

Note: All of these options are mutually exclusive, if you test one approach and decide for another, you must ensure to revert any configuration changes done by following one approach before attempting another method, otherwise file conflicts and undefined behaviours may arise.

I’d test it out myself, but I’ve modified quite a few entries to get my optimus manager/nvidia drivers to work, so I’d have to go back, find them all and revert their changes, otherwise I may end up with some issues as EF Linux discussed in his video.

Are there any others out there that would be willing to test this out? I’d appreciate any comments, input, and suggestions.

4 Likes

I would try it but i don’t have any equipment to do it on. If you would kindly send me a new laptop with this Nvidia hardware i promise i will test it and even install Gnome. :lying_face:

:rofl:

2 Likes

@ricklinux The laptop is on its way…

:lying_face:

1 Like

@Scotty_Trees this looks awesome easy to use … as you mentioned it doe snot come with all the struggle to need a different version for Plasma and tinkering with GDM/SDDM …

if someone has tested it please report here and at the Source:

Sadly me not have such hardware so I can not test it :person_shrugging:

we want you to test! :point_left: :hugs: :handshake:

Also AMD Nvidia hybrid owners:

A note on AMD + Nvidia systems

I don’t own any device with this hardware combination, however experimental support for AMD systems under nvidia mode has been added. Please send me your feedback.

2 Likes

I can put a pin in it for the moment, but I can allow myself plenty of time this weekend to test it out. I may or may not have some failures along the way, but as long as you and maybe even @ricklinux are around I’m sure we can figure it out.

I do like the idea of EnvyControl being a lighter Optimus Manager without needing patched versions of GDM, I just need to figure out how to revert all my current nvidia configs before I go messing around. I expect to deal with maybe a few blackscreens during testing, but in the name of testing, if it ends up helping others (as well as myself!), it could be an interesting addition for EndeavourOS :wink:

indeed :handshake: :building_construction:

1 Like

Got it installed here and very happy with it. I’m not a gamer so i use it only to select my graphics card (AMD-Nvidia My rig: Asus Tuf A15 2021 version (i know gaming rig…)). Hasn’t failed me so far and super easy to use.

2 Likes

Good to know thank you. Did you have to do anything post install beforehand? Please feel free to include your install process if it required anything more than installing the AUR package, otherwise no need to worry about it.

As mentioned above:

For myself, I already have Optimus Manager running, so I have to de-Optimus Manager my system and a few configurations first, before I can test this out. You’re on AMD, so maybe your approach was a lot more simplified as just installing the EnvyControl AUR package and calling it a day :sweat_smile:

i used envycontrol on a fresh Endeavour install, just install from AUR. set your card (in my case i use the Nvidia RTX3060) and that was it. Also of course tested the AMD which also worked fine. So far no issues with it. Much convenient than optimus which i had before and since i had a fresh install going so why the heck not try it. Not gonna change back to optimus here, that’s for sure.

2 Likes

Don’t be affeared! You can do it! :wink:

1 Like

Do you also have a Github account? The EnvyControl dev is asking anyone to let them know if it works on their distro or not. EndeavourOS isn’t listed (yet) on their Github as being supported, but if you let them know it works for you I’m sure they can change that for better optics for new users. Also if you do have a Github, I’d mention your hardware specifics and that it works just fine. EnvyControl is still new this is the first release, so anything will help the developer.

@ricklinux always pushing me to bork my system I see! never change mate, never change :stuck_out_tongue:
I’ll attempt it this Friday, so mark your calendar if you’re not already too busy of course, probably off chasing some beavers or chugging maple syrup on a log down the Mackenzie River :wink:

I have a account yes but no need to bother the dev with this as Arch is listed and last time i checked EndeavourOS is still Arch based.

1 Like

checks notes…

Yup, still Arch-based :sweat_smile:

Checks mail…still no laptop? :man_shrugging:

Oh it must’ve gotten lost! Not to worry! Let me send another laptop your way… :snail:

1 Like

I’m ready to give this a go. Anyone around to guide/watch my epic failure? :stuck_out_tongue:

I’ve got optimus-manager installed currently:

[scott@endeavourOS ~]$ pacman -Qs optimus
local/gdm-prime 41.0+r15+g23ebe617-1 (gnome)
    Display manager and login screen - patched with Prime support for Optimus
    laptops
local/libgdm-prime 41.0+r15+g23ebe617-1
    GDM support library - patched with Prime support for Optimus laptops
local/optimus-manager 1.4-4
    Management utility to handle GPU switching for Optimus laptops
local/optimus-manager-qt 1.6.4-1
    A Qt interface for Optimus Manager that allows to configure and switch GPUs
    on Optimus laptops using the tray menu

I wonder if the best approach is to uninstall all these packages, and then just install EnvyControl from the AUR

yay -S envycontrol

And then do a reboot? Or should i uninstall all the optimus stuff first and then do a reboot? Not sure if that would matter at all or not to clear out any config files before installing/using EnvyControl

I’m watching… :wink:

Edit: I don’t even know how you got it installed in the first place. It’s a little different on Gnome.

1 Like

This is probably what i would have done?

1 Like

Ok well first things first, here’s all that I did exactly, to post my process for this. After I post this I’ll do a reboot to hopefully (fingers crossed) confirm this method works!

*QUICK WARNING: please do not follow this until I have confirmed it is working *

I use Gnome, so with optimus-manager, I also have gdm-prime and libgdm-prime, so I have to uninstall these packages. I know I need to replace these with gdm and libgdm, so I can just install those first and let pacman uninstall the prime versions for me. Simple!

[scott@endeavourOS ~]$ sudo pacman -S gdm libgdm
[sudo] password for scott: 
resolving dependencies...
looking for conflicting packages...
:: gdm and gdm-prime are in conflict. Remove gdm-prime? [y/N] y
:: libgdm and libgdm-prime are in conflict. Remove libgdm-prime? [y/N] y

Package (4)   Old Version           New Version  Net Change  Download Size

gdm-prime     41.0+r15+g23ebe617-1                -4.40 MiB               
libgdm-prime  41.0+r15+g23ebe617-1                -0.63 MiB               
extra/gdm                           41.3-2         4.40 MiB       0.70 MiB
extra/libgdm                        41.3-2         0.63 MiB       0.07 MiB

Total Download Size:   0.77 MiB
Total Installed Size:  5.03 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 libgdm-41.3-2-x86_64   76.7 KiB   258 KiB/s 00:00 [-----------------------] 100%
 gdm-41.3-2-x86_64     716.0 KiB  1102 KiB/s 00:01 [-----------------------] 100%
 Total (2/2)           792.7 KiB  1057 KiB/s 00:01 [-----------------------] 100%
(2/2) checking keys in keyring                     [-----------------------] 100%
(2/2) checking package integrity                   [-----------------------] 100%
(2/2) loading package files                        [-----------------------] 100%
(2/2) checking for file conflicts                  [-----------------------] 100%
(4/4) checking available disk space                [-----------------------] 100%
:: Processing package changes...
(1/2) removing gdm-prime                           [-----------------------] 100%
warning: /etc/gdm/custom.conf saved as /etc/gdm/custom.conf.pacsave
(2/2) removing libgdm-prime                        [-----------------------] 100%
(1/2) installing libgdm                            [-----------------------] 100%
(2/2) installing gdm                               [-----------------------] 100%
Optional dependencies for gdm
    fprintd: fingerprint authentication
:: Running post-transaction hooks...
(1/6) Creating system user accounts...
(2/6) Reloading system manager configuration...
(3/6) Reloading device manager configuration...
(4/6) Arming ConditionNeedsUpdate...
(5/6) Reloading system bus configuration...
(6/6) Compiling GSettings XML schema files...
[scott@endeavourOS ~]$ 

Now I noticed this transaction created a pacsave file (hopefully you already know how to deal with these), so I used the EndeavourOS welcome Pacdiff and Meld option, to view, edit, save, and remove the pacsave file, so that is now good to go.

Next I need to remove optimus-manager and it’s GUI Qt counter part optimus-manager-qt

Source: https://github.com/Askannz/optimus-manager

To uninstall the program, simply remove the optimus-manager package. The auto-generated Xorg config file will be automatically cleaned up.

You can also force cleanup by running optimus-manager --cleanup.

You can also disable optimus-manager by disabling the systemd service optimus-manager.service (needs a reboot to be applied).

FYI, if you want to run the --cleanup command, you need to do that before you uninstall optimus-manager. Also, it’ll require sudo fyi.

So as for the uninstall:

[scott@endeavourOS ~]$ sudo pacman -R optimus-manager optimus-manager-qt
checking dependencies...

Package (2)         Old Version  Net Change

optimus-manager     1.4-4         -0.27 MiB
optimus-manager-qt  1.6.4-1       -0.78 MiB

Total Removed Size:  1.05 MiB

:: Do you want to remove these packages? [Y/n] 
:: Processing package changes...
(1/2) removing optimus-manager-qt                  [-----------------------] 100%
(2/2) removing optimus-manager                     [-----------------------] 100%
optimus-manager : cleaning up auto-generated Xorg conf
optimus-manager : disabling optimus-manager.service
:: Running post-transaction hooks...
(1/4) Reloading system manager configuration...
(2/4) Arming ConditionNeedsUpdate...
(3/4) Updating icon theme caches...
(4/4) Updating the desktop file MIME type cache...
[scott@endeavourOS ~]$

Now my system technically doesn’t have anyway to switch between any GPU, hybrid, integrated, whichever. So now all that’s left is to install EnvyControl, set it to the desired mode, and give my system a reboot and hope upon hope that all goes well.

yay -S envycontrol

[scott@endeavourOS ~]$ yay -S envycontrol
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  envycontrol-1.3-1

:: (1/1) Downloaded PKGBUILD: envycontrol
  1 envycontrol                      (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (1/1) Parsing SRCINFO: envycontrol
==> Making package: envycontrol 1.3-1 (Fri 25 Feb 2022 08:09:30 PM EST)
==> Retrieving sources...
  -> Cloning envycontrol git repo...
Cloning into bare repository '/home/scott/.cache/yay/envycontrol/envycontrol'...
remote: Enumerating objects: 206, done.
remote: Counting objects: 100% (206/206), done.
remote: Compressing objects: 100% (153/153), done.
remote: Total 206 (delta 112), reused 120 (delta 50), pack-reused 0
Receiving objects: 100% (206/206), 43.49 KiB | 1.67 MiB/s, done.
Resolving deltas: 100% (112/112), done.
==> Validating source files with sha256sums...
    envycontrol ... Skipped
==> Making package: envycontrol 1.3-1 (Fri 25 Feb 2022 08:09:31 PM EST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating envycontrol git repo...
Fetching origin
==> Validating source files with sha256sums...
    envycontrol ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of envycontrol git repo...
Cloning into 'envycontrol'...
done.
Switched to a new branch 'makepkg'
==> Sources are ready.
==> Making package: envycontrol 1.3-1 (Fri 25 Feb 2022 08:09:32 PM EST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
running install
/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running build
running build_py
creating build
creating build/lib
copying envycontrol.py -> build/lib
running install_lib
creating /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr
creating /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/lib
creating /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/lib/python3.10
creating /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/lib/python3.10/site-packages
copying build/lib/envycontrol.py -> /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/lib/python3.10/site-packages
byte-compiling /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/lib/python3.10/site-packages/envycontrol.py to envycontrol.cpython-310.pyc
writing byte-compilation script '/tmp/tmptrseb7u2.py'
/usr/bin/python -Wignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning /tmp/tmptrseb7u2.py
removing /tmp/tmptrseb7u2.py
running install_egg_info
running egg_info
creating envycontrol.egg-info
writing envycontrol.egg-info/PKG-INFO
writing dependency_links to envycontrol.egg-info/dependency_links.txt
writing entry points to envycontrol.egg-info/entry_points.txt
writing top-level names to envycontrol.egg-info/top_level.txt
writing manifest file 'envycontrol.egg-info/SOURCES.txt'
reading manifest file 'envycontrol.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'envycontrol.egg-info/SOURCES.txt'
Copying envycontrol.egg-info to /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/lib/python3.10/site-packages/envycontrol-1.3-py3.10.egg-info
running install_scripts
Installing envycontrol script to /home/scott/.cache/yay/envycontrol/pkg/envycontrol/usr/bin
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "envycontrol"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: envycontrol 1.3-1 (Fri 25 Feb 2022 08:09:34 PM EST)
==> Cleaning up...
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (1)  New Version  Net Change

envycontrol  1.3-1          0.03 MiB

Total Installed Size:  0.03 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [-----------------------] 100%
(1/1) checking package integrity                   [-----------------------] 100%
(1/1) loading package files                        [-----------------------] 100%
(1/1) checking for file conflicts                  [-----------------------] 100%
(1/1) checking available disk space                [-----------------------] 100%
:: Processing package changes...
(1/1) installing envycontrol                       [-----------------------] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[scott@endeavourOS ~]$ 

Okay, so thankfully it built from the AUR no issues! Great, now I can set the mode and reboot and see how things go.

EnvyControl has 3 supported modes: integrated, nvidia, hybrid. I want only the nvidia option. Once you run the command, you’ll have to reboot for changed to take effect. This is in contrast to optimus-manager which once the command is issued, your system is instantly rebooted, so any work you left unsaved would be lost. Personally, I like the approach of rebooting when I’m ready that envycontrol takes.

sudo envycontrol --switch nvidia ##this will switch the mode to nvidia gpu. now off to reboot.

envycontrol --status ##checks the status of the currently used mode

That should be the whole list of converting from optimus-manager to envycontrol. Now I just gotta reboot and report back, but if you don’t hear from me again in a minute, I’m probably staring at a black screen frantically trying to figure out what to do in a TTY :sweat_smile:

Edit: it did not go well and was not a success this time.

@ricklinux ah yeah it didn’t work, now I’m stuck staring at a blinking cursor, crap :sweat_smile: