NVIDIA and Intel Hybrid graphics do not work

Manjaro 5.4.34-1 system, Intel i7-5700HQ CPU with integrated GPU, and NVIDIA GTX 970M as a dedicated GPU. I am using an MSI GS60 Ghost Pro 2QE 4K notebook (this is relevant info).

I have spent the last 3 days looking for and trying out various methods to run NVIDIA on this system. Nothing. Works. Ever.

First, when the system was still fresh, dedicated GPU was running all the time. How did I know? Simply by the color of the power button. MSI's laptops show an orange light for dedicated GPU and blue for integrated. So, I installed the proprietary drivers and when I tried to open Steam and run a simple game, it was jittery, meaning the integrated graphics were on instead. After following the instructions here I somehow got the NVIDIA GPU to stop eating resources unnecessarily and the CPU to calm down (before that temps would be almost twice as high as expected of an almost inactive system). I used the guides on these two posts:

  1. Install drivers for Nvidia GeForce GTX 1050 without bumblebee
  2. Guide: Install and configure optimus-manager for hybrid GPU setups (Intel/NVIDIA)

On the way I ran into another issue, which you can read about here and see in the comments I've tried other things that were suggested.

Optimus Manager is working, if working means being ON and indicating that Intel graphics are running. When I try switching to NVIDIA or Hybrid, log out and log back in, Intel graphics are on again. And for some reason sometimes Wi-Fi doesn't detect my router.

Oh, and to top it off, my whole PC freezes every 2-3 seconds for 1-2 seconds. :upside_down_face:
System Monitor, when all processes are sorted by CPU%, shows 2-3 instances of rsync taking up 5-10% of CPU and 10-70 MB of RAM, Web taking 1-4%, ksysguard and plasma shell adding up to 5%, and timeshift showing from time to time. All in all, it goes from 5 to 50% usage without doing anything special. WHAT. THE.?Q!@#!(E!)@

Please, ask me whatever you need to know, tell me what I am doing wrong, explain everything step-by-step like you would to a monkey, an idiot or an idiot monkey, and let's see what will happen.

can you try
prime-run glxgears

There is Optimus Switch. I've recently switched to it, and so far it has been working fine for me. You should give it a try.

This is the output:

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:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  25
  Current serial number in output stream:  26

To explain this, Manjaro installs lately hybrid Nvidia mode, which means that you can use Nvidia with certain environmental variable command, but the system and all apps are using Intel GPU by default. In hybrid mode Nvidia GPU is powered on, so this color power button is indicating that Nvidia is on, but it doesn't actually mean that it is used, hence jittery performance on Steam, which still uses Intel if you don't use the said command.

For debugging optimus-manager issues, we need logs:

General boot error log:
journalctl -b -p3

Optimus-manager log:
journalctl -u optimus-manager.service

Your DM log, command depends on which DM you use, for gdm it would be:
journalctl -u gdm.service

Xorg log at /var/log/Xorg.xxx.log or ~/.local/share/xorg/Xorg.xxx.log .

Kernel logs : journalctl -k

Please, maximize your terminal window before copping commands, becaue partial lines are not helpful. Or add to the above commands > name.log to forward the output to file name.log. CHange the name of course. So:

journalctl -u optimus-manager.service > optimus.manager.log

Usually the most important log here is DM log, where the usually issue happens. Usually it's because incorrect settings or configurations (you forgot disabling some config or applied incorrect optimus-manager setting, or forgot to apply some tweaks to given DM, etc.)

1 Like

Thank you for the detailed explanation!

I couldn't find the Xorg log. Otherwise, these are the files I got.
Wanted to upload them in Github but opted for Google Drive instead.
Will this do?

Kernel log looks ok on a brief look.

You have there some worrying lines on the beginning of optimus-manager.log

 Running /etc/optimus-manager/nvidia-enable.sh
ERROR : cannot run /etc/optimus-manager/nvidia-enable.sh. Continuing anyways. Error is : Failed to execute '/etc/optimus-manager/nvidia-enable.sh' : bash: /etc/optimus-manager/nvidia-enable.sh: No such file or directory

I've seen this many times and I'm not sure why this is happening. I may ask the optimus-manager developer, however, on later sessions, you don't have this and all looks normal, just the same as it looks for me, so the optimus-manager is not the issue.

I said, that the most important is DM log and you didn't provide any. In all cases I looked through the problem was visible there. We can't move further without it. You can use pastebin or hastebin service to link to logs. It's more convenient to read.

As to wifi troubles, this is entirey different issue. When the wifi is not working try, this commands

sudo systemctl restart NetworkManager
nmcli networking on

and wait few seconds to see if the wifi is reconnecting. This isn't solving issue but it should turn the wifi on at this moment.

I did input the command though... Here is the output for it:

-- Logs begin at Thu 2020-04-23 21:18:53 EEST, end at Sat 2020-04-25 17:46:1>
-- No entries --

Thanks! I forgot those existed..

Works! Also works by manually turning Wi-Fi on and off from task manager.

Heh? What is your DM? How can it have no entries? Are you looking in the right place?

I had some doubts about the meaning of gdm and checked it. It's for Gnome, right? Since I am on KDE, I should enter SDDM instead.
And when I did, some logs came all right. Here's the bin. It looks pretty abysmal.

Since you didn't know what DM you are using in the first place, I assume you didn't apply the guide correctly, so let me quote it:

