NVIDIA Driver Problem (Primusrun & Optirun Performance Issue)

Hello everyone, I've used Manjaro for 2 months and I love it. (especially KDE version)
But I experience big issue about gaming.
First of all, I tried Pop!_OS and it works perfectly. (Game: Don't Starve Together: 1920x1080 -> 60 fps, no tearing)
But I don't want to use 2 distro for daily + gaming.

I tried many things to integrate Pop!_OS's success of performance to Manjaro, but failed.
I hope you can help me about this.

I installed bumblebee driver, tried "primusrun %command%" for Steam games, but it doesn't work properly.

I'm planning to present you this in 2 parts.
Part1 : my system's information
Part2 : my tests (glxspheres64 and Don't Starve Together)

...::: Part1 :::...

inxi -G

Graphics:  Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel 
           Device-2: NVIDIA GK107M [GeForce GTX 660M] driver: N/A 
           Display: x11 server: X.Org 1.20.8 driver: modesetting resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 20.0.7

mhwd -li

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-418xx-bumblebee            2019.10.25               false            PCI

mhwd -l

> 0000:01:00.0 (0300:10de:0fd4) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-418xx-bumblebee            2019.10.25               false            PCI
video-hybrid-intel-nvidia-390xx-bumblebee            2019.10.25               false            PCI
video-hybrid-intel-nvidia-340xx-bumblebee            2019.10.25               false            PCI
    video-nvidia-418xx            2019.10.25               false            PCI
    video-nvidia-390xx            2019.10.25               false            PCI
    video-nvidia-340xx            2019.10.25               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:00:02.0 (0300:8086:0166) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-418xx-bumblebee            2019.10.25               false            PCI
video-hybrid-intel-nvidia-390xx-bumblebee            2019.10.25               false            PCI
video-hybrid-intel-nvidia-340xx-bumblebee            2019.10.25               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

...::: Part2 :::...

glxspheres64

[user@PC ~]$ glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0xb3 (8/8/8/0)
Visual ID of window: 0x11c
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) HD Graphics 4000 (IVB GT2)
60.829764 frames/sec - 67.886017 Mpixels/sec
59.946240 frames/sec - 66.900003 Mpixels/sec
59.965337 frames/sec - 66.921316 Mpixels/sec
59.976627 frames/sec - 66.933916 Mpixels/sec
59.959172 frames/sec - 66.914436 Mpixels/sec

primusrun glxspheres64

[user@PC ~]$ primusrun glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0x10d (8/8/8/0)
Visual ID of window: 0x11c
Context is Direct
OpenGL Renderer: GeForce GTX 660M/PCIe/SSE2
61.891020 frames/sec - 69.070378 Mpixels/sec
59.947660 frames/sec - 66.901589 Mpixels/sec
59.953687 frames/sec - 66.908315 Mpixels/sec
59.990603 frames/sec - 66.949513 Mpixels/sec
59.999234 frames/sec - 66.959146 Mpixels/sec

optirun glxspheres64

[user@PC ~]$ optirun glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0x10d (8/8/8/0)
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GTX 660M/PCIe/SSE2
147.775692 frames/sec - 164.917673 Mpixels/sec
156.449980 frames/sec - 174.598178 Mpixels/sec
156.595398 frames/sec - 174.760464 Mpixels/sec
156.069315 frames/sec - 174.173355 Mpixels/sec
158.858986 frames/sec - 177.286628 Mpixels/sec

So, finally, Don't Starve Together tests:

Run on IntelGPU;
FPS: 50.1
CPU: 70°C
GPU: 52°C (nvidia haven't used)

Run on NvidiaGPU with " primusrun %command% "
FPS: 40.3 (worse than intel gpu)
CPU: 78°C
GPU: 75°C (nvidia gpu used but performance is worse)

Run on NvidiaGPU with " optirun %command% "
FPS: 48.6 (better than primusrun)
CPU: 69°C
GPU: 54°C (nvidia gpu used but idk why temperature is low)

I don't know how to fix this to make Manjaro's gaming performance close to Pop!_OS's.
I hope you can help me, thanks.

in general prime is preferred.
and offered through mhwd/msm.

...but .. it looks like it is not offered for you ?

Sadly, no.

Ubuntu Mint, Pop!_OS etc offers Nvidia PRIME but Manjaro didn't :confused:

Hm.
If it is compatible ... then this might be a case of accidentally missing the model in the mhwd profile
@philm @Chrysostomus

Yes, it look like it is compatible.
So if it is, is it easy to fix?
I really want to use Manjaro for everything.

I even tried to install from Nvidia site (https://www.nvidia.com/Download/driverResults.aspx/153717/en-us)

But it gave an error like:

ERROR: The kernel header file '/lib/modules/5.6.16-1-MANJARO/build/include/linux/kernel.h' does not exist.  The     
         most likely reason for this is that the kernel source path '/lib/modules/5.6.16-1-MANJARO/build' is          
         incorrect.  Please make sure you have installed the kernel source files for your kernel and that they are    
         properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or          
         'kernel-devel' RPM installed.  If you know the correct kernel source files are installed, you may specify    
         the kernel source path with the '--kernel-source-path' command line option.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find     
         suggestions on fixing installation problems in the README available on the Linux driver download page at     
         www.nvidia.com.

log file:

nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Fri Jun 19 15:59:05 2020
installer version: 418.113

PATH: /home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin

nvidia-installer command line:
    ./nvidia-installer

Unable to load: nvidia-installer ncurses v6 user interface

Unable to load: nvidia-installer ncurses user interface

Using: nvidia-installer ncurses v6 user interface (widechar)
-> Detected 8 CPUs online; setting concurrency level to 8.
-> Installing NVIDIA driver version 418.113.
-> Performing CC sanity check with CC="/usr/bin/cc".
ERROR: The kernel header file '/lib/modules/5.6.16-1-MANJARO/build/include/linux/kernel.h' does not exist.  The most likely reason for this is that the kernel source path '/lib/modules/5.6.16-1-MANJARO/build' is incorrect.  Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed.  If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

Just to note, PoP OS uses custom hybrid GPU installers to make the process easier during install, which is why it is propelled above its brother Ubuntu for gaming. This article, if interested, outlines a lot of their customized work.

Thanks for the article.
So due to it is custom installer, no way to integrate %100 same to Manjaro right?

Actually, I'm totally okay to just fixing the driver list. I can install PRIME in other distros but in Manjaro, mhwd doesn't list any prime drivers, interesting. :confused:

The secondary problem solver option is, fixing bumblebee's performance issue. I don't know how to fix it but it was interesting that "primusrun %command%" is worse than native intel GPU.

But the primary solution for me is making available the prime drivers.
I hope we can fix the issue.

Honestly, I have and run proprietary Nvidia drivers only on my desktop, even though I also have an intel CPU. My laptop is intel only, so no need for hybrid drivers for me.

Have you followed this guide?

In that guide, prime drivers are available, my problem is they aren't available in my Manjaro mhwd list.

may be if i had an optimus laptop to experiment
i guess i could add
optimus-manager/optimus-switch from @dglt setup
to mhwd

but sadly i cant experiment.

I don't know how to do it

You can still run optimus-manager on bumblebee setup. The only difference is, the Hybrid mode won't work for you (it will work as Intel), but you will be able to switch between Intel and Nvidia.

So basically, you disable bumblebee. Install optimus-manager, configure it properly according to the guide (be sure to read and follow it carefully) and then you switch between Intel or Nvidia modes, depending on your needs.

[user@PC ~]$ optimus-manager
ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20200620T143424.log
If your login manager is GDM, make sure to follow those instructions:
https://github.com/Askannz/optimus-manager#important--gnome-and-gdm-users
If your display manager is neither GDM, SDDM nor LightDM, or if you don't use one, read the wiki:
https://github.com/Askannz/optimus-manager/wiki/FAQ,-common-issues,-troubleshooting

Cannot execute command because of previous errors.
[user@PC ~]$ cat /var/log/optimus-manager/switch/switch-20200620T143424.log
[18] INFO: # Xorg pre-start hook
[18] INFO: Requested mode is: intel
[18] INFO: Checking for GDM display servers
[377] INFO: Available modules: ['nouveau', 'bbswitch', 'acpi_call', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[377] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[408] INFO: Loaded extra Intel Xorg options (0 lines)
[409] INFO: Loaded extra Intel Xorg options (0 lines)
[409] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[409] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20200620T143424', 'requested_mode': 'intel'}
[410] INFO: Xorg pre-start hook completed successfully.

Btw we still couldn't find the main solution for the main problem:

  1. why is the bumblebee driver so low performance?
  2. why can't Manjaro list prime drivers and how I install it?

Because bumblebee is and has been always a hack. In the past there was no way to have hybrid graphics on Linux since it wasn't designed for Linux in the first place. So Bumblebee was created to bypass certain limitations and access discrete GPU while using Intel.
I don't understand how Bumblebee did it, but it wasn't a direct usage of Nvidia and that has a price: b overhead which lowers performance and lack of support of certain GPU features. Bumblebebee for example doesn't support Vulkan so you won't be able to run successfully DXVK with it.

In the past you had limited choice:

  • either 100% Intel setup (no access to Nvidia)
  • 100% Nvidia setup (no usage of Intel graphics so the performance was good, but energy utilization was high)
  • Bumblebee hack which allows for Nvidia use within Intel session, with some limitations

Then nvidia-xrun was invented to bypass Bumblebee limitations. Nvidia-xrun basically starts parallel a new user session (with DE of your choice) using completely Nvidia, while the firs session still runs on Intel. The pro here is, that this secondary Nvidia session has access to all Nvidia perks, so Vulkan works. Since having 2 sessions is also causing overhead, the aim was to use very simple DMs, like openbox or LXQt to have small overhead and that works quite nicely. I played Witcher 3 using nvidia-xrun and performance was decent.

I also wrote a guide for it, so if you are interested, see here:

Now back to the question, why Manjaro auto install prime drivers? I can't be 100% sure, but it does when you have newer GPU which will work with 440xx or newer drivers series. With older GPUs, Manjaro's defaults to old behavior and is installing Bumblebee which was the only way to have some hybrid graphics working on Linux. You always have choice to install and setup only Nvidia, but this was not a good choice in the past, because hybrid graphics are laptops so the energy usage is high plus the gaming wasn't so developed and thus important in the past.

From the topics here, I see that most users with newer Nvidia GPUs get hybrid PRIME setup, which is OK, but still not ideal, because Nvidia is constantly on and energy usage is high. The very newest hardware is handling hybrid PRIME better and can disable Nvidia when not in use, but few year old laptops can't and won't be capable of that - limitation of hardware, but chances to have some flexible and solid GPU setup are better, hence the better hybrid PRIME is auto installed.

That is why solutions as optimus-manager or optimus-switch exist. They give you choice and flexibility, but they cannot be easily integrated into MHWD script.

Again, older GPUs are stuck with the old defaults, since those are hardly gaming laptops, at least when you consider modern triple A games. If you like those pixels or old games, then of course, old GPUs are still a good choice. I even played Witcher 1 and 2 on such old GPU (using Bumblebee) and it was an OK experience.

As to your issues, I can't tell much, because I don't know your setup. Most people have issues because they failed to apply all necessary steps that guide show you, usually they forgot to modify DM config. However, GDM is always problematic, even if everything is set correctly.
In your error commands you already have nice pointers with links to study what went wrong.

Your optimus-manager log doesn't reveal any issue, so probably DM is at fault or you still have some graphic configs that interfere with optimus-manager.

Check out your DMs logs, those usually tell more. For example, for GDM:

journalctl -u gdm.service
1 Like

Does Manjaro install prime drivers on install?

I don't remember it doing this for my newer 1660 Super nvidia card on my desktop, and I have an intel gpu re the processor. When I installed Manjaro it setup my intel gpu drivers, which for me (desktop pc) was what I wanted. I then on boot, manually installed the proprietary nvidia 440 drivers and offered a fond farewell to the intel gpu. It never offered any prime/hybrid setup for me.

Manjaro never "offers" driver setups during install. You only choice is to use free or none-free, rest is done automatic depending on your hardware. If you are not happy with the choice, you can still change it after the install.

Till recently, Manjaro installed Bumblebee on all hybrid laptops, only very recently that probably changed, since many users claim to have hybrid prime drivers from the start. So it depends on WHEN you installed Manjaro. My install was 4 years ago so I did have and used Bumblebee for a long time. Then when DXVK and Proton showed up, I had to use nvidia-xrun, but then I decided to use optimus-manager and this is what I'm at right now and I'm happy.

Since my assumption is based on user posts, I can't be sure. It may well be that Bumblebee is still the default setup. However, with older GPUs that don't support 440xx or never drivers, it's still Bumblebee.

Prime Hybrid setup is a very new thing. It isn't even a full year till it showed up. No matter if Bumblebee is still default or not, you can easily switch to hybrid prime driver. However, with optimus-manager it doesn't matter that much, it works if you have initially bumblebee or hybrid prime setup. Mind you, we are talking here only about Nvidia and non-free drivers.

Thanks for the info, I was just curious. I have been using Manjaro for...I guess 3 years, maybe 4, but I recently built a new desktop and upgraded all my parts in the last 4 months or so. I think the 1660 Super support had just entered the 440xx drivers, so that could have been why also, not sure. Good to know regardless.

I would say that I started seeing 440xx prime hybrid drivers frequently on newbies topics since ca. 2-3 months. On the beginning of this year, Bumblebee was the default, so if it changed then it is a recent thing. Again, I may be wrong. Someone from Manjaro devs should confirm or deny that.

1 Like

First of all, thank you for this huge explanation.

I didn't know the origin of bumblebee.
Now I get it why it's performance isn't perfect.

Thanks for your tutorial but my GTX660M hasn't got Vulkan support I guess.

I think if other distros provide me the PRIME service, Manjaro can too, and should.
I don't play any games actually, only login for daily reward in DST.
But I really want to trust Manjaro %100 for everything, that's the problem.

I will search and try the optimus-manager, thanks so much.

Bumblebee is very prone to issues. For me it worked well, but I saw many times that on fresh installs it was erroring out. It does have overhead, much bigger than DXVK but it's not show stopping. It is possible that your bad performance is not because of bumblebee, but because bumblebee wasn't working at all.

So at the moment I see such choices for you:

  • figuring out optimus-manager and make it work
  • if no, optimus-switch is simpler option that tends to work if optimus-manager fails
  • going back to bumblebee and figuring out if it works correctly
  • using nvidia-xrun
  • setting Nvidia only setup manually - there is guide here on the forum

Note that some solutions cancel each out, some don't. Bumblebee and nvidia-xrun doesn't work with optimus-manager, so if you want to try them out, you should uninstall it, bring back your old configs and enable bumblebee, then you can experiment with bumblebee or nvidia-xrun.

1 Like

Forum kindly sponsored by