Optimus-manager switching to Nvidia freezes during logout

I went through this tutorial


trying to install the optimus manager, but now that it's done, booting into my intel iGPU works fine, but switching to my Nvidia GPU logs me out, but then freezes and without even asking for a password. While it's frozen I do hear my fans becoming louder, but nothing else, I have to hold my power button to reboot. Also my startup time went from ~10 seconds to 20 or 30.

Here's an inxi

System:    Host: Kiko-LTL Kernel: 4.19.49-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.3.0 Desktop: KDE Plasma 5.15.5 
           tk: Qt 5.12.3 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Laptop System: Acer product: Aspire A515-51G v: V1.08 serial: <filter> 
           Mobo: KBL model: Charmander_KL v: V1.08 serial: <filter> UEFI: Insyde v: 1.08 date: 06/15/2017 
Battery:   ID-1: BAT1 charge: 21.5 Wh condition: 42.5/48.9 Wh (87%) volts: 16.1/15.2 model: COMPAL PABAS0241231 type: Li-ion 
           serial: <filter> status: Charging 
CPU:       Topology: Quad Core model: Intel Core i5-8250U bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 28808 
           Speed: 701 MHz min/max: 400/3400 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 
           chip ID: 8086:5917 
           Device-2: NVIDIA GP108M [GeForce MX150] vendor: Acer Incorporated ALI driver: nouveau v: kernel bus ID: 01:00.0 
           chip ID: 10de:1d10 
           Display: x11 server: X.Org 1.20.5 driver: modesetting compositor: kwin_x11 resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2) v: 4.5 Mesa 19.0.6 compat-v: 3.0 
           direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
           bus ID: 00:1f.3 chip ID: 8086:9d71 
           Device-2: Logitech [G533 Wireless Headset Dongle] type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-1:2 
           chip ID: 046d:0a66 
           Sound Server: ALSA v: k4.19.49-1-MANJARO 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Acer Incorporated ALI driver: r8168 
           v: 8.047.01-NAPI port: 3000 bus ID: 02:00.1 chip ID: 10ec:8168 
           IF: enp2s0f1 state: down mac: <filter> 
           Device-2: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi v: kernel port: 3000 bus ID: 03:00.0 
           chip ID: 8086:24fb 
           IF: wlp3s0 state: up mac: <filter> 
           IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:    Local Storage: total: 1.03 TiB used: 869.79 GiB (82.8%) 
           ID-1: /dev/sda vendor: Toshiba model: MQ04ABF100 size: 931.51 GiB speed: 6.0 Gb/s rotation: 5400 rpm 
           serial: <filter> rev: 1J scheme: GPT 
           ID-2: /dev/sdb vendor: A-Data model: SU800NS38 size: 119.24 GiB speed: 6.0 Gb/s serial: <filter> rev: 8BS 
           scheme: GPT 
Partition: ID-1: / size: 42.80 GiB used: 27.59 GiB (64.5%) fs: ext4 dev: /dev/sdb7 
           ID-2: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdb6 
Sensors:   System Temperatures: cpu: 53.0 C mobo: 29.8 C gpu: nouveau temp: 511 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 263 Uptime: 4m Memory: 7.67 GiB used: 1.36 GiB (17.8%) Init: systemd v: 242 Compilers: gcc: 8.3.0 
           Shell: bash v: 5.0.7 running in: yakuake inxi: 3.0.34 

And now here are the results of following the tutorial

1 - I installed optimus-manager from the extra repo and optimus-manager-qt from the AUR
2 - Bumblebeed is disabled

