[Guide] Install Nvidia hybride graphics with Optimus and Vulkan support

Hi Everyone,

Here i want to share my guide to properly install the Nvidia drivers on a laptop with hybride graphics (Intel/Nvidia), and also get the full performance of the Nvidia proprietary drivers with Optimus Manager.

After a lot of trail and error, (non bootable Arch, editing conf files files etc.) i managed to find the best way and the easiest way to install the Nvidia drivers and get the full performance with Vulkan support for gaming. I tried this method on 2 different laptops with intel/nvidia graphics.

For who?
This guide is pure for hybride graphics laptops with Intel/Nvidia graphic cards, so no need for installing it on desktops.The nvidia-installer with comes with EOS is just fine to use, and works with no problem with the Bumblebee service to switch between Intel en Nvidia graphics. So you can save some battery when mobile.

So why use Optimus Manager instead of Bumblebee?
Optimus manager has the same functionality as bumblebee, (despite the technical differences) it allows you to switch between Intel and Nvidia graphics on hybride laptops. The difference is that Optimus Manager has better performance for gaming and has support for the Vulkan drivers so you can properly game with the latest games on Linux (Lutris, Steam, Wine)

First step

Nvidia-installer
Endeavour OS has his own nvidia-installer script that is ported from Antergos, with this script you can get the latest Nvidia proprietary drivers and the Bumblebee option to switch between Intel and Nvidia.
This install script with the Bumblebee is necessary to get the Nvidia driver working next to the Intel graphics.

Run in Terminal

sudo pacman -S nvidia-installer

(possible that is already installed by default)

nvidia-installer -b

(-b is bumblebee option)

  1. reboot

  2. After the reboot check the nvidia-settings in the Menu launcher or via Terminal:

nvidia-settings

If correct it will be showing the driver version and all the Nvidia graphics information.

At this point you got the Nvidia driver installed with the bumblebee option, so basically you can switch between the two graphics cards.
The only downside is that Bumblebee is lacking in performance and doesn’t support Vulkan drivers to proper run games with Wine, Lutris, Steam etc.

Second step

Optimus-manager
Now we are going to install Optimus Manager and disable Bumblebee so there is no interference.
Optimus Manager has basically the same function as Bumblebee, but does it with better performance and Vulkan support.

Run in Terminal

yay optimus-manager-qt

(this will install the Optimus Manager + Tray application to easy switch between Intel/Nvidia)

Don’t reboot

sudo systemctl disable bumblebeed.service

(By this we disabled the bumblebee daemon)

  1. Go to /etc/X11/xorg.conf.d/ and disable any graphic related configs. Instead deleting them, just rename them by adding .bak. (Possible that there isn’t any related files, so you can go to the next step)

  2. Go to /etc/X11/ and disable any related graphic configs (The same situation as above, Probably there isn’t any related files, so you can get to the next step)

  3. Reboot

  4. After the reboot open Optimus Manager via the Menu launcher, a tray icon will appear with the “Intel” logo in it. Richt-click and go in settings and check “Launch at startup”.
    Screenshot_2019-09-24_08-38-46

  5. In Terminal:

systemctl status optimus-manager.service

check if it runs correctly and with no errors

  1. Now switch to Nvidia GPU, right-click on the Tray and select "Switch to Nvidia "

  2. After you login again type in terminal

nvidia-settings

If correct it will be showing the driver version and all the Nvidia graphics information.

Voila, you installed the Nvidia drivers with all the potential unlocked.
After this you can install all the supported Vulkan drivers and play games with Wine, Lutris and Steam with full performance.
If you want a guide for getting Endeavour OS ready to game with Lutris let me know :wink:

7 Likes

This is an innocent question from a total noob, so please forgive if it isn’t relevant or correctly on-point.

I think I’ve seen discussion on the forum that using Nvidia drivers requires the dkms kernel and headers to be installed. If that is true, and assuming I haven’t misunderstood that requirement, perhaps including a discussion or an appropriate cross-link in this Guide about how and where in the process to install the dkms kernel elements, how to update them over time as the nvidia drivers are inevitably updated, etc. might help round-out this most excellent tutorial!

Thank you for putting so much time and thought into this tutorial/ Guide! I’m sure it will be of great value to the community.

1 Like

Is there any benefit for using this guide over just using package manager? I had no issues using pamac.