6. For Manjaro KDE users (others ignore at this point):

Edit the file /etc/sddm.conf and simply put a # before the line starting with DisplayCommand and the one starting with DisplayStopCommand .

To edit the sddm.conf in terminal:

sudo nano /etc/sddm.conf

The reason for that is that Manjaro ships with a default configuration for SDDM (the default login manager for KDE) which overrides some keys needed by optimus-manager.

Weirdly enough, it’s possible that you may not have lines:

DisplayCommand
DisplayStopCommand

In such a case you are fine and you have nothing to do. It’s possible some recent Manjaro updates deleted those additional lines (they are not present in non-Manjaro systems anyway).

End of quote. Did you check this?

When I was following the guide, I did check this, knowing I was on KDE.
However, it seems for some reason I didn't perform the step. What a donkey..

So, after doing what you said, I rebooted and checked if it's running correctly.

systemctl status optimus-manager.service
● optimus-manager.service - Optimus Manager Commands Daemon
     Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2020-04-25 18:31:04 EEST; 10min ago
    Process: 945 ExecStartPre=/usr/bin/prime-switch-boot (code=exited, status=0/SUCCESS)
   Main PID: 1152 (python3)
      Tasks: 1 (limit: 19092)
     Memory: 44.3M
     CGroup: /system.slice/optimus-manager.service
             └─1152 /usr/bin/python3 -u /usr/bin/optimus-manager-daemon

Apr 25 18:31:03 at4na5-gs602qe prime-switch-boot[953]: Setting up Intel state
Apr 25 18:31:03 at4na5-gs602qe prime-switch-boot[953]: Setting GPU power to OFF via bbswitch
Apr 25 18:31:04 at4na5-gs602qe prime-switch-boot[953]: Loaded extra Intel Xorg options (0 lines)
Apr 25 18:31:04 at4na5-gs602qe prime-switch-boot[953]: Loaded extra Nvidia Xorg options (0 lines)
Apr 25 18:31:04 at4na5-gs602qe prime-switch-boot[953]: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
Apr 25 18:31:04 at4na5-gs602qe systemd[1]: Started Optimus Manager Commands Daemon.
Apr 25 18:31:04 at4na5-gs602qe python3[1152]: Optimus Manager (Daemon) version 1.2.2
Apr 25 18:31:04 at4na5-gs602qe python3[1152]: Automatic log cropping
Apr 25 18:31:04 at4na5-gs602qe python3[1152]: Opening UNIX socket
Apr 25 18:31:04 at4na5-gs602qe python3[1152]: Awaiting commands

When I try to switch cards, nothing happens, Intel is the only active one in all 3 scenarios.

You mean that after the switch you still land on Intel?

Provide SDDM logs, but only the lines with the recent switch attempts.

Also, let's go again through the all config files? Maybe there is still one causing the confusion? Show me output

ls /etc/X11/xorg.conf.d/ -lav

and

ls /etc/X11/ -lav

You mean the earlier set of commands? Alright. Here they are.
And here are the last two you asked for:

ls /etc/X11/ -lav
total 40
drwxr-xr-x   5 root root  4096 Mar 11 15:48 .
drwxr-xr-x 105 root root 12288 Apr 25 18:31 ..
drwxr-xr-x   2 root root  4096 Apr 25 18:25 mhwd.d
drwxr-xr-x   3 root root  4096 Mar 11 15:48 xinit
drwxr-xr-x   2 root root  4096 Apr 25 18:31 xorg.conf.d

ls /etc/X11/ -lav
total 40
drwxr-xr-x   5 root root  4096 Mar 11 15:48 .
drwxr-xr-x 105 root root 12288 Apr 25 18:31 ..
drwxr-xr-x   2 root root  4096 Apr 25 18:25 mhwd.d
drwxr-xr-x   3 root root  4096 Mar 11 15:48 xinit
drwxr-xr-x   2 root root  4096 Apr 25 18:31 xorg.conf.d

You posted me the same output twice...

ls /etc/X11/xorg.conf.d/ -lav

Ah, sorry...

total 24
drwxr-xr-x 2 root root 4096 Apr 25 18:31 .
drwxr-xr-x 5 root root 4096 Mar 11 15:48 ..
-rw-r--r-- 1 root root  266 Apr 23 23:48 00-keyboard.conf
-rw-r--r-- 1 root root  108 Apr 25 18:31 10-optimus-manager.conf
-rw-r--r-- 1 root root  131 Mar 11 15:49 30-touchpad.conf
lrwxrwxrwx 1 root root   27 Apr 24 13:26 90-mhwd.conf.bak -> /etc/X11/mhwd.d/nvidia.conf

OK, the files are fine. Show me output of

mhwd -li

and please, send me sddm log from recent switch attempts. The last time you posted me optimus-manager log. You are constantly mixing things, names, commands :pensive:

I apologize. Should be more careful..

This is the output:

mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-440xx-prime            2019.10.25               false            PCI


Warning: No installed USB configs!

And this is the SDDM log.

The log lines are cut. You copied it from small terminal window. Again, it's better either use maximized terminal window or output it to file and the copy the relevant lines. Newbies are doing the same mistake again and again :roll_eyes:.

When you are in terminal, you can read the rest of the line using right-left arrow keys. Unfortunately, when you copy text, you copy only visible part.

I used Yakuake for the last log. Guess it doesn't work either. This one should do it. Saved to a file and pasted from there.

Forum kindly sponsored by