● bumblebeed.service - Bumblebee C Daemon
   Loaded: loaded (/usr/lib/systemd/system/bumblebeed.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

3 - This is everything in /etc/X11/xorg.conf.d/ -> 00-keyboard.conf 10-optimus-manager.conf 90-mhwd.conf.bak
4 - This is everything in /etc/X11/ -> mhwd.d xinit xorg.conf.d - only folders, no files
5 - skipped cause I'm on KDE
6 - Those two commands are disabled as you can see here

...
[X11]
#DisplayCommand=/usr/share/sddm/scripts/Xsetup
#DisplayStopCommand=/usr/share/sddm/scripts/Xstop
EnableHiDPI=false
...

7 - Optimus-manager is started automatically
Autos

8 - Now after rebooting here's the 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 2019-06-29 19:11:53 EEST; 7min ago
  Process: 563 ExecStartPre=/usr/bin/prime-switch-boot (code=exited, status=0/SUCCESS)
 Main PID: 1094 (python)
    Tasks: 1 (limit: 4915)
   Memory: 29.4M
   CGroup: /system.slice/optimus-manager.service
           └─1094 /usr/bin/python -u /usr/bin/optimus-manager-daemon

юни 29 19:11:51 Kiko-LTL prime-switch-boot[563]: Unloading Nvidia modules
юни 29 19:11:51 Kiko-LTL prime-switch-boot[563]: Loading nouveau module
юни 29 19:11:53 Kiko-LTL prime-switch-boot[563]: Loaded extra Intel Xorg options (0 lines)
юни 29 19:11:53 Kiko-LTL prime-switch-boot[563]: Loaded extra Nvidia Xorg options (0 lines)
юни 29 19:11:53 Kiko-LTL prime-switch-boot[563]: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
юни 29 19:11:53 Kiko-LTL systemd[1]: Started Optimus Manager Commands Daemon.
юни 29 19:11:54 Kiko-LTL python[1094]: Optimus Manager (Daemon) version 1.0
юни 29 19:11:54 Kiko-LTL python[1094]: Loading config file
юни 29 19:11:54 Kiko-LTL python[1094]: Opening UNIX socket
юни 29 19:11:54 Kiko-LTL python[1094]: Awaiting commands

I think the problem is related to logging out in of itself, because when I tried to log out normally without doing anything else, it still froze the same way and caused my fans to become louder. What could the problem be?

Edit: I have discovered the same freeze happens when I try to reboot as well. I assume it'll be the same on shutdown too. Maybe it's possible the problem stems not from optimus-manager itself but from my power management?

Edit 2: I have now also discovered that running lspci disables by mouse. My keyboard continues working for a few more seconds but then it stops working too. My fans also become louder, and about a minute later the system freezes too.

Maybe it's the ACPI issues. Unfortunately I'm not seeing anything for my specific laptop on the troubleshooting section.

Edit 3: Well, I give up for now. I tried editing the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub by adding all of the following

acpi_osi=! acpi_osi='Windows 2009'
acpi_osi=! acpi_osi='Windows 2013'
acpi_osi=! acpi_osi='Windows 2015'
acpi_osi=! acpi_osi='!Windows 2015'

but none of that fixed the problem. If anyone has any other ideas I'm all ears.

I saw somewhere on the forum exactly the same problem with exactly the same results (fans spinning like crazy). Switching to bbswitch fixed the issue.

Just to make sure, the autostart is for the tray utility, not the optimus-manager itself?

Screenshot-2019-06-29-20-33-13

I just clicked add program and then when I searched for Optimus manager it only gave me one result. I assume so because I didn't see any issues with the manager itself. But then again I couldn't test it very much cause I couldn't get past the logout phase

Just widen "Command" column to see which one is it.

Here is one example with bbswitch:

And here is another:

Yes it is qt

So now you can test if bbswitch will fix the issue. In case system wouldn't boot, you can edit optimus-manager.conf from tty to switch back.

1 Like

How? Through here? Switching backend
Screenshot_20190629_215655

Yes. Can't you see it? Currently you are using nouveau. Change to bbswitch.

I had to restart forcefully after changing to bbswitch, but now it seemingly works. My splash screen went by very quickly after switching to nvidia, but so far no issues. My fans are a bit loud though, more so than they should be or so I think, since my GPU shouldn't be doing much ATM.

I mean nvidia-smi -a shows

Utilization
        Gpu                         : 8 %
        Memory                      : 1 %

so I imagine it's not much

OK, so mark my post that says about switching to bbswitch as a solution.

As to fans, this is another issue and you should it closely in time. Maybe your computer was heated from the issue and it won't happen later. If it do happen, this will be different issue and requires monitoring and gathering logs and new topic :wink: .

Ok thanks

Oh yes I can confirm my Nvidia GPU IS working since I'm able to run DirectX games with steam Proton. Intel doesn't support vulkan so this setup would not have worked if I wasn't using my Nvidia GPU.

1 Like

You can easily see which GPU is active in Steam system properties. Also optimus-manager shows the proper icon in the tray, but I guess you had to see it for yourself to be sure :wink: . I'm glad that is working good. Enjoy the games :slight_smile:.

BTW this is a bit off-topic but I noticed that there's a warning if you try to switch the GPU when there are multiple desktop sessions when I for example press Ctrl + Alt + F2.

What's the easiest way to log out of all sessions? Is there a single command? Could I make it to log out of all extra sessions except the first?

I think this issue was solved in git, because I recall it from the past. I use git version myself and there is no such warning. I wouldn't worry too much about it thou. There is no single command to close them all because each command is issued by a one user in one session. You can always go into tty and just enter "exit" to log out but I don't think it matters for this warning bug,

Since all works in the version from Manjaro repo, you can always try out git, but sometimes you may stumble upon some regression and errors since it's a development branch.

Thanks.
Anyways I've tried rendering a video in both Windows & Manjaro so that it's mosly the same Nvidia GPU usage, but so far I've noticed that in Windows the Nvidia GPU runs only a few degrees cooler, but the fans are much quieter. Could the optimus manager be related to any of this?

I don't think so but I can't be 100% sure. Optimus manager isn't creating any special setting. It's only replacing graphic configs for nvidia or intel and allow for the switch in DM, that's all, so when nvidia is running, it's as if it was normally set as a single GPU.

To get more fair comparison, you would have to use the same program and I suspect you're using different one on windows and different here. Kdenlive for example has a poor GPU usage and it's not really optimized for it.

As to fans, this is a matter of correct ACPI and tlp settings + kernel. You can try out to optimize that yourself if you want but the automatic settings usually are good. There is some GUI overlay for TLP so you could easier configure it but don't remember its name at the moment.

Also, you must note that on Windows, both of GPUs are used at the same time, so the desktop runs on Intel and Nvidia kicks in with some defined programs or processes. In Linux, when you use Nvidia it is used for the whole desktop, not just an app so it's rather OK if it runs a bit hot compared to windows in similar circumstances and the fans are reflecting it (probably you hit the heat threshold so they kicked in).

Bumblebee was a solution where the whole desktop was on Intel and only chosen (manually) app was using Nvidia, but ironically, Bumblebee has bigger overhead so it's better to use Nvidia for the whole desktop then Bumblebee for one app, at least for gaming where small advantages do matter.

I've also noticed that sometimes when switching from Nvidia to Intel the screen just doesn't turn on. But if I only press the power button I see the verbose shutdown that Linux sometimes does and then a stop job runs for about one minute before shutting down. I take it the only fix for this is a future update?

Can be ACPI problem. Check out:

journalctl -b -p3

and see if you have many ACPI problems, if so, set proper OSI.
I assume you already know that guide?

Also, you can check your DM logs to see if something doesn't stand out.

Forum kindly sponsored by