Hi Turdness

Pamac
You can use pamac to install optimus manager.
The nvidia-installer on the other hand is not possible because of the need of - b.function you need to add.

Hi bkaplan,

This is for laptops with hybride graphics.

just a question, does for gnome users has also something on panel ?

Hi Ringo

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

In the above github link it mentioned something about some Gnome quirks

IMPORTANT : Gnome and GDM users

If you use Gnome or the Gnome Display Manager (GDM), there are a couple extra requirements to be able to use optimus-manager :

  • The default gdm package from the Archlinux and Manjaro repositories is not compatible with optimus-manager, so you must replace it with this patched version : gdm-prime (also replaces libgdm ). The patch was written by Canonical for Ubuntu and simply adds two script entry points specifically for Prime switching. The package is otherwise identical to the official one.
  • Gnome launches Wayland sessions by default, which are incompatible with optimus-manager. To force Xorg sessions, You need to edit the file /etc/gdm/custom.conf and remove the # before the line #WaylandEnable=false .

Another quirk of GDM is that the X server may not automatically restart after a GPU switch. If you see an empty black screen or a black screen with a blinking cursor, try switching back to an empty TTY (with Ctrl+Alt+F5 for instance), then back to TTY1 with Ctrl+Alt+F1. See this FAQ question.

I have a new laptop with Optimus system in it ( ASUS G531GT with Intel / nVidia 1650 ), and a new install of EOS, updated, and Cinnamon added.

After following this guide I can get to step 3, then the system halts and looks stupid after the Starting version 243.51-1-arch, then the filesystem clean checks. No keypresses work from here.

I have tried suggestions here, without success:

Any further ideas?

Never mind. This has now worked so long as I don’t do the reboot at step 3!
I get the option of Intel, Nvidia, or Hybrid Mode. Thanks, @wimmetje <3

welcome to our community :rocket:

1 Like

@onyxnz Great to hear that it works now.

The option to not reboot at step 3 in this guide, and going straight installing optimus-manager sounds familiair.
My old laptop had the same issue that it wouldnt boot after the bumblebee was installed, so disabeling it right away and intall optimus-manager was the solution.

But what DE do you run?

1 Like

The current file which is 15/10 basically has dkms as default so what would be the possible steps to run the whole installation of optimus ?

Thank-you very much for this guide :slight_smile:
I tested “optimus-manager” with both DM “LXDM” and “LightDM”, and only “LightDM” allows switching between Intel and Nvidia GPUs.
It can be useful to specify it in this link : EndeavourOS Nvidia users
Modifying : in fact, it’s all explained here : optimus-manager by Robin Lange
:wink:

Good guide!!

womp

Theoretically there would be no need for anything other than the Nvidia hybrid driver and following these instructions for Intel CPUs + Turing based GPUs (16xx and 20xx cards):
https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/primerenderoffload.html

I didn’t have the time and nerves to start fiddling again with my drivers but I’d be interested in hearing if anyone had success following those instructions and skipping the optimus-manager solution altogether.

I will take a look at it, i am planning to (re) install endeavour OS this upcoming week!

I can kinda get this to work on my PC, which is not a laptop. Automatically booting to hybrid doesn’t seem to work and in my latest attempt it did not switch to hybrid either, though it worked previously.

Currently I don’t have optimus enabled. If I run prime-run glxinfo | grep “OpenGL renderer” I get this:

prime-run glxinfo | grep “OpenGL renderer”
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 39
Current serial number in output stream: 40

Working again. I guess I have to set boot option to Intel, then unbind my dGPU from the VM, then switch to hybrid. A bit annoying to always do this after a reboot. More annoing is the audio resetting to HDMI when the session is loaded or display is turned off and back on again.

Hi Turdness,

I assume you talking about the prime render offload. I didn’t tried it out yet, didn’t had time for it as I am in the middle of some exams.

But I looked at it after your post, and I am gonna try it out today and see if I can write a easy tutorial for it.

Regards wim

Prime render offload works fine in hybrid mode, and it’s great. With turing cards it’s the most sensible option to use, since the dGPUs can utilise power management. Actually, should be used with 10xx series cards too. I read that while they can’t shut down completely on their own, their power consumption is quite low while idle.

I was initially trying to get prime to work without optimus-manager, since I don’t have a laptop. I just couldn’t get the hang of it.