NVIDIA Driver Problem (Primusrun & Optirun Performance Issue)

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

I installed it successfully but there is an error that I miss I guess.
It didn't work.

Let's start from the beginning;
First I checked my DM;

[user@PC ~]$ journalctl -u gdm.service
-- Logs begin at Thu 2020-06-18 21:14:59 +03, end at Sat 2020-06-20 20:39:07 +03. --
-- No entries --

[user@PC ~]$ journalctl -u sddm.service
-- Logs begin at Thu 2020-06-18 21:14:59 +03, end at Sat 2020-06-20 20:39:07 +03. --
Haz 18 21:15:01 PC systemd[1]: Started Simple Desktop Display Manager.
Haz 18 21:15:01 PC sddm[860]: Initializing...
Haz 18 21:15:01 PC sddm[860]: Starting...
Haz 18 21:15:01 PC sddm[860]: Logind interface found
Haz 18 21:15:01 PC sddm[860]: Adding new display on vt 1 ...
Haz 18 21:15:01 PC sddm[860]: Loading theme configuration from ""
Haz 18 21:15:01 PC sddm[860]: Display server starting...
Haz 18 21:15:01 PC sddm[860]: Running: /usr/bin/X -nolisten tcp -auth /var/run/sddm/{a9ee2b64-4543-4154-bbec-ae1376b50>
Haz 18 21:15:02 PC sddm[860]: Setting default cursor
Haz 18 21:15:03 PC sddm[860]: Running display setup script  "/usr/share/sddm/scripts/Xsetup"
Haz 18 21:15:03 PC sddm[860]: Display server started.
Haz 18 21:15:03 PC sddm[860]: Reading from "/usr/share/xsessions/plasma.desktop"
Haz 18 21:15:03 PC sddm[860]: Reading from "/usr/share/xsessions/plasma.desktop"
Haz 18 21:15:03 PC sddm[860]: Session "/usr/share/xsessions/plasma.desktop" selected, command: "/usr/bin/startplasma-x>
Haz 18 21:15:03 PC sddm[860]: Adding cookie to "/var/run/sddm/{a9ee2b64-4543-4154-bbec-ae1376b502d1}"
Haz 18 21:15:03 PC sddm-helper[1089]: [PAM] Starting...
Haz 18 21:15:03 PC sddm-helper[1089]: [PAM] Authenticating...
Haz 18 21:15:03 PC sddm-helper[1089]: pam_kwallet5(sddm-autologin:auth): (null): pam_sm_authenticate

It is sddm, so I followed this: https://github.com/dglt1/optimus-switch-sddm

[user@PC ~]$ sudo pacman -S linux56-headers acpi_call-dkms xorg-xrandr xf86-video-intel git
warning: xorg-xrandr-1.5.1-2 is up to date -- reinstalling
warning: git-2.27.0-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
:: acpi_call-dkms and linux414-acpi_call are in conflict (acpi_call). Remove linux414-acpi_call? [y/N] y
:: acpi_call-dkms and linux56-acpi_call are in conflict (acpi_call). Remove linux56-acpi_call? [y/N] y

Packages (9) dkms-2.8.1-3  libxvmc-1.0.12-3  linux414-acpi_call-1.1.0-155 [removal]
             linux56-acpi_call-1.1.0-20 [removal]  acpi_call-dkms-1.1.0-287  git-2.27.0-1  linux56-headers-5.6.16-1
             xf86-video-intel-1:2.99.917+908+g7181c5a4-1  xorg-xrandr-1.5.1-2

Total Download Size:   16,22 MiB
Total Installed Size:  91,22 MiB
Net Upgrade Size:      49,85 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 linux56-headers-5.6.16-1-x86_64              9,6 MiB  1221 KiB/s 00:08 [########################################] 100%
 dkms-2.8.1-3-any                            53,5 KiB  1783 KiB/s 00:00 [########################################] 100%
 xorg-xrandr-1.5.1-2-x86_64                  36,8 KiB  1838 KiB/s 00:00 [########################################] 100%
 git-2.27.0-1-x86_64                          6,6 MiB  1233 KiB/s 00:05 [########################################] 100%
 acpi_call-dkms-1.1.0-287-x86_64             11,7 KiB  0,00   B/s 00:00 [########################################] 100%
(7/7) checking keys in keyring                                          [########################################] 100%
(7/7) checking package integrity                                        [########################################] 100%
(7/7) loading package files                                             [########################################] 100%
(7/7) checking for file conflicts                                       [########################################] 100%
(9/9) checking available disk space                                     [########################################] 100%
:: Processing package changes...
(1/2) removing linux56-acpi_call                                        [########################################] 100%
  > Updating module dependencies...
(2/2) removing linux414-acpi_call                                       [########################################] 100%
  > Updating module dependencies...
(1/7) installing linux56-headers                                        [########################################] 100%
(2/7) installing dkms                                                   [########################################] 100%
Optional dependencies for dkms
    linux-headers: build modules against the Arch kernel [installed]
    linux-lts-headers: build modules against the LTS kernel
    linux-zen-headers: build modules against the ZEN kernel
    linux-hardened-headers: build modules against the HARDENED kernel
(3/7) installing acpi_call-dkms                                         [########################################] 100%
(4/7) reinstalling xorg-xrandr                                          [########################################] 100%
(5/7) installing libxvmc                                                [########################################] 100%
(6/7) installing xf86-video-intel                                       [########################################] 100%
>>> This driver now uses DRI3 as the default Direct Rendering
    Infrastructure. You can try falling back to DRI2 if you run
    into trouble. To do so, save a file with the following 
    content as /etc/X11/xorg.conf.d/20-intel.conf :
      Section "Device"
        Identifier  "Intel Graphics"
        Driver      "intel"
        Option      "DRI" "2"             # DRI3 is now default 
        #Option      "AccelMethod"  "sna" # default
        #Option      "AccelMethod"  "uxa" # fallback
      EndSection
Optional dependencies for xf86-video-intel
    libxrandr: for intel-virtual-output [installed]
    libxinerama: for intel-virtual-output [installed]
    libxcursor: for intel-virtual-output [installed]
    libxtst: for intel-virtual-output [installed]
    libxss: for intel-virtual-output [installed]
(7/7) reinstalling git                                                  [########################################] 100%
:: Running post-transaction hooks...
(1/5) Creating system user accounts...
(2/5) Reloading system manager configuration...
(3/5) Arming ConditionNeedsUpdate...
(4/5) Updating module dependencies...
(5/5) Install DKMS modules
==> dkms install acpi_call/1.1.0 -k 5.6.16-1-MANJARO
==> Unable to install module acpi_call/1.1.0 for kernel 4.14.183-1-MANJARO: Missing kernel headers.

Only 1 error, but it is about kernel 4.14, so I continued.

[user@PC optimus-switch-sddm]$ sudo ./install.sh 
[sudo] password for user: 
##################################################################
# be sure you have all requirements BEFORE running this script  ##
# linux*-headers acpi_call-dkms xf86-video-intel git xorg-xrandr##
# ****installing in 5 sec... CTRL+C to abort****                ##
##################################################################
 
##################################################################
#errors about removing files can be ignored, i wrote this script##
#with the most common files in mind, you will not have all of   ##
#them, this is ok!                                              ##
##################################################################
## IF YOU HAVE ERRORS ABOUT COPYING FILES, SOMETHING IS WRONG   ##
## MAKE SURE THIS IS RUN WITH SUDO AND FROM DIRECTORY           ##
## ~/optimus-switch-sddm/  (this is very important!!!)          ##
##################################################################
 
Removing current nvidia prime setup if applicable, file not found can be ignored......
Removing gpu configurations from /etc/X11/mhwd.d/  .......
Removing gpu configurations from /etc/X11/xorg.conf.d/ ........
Removing gpu configurations from /etc/modprobe.d/  ........
Removing gpu configurations from /etc/modules-load.d/
removing any display setup scripts.....
Copying contents of ~/optimus-switch-sddm/* to /etc/ .......
Copying set-intel.sh and set-nvidia.sh to /usr/local/bin/
 
Setting nvidia prime mode (sudo set-nvidia.sh).......
 
Setting permissions........
 
 
Currently boot mode is set to nvidia prime.
 
you can switch to intel only mode with sudo set-intel.sh and reboot.
 
same can be done for nvidia prime mode with sudo set-nvidia.sh
 
 
Install finished!

It was installed, so I used "sudo set-nvidia.sh" and reboot.

Opened the DST game, tested it

FPS: 50.6 :confused:
I could play it 60 fps, so it didn't work.

user@PC ~]$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +79.0°C  (high = +87.0°C, crit = +105.0°C)
Core 0:        +66.0°C  (high = +87.0°C, crit = +105.0°C)
Core 1:        +62.0°C  (high = +87.0°C, crit = +105.0°C)
Core 2:        +66.0°C  (high = +87.0°C, crit = +105.0°C)
Core 3:        +69.0°C  (high = +87.0°C, crit = +105.0°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +27.8°C  (crit = +106.0°C)
temp2:        +29.8°C  (crit = +106.0°C)
temp3:        +80.0°C  (crit = +100.0°C)

I couldn't get the GPU's temperature because nvidia-settings is not working.

[user@PC ~]$ nvidia-settings 
ERROR: Unable to load info from any available system

By the way, running optimus-manager still gets error:

[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-20200620T212515.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-20200620T212515.log
[18] INFO: # Xorg pre-start hook
[18] INFO: Requested mode is: intel
[18] INFO: Checking for GDM display servers
[421] INFO: Available modules: ['nouveau', 'acpi_call', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[421] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[774] INFO: Loaded extra Intel Xorg options (0 lines)
[775] INFO: Loaded extra Intel Xorg options (0 lines)
[775] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[775] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20200620T212515', 'requested_mode': 'intel'}
[776] INFO: Xorg pre-start hook completed successfully.

It checks GDM, but mine is SDDM.
So I don't know how to fix this :confused:

But it looks like the main problem is, running the optimus-manager successfully.

edit: I forgot, ran the "sudo set-intel.sh" and reboot.
NVIDIA still is in the list.

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 unloaded: intel resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 20.0.7 

I'm confused. Optimus-switch or optimus-manager? Those two are different setups and won't work with each other. I use optimus-manager, never tried optimus-switch so can't help with that.

Also, with optimus-manager YOU DO NOT RUN nvidia settings, it will ruing your optimus-manager configs.

Did you edit the SDDM conf as showed in the guide?

Forum kindly sponsored by