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

Well, third time is the charm! I’ve managed to get EnvyControl working, running on X11 and Gnome 42 with GDM successfully. I did have optimus-manager installed prior to this third test/attempt. The last attempt I somehow ended up only being able to boot in Wayland, which was a deal-breaker. Now that I’m able to use Xorg and have my Nvidia GPU as the default, I’ll be sticking with EnvyControl. One reason being it’s simpler, doesn’t require a daemon running in the background, and most importantly it doesn’t require me to use patched versions of GDM, which unfortunately are often outdated in the AUR.

Here’s their Github page for reference: https://github.com/geminis3/envycontrol

I’ve been wanting this to work since I first heard about EnvyControl thanks to the Arch subreddit a few months ago, so this small victory was long overdue! I’ve enabled notifications for any new EnvyControl release, so I’ll be sure to test any new versions, but for what it does, it works and feels just like optimus-manager, just with a lot less overheard to worry about.

In case anyone wants to know the final successful process or for future me to come back here and re-read this thread, I’ll leave my process below. FYI, I am one happy camper!

Make sure MODULES is empty in mkinitcpio, usually there’s nvidia stuff here, e.g. MODULES=“nvidia=x”

sudo nano /etc/mkinitcpio.conf

Remove from MODULES=“nvidia nvidia_modeset nvidia_uvm nvidia_drm” leaving only MODULES=""

Save the file and rebuild mkinitcpio

sudo mkinitcpio -P

Might have to add these values back in if anything fails and you want to revert the whole process, so worth noting.

Check Xorg configs, remove (rm [remove] or mv [move] command) them if need be, note these are values BEFORE optimus-manager is removed. Once optimus-manager is removed, /etc/X11/xorg.conf.d/ will only have the keyboard.conf. It may or may not be the same for you:

ls /etc/X11/xorg.conf.d/
reported output: 00-keyboard.conf 10-optimus-manager.conf

ls /etc/X11/xorg.conf
reported output: ls: cannot access ‘/etc/X11/xorg.conf’: No such file or directory

If it’s not already enabled, make sure grub has nvidia modeset=1. When setting up optimus-manager, this value was already added, so feel free to ignore this step if this applies to you.

sudo nano /etc/default/grub

Make sure “nvidia-drm.modeset=1” is in the GRUB_CMDLINE_LINUX_DEFAULT="" like so:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 nowatchdog nvme_load=YES nvidia-drm.modeset=1"

IF you have “quiet” might want to remove it from the GRUB_CMDLINE, so any text errors will show at boot. This is helpful for debugging any issues. If things are successful, feel free to add “quiet” back in and don’t forget any grub edit needs a rebuild, so after these changes.

Rebuild grub:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Reboot.

Next is to install gdm and libgdm and get rid of the patched AUR versions, pacman will take care of the conflicts, just say yes to the removal of gdm-prime and libgdm-prime:

sudo pacman -S gdm libgdm

Now to uninstall optimus-manager and optimus-manager-qt if you had the GUI app as well:

sudo pacman -R optimus-manager optimus-manager-qt

After this I did a reboot so my system was back to using GDM and the default drivers. Now to install EnvyControl to get access to the Nvidia power again.

yay -S envycontrol

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. So for Nvidia run:

sudo envycontrol -s nvidia

And then reboot. If you removed “quiet” from your Grub line earlier, you will see a bunch of next on next boot, this is only just to see if any errors show up. If everything just works, then you’ll be booted into GDM running on X11, so feel free to add “quiet” back in if you don’t need to see all the text scrolling by on boot.

Other than that, if anyone follows this (or future me), hopefully you too have EnvyControl working great on your system! Any issues, do feel free to please let the devs know, they are active over at: https://github.com/geminis3/envycontrol/issues

2 Likes

Good to see it works for you now, still don’t understand why the previous version of envy didn’t work but ok seems all good now also for your device.

1 Like

Small follow up, I’ve switched to Arch for some months now and recently having issues with running solely on my RTX-3060. Same rig still here Asus tuf A15 2021 KDE plasma fully updated.

I was wondering if there’s others with issues, i guess Nvidia fucked up again somewhere but you never know of course.

Edit: forgot to mention, using the following command does seem to activate the Nvidia card. As example below with glmark2.

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=“nvidia” __VK_LAYER_NV_optimus=“NVIDIA_only” __GL_SHOW_GRAPHICS_OSD=1 glmark2

Thanks

Why do we still use envycontrol and not supergfxctl?

1 Like

I hadn’t known about this one and I don’t have any hybrid laptops to try it. :wink:

envycontrol isn’t in the EOS repos, it’s in the AUR, so not sure what you mean by, “why are we still using it”?

envycontrol is still actively maintained, and it only takes TWO commands to get up and running. It’s one command to install it via the AUR and it’s one command to switch graphics and reboot. It doesn’t get any simpler than that (minus a reboot I suppose), and it doesn’t require modified gdm files like Optimus Manager does. supergfxctl looks like it’s for ASUS computers only? Possibly distro-agnostic? Not sure, I couldn’t tell from a quick look over their documentation. I typically recommend envycontrol or Optimus Manager for hybrid graphics since those two fit the bill for most users, except for Asus users I guess?

While supergfxctl was originally designed with ASUS Optimus laptops in mind, it has since evolved into a standalone tool that functions with any laptops with hybrid graphics.

https://wiki.archlinux.org/title/Supergfxctl

is looking like something to try at least… and it has graphical tools to manage …

1 Like

it is better than envycontrol, at least from my testing

envycontrol is “promoted” in the wiki guides for hybrid graphics.
Also supergfxctl was exclusive for asus laptops, however it became its own thing and now can be used on any hybrid laptop and any distro

1 Like

https://discovery.endeavouros.com/nvidia/nvidia-optimus-notebooks-hybrid-graphics/2021/03/
added it here too…

envycontrol is a mainly a one man development, but it is working without any GUI and seems to work for a lot of people.

4 Likes