Call for testing: optimus-switch

@linesma actually made that manjaro optimus indicator so he would know more. i also have this setup but i only see "switch to intel" when im on nvidia mode and only see "switch to nvidia" when im on intel mode.

@warpMACHINE @dglt

My GUI is changing the GPU properly. It is not picking up that the GPU in use is Intel. So it is going to the default of showing both options. I am looking into why this is. I will update both here and on my post once I figure out a solution.

Thanks for letting me know!


guhhnome specific? :smirk:

@dglt It is only specific to Intel. It changed how it reports the vendor string. Nope, it is not Gnome specific. It is doing it as well on my Plasma install.

I didn't lose myself, and I tried to work with optimus-switch-sddm, but I have an error.

● optimus-manager.service - Optimus Manager Commands Daemon
     Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-04-13 18:03:17 EEST; 1h 4min ago
   Main PID: 845 (python3)
      Tasks: 1 (limit: 18934)
     Memory: 44.3M
     CGroup: /system.slice/optimus-manager.service
             └─845 /usr/bin/python3 -u /usr/bin/optimus-manager-daemon

apr 13 18:03:17  prime-switch-boot[523]: Running /etc/optimus-manager/
apr 13 18:03:17  prime-switch-boot[523]: ****ERROR** : cannot run /etc/optimus-manager/ Continuing anyways. Error is : Failed to execute '>**
apr 13 18:03:17  prime-switch-boot[523]: Loaded extra Intel Xorg options (0 lines)
apr 13 18:03:17  prime-switch-boot[523]: Loaded extra Nvidia Xorg options (0 lines)
apr 13 18:03:17  prime-switch-boot[523]: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
apr 13 18:03:17  systemd[1]: Started Optimus Manager Commands Daemon.
apr 13 18:03:17  python3[845]: Optimus Manager (Daemon) version 1.2.2
apr 13 18:03:17  python3[845]: Automatic log cropping
apr 13 18:03:17  python3[845]: Opening UNIX socket
apr 13 18:03:17  python3[845]: Awaiting commands

I apologize for insisting, but I don't like to leave things un-done

opening time is a bit big, I say ...

systemd-analyze blame --no-pager 
1.006s optimus-manager.service

optimus-switch os not the same thing as optimus-manager. go here if you need help with that

as i said before @sami when i tried helping you, i cant understand your wording and you fail to follow directions even when laid out in line by line commands. i think you should find someone in your native language that can understand you because i tried and got absolutely nowhere.

1 Like

I didn't read the whole thread (it's too big), but I noticed the last two posts and on one side you are saying that you work with optimus-switch but show optimus-manager status. Those are two DIFFERENT things and you shouldn't have both solutions at the same time, just as you can't have two antiviruses on the same time on Windows.

Also, when copying the output from terminal, maximize window so you could copy THE WHOLE part. Your output above is just partial:

Error is : Failed to execute '>**

Execute what? We can't help if we get incomplete data.

Alternativnelly, when you still have fragmented lines even in maximized mode, simply output them to text file with > text, so for example

sudo systemctl status optimimus-manager > optimus-manager-status.txt

This will create optimus-manager-status.txt file with the output, so you can open it, copy relevant parts and post here.

Mine is even bigger:

1.469s optimus-manager.service

However, system boots as quick as before or maybe this 1,5s is so little I didn't notice any difference. Did you? As long as it works and didn't disturb me in any way, I wouldn't care about that result.

@warpMACHINE and @dglt

It is now fixed and should work properly. I have updated the github repository.

1 Like

try again and I think you will succeed :slight_smile:

1.006s optimus-manager.service                                                                  
 594ms dev-nvme0n1p2.device                                                                     
 574ms snapd.service                                                                            
 557ms systemd-logind.service                                                                   
 496ms upower.service                                                                           
 377ms systemd-udevd.service                                                                    
 367ms apparmor.service                                                                         
 332ms systemd-journald.service                                                                 
 225ms systemd-random-seed.service                                                              
 216ms polkit.service                                                                           
 131ms ldconfig.service                                                                         
  83ms systemd-fsck@dev-disk-by\x2duuid-DA07\x2dEF5F.service                                    
  82ms user@1000.service                                                                        
  82ms systemd-tmpfiles-clean.service                                                           
  74ms systemd-udev-trigger.service                                                             
  72ms avahi-daemon.service                                                                     
  67ms systemd-rfkill.service                                                                   
  64ms NetworkManager.service                                                                   
  62ms udisks2.service                                                                          
  55ms ModemManager.service                                                                     
  53ms systemd-journal-flush.service                                                            
  50ms org.cups.cupsd.service                                                                   
  36ms boot-efi.mount                                                                           
  34ms systemd-fsck@dev-disk-by\x2duuid-2ab3f535\x2daf65\x2d4a1b\x2db183\x2d9b7591fed513.service
  30ms dev-disk-by\x2duuid-78c5c6bb\x2d9fcf\x2d4d5c\x2dbab0\x2d2c63d0fae3ed.swap                
  21ms systemd-backlight@backlight:intel_backlight.service                                      
  19ms sys-fs-fuse-connections.mount                                                            
  19ms systemd-sysusers.service                                                                 
  18ms linux-module-cleanup.service                                                             
  18ms systemd-modules-load.service                                                             
  17ms systemd-journal-catalog-update.service                                                   
  17ms modprobe@drm.service                                                                     
  17ms user-runtime-dir@1000.service                                                            
  16ms systemd-user-sessions.service                                                            
  16ms systemd-tmpfiles-setup.service                                                           
  14ms systemd-tmpfiles-setup-dev.service                                                       
  12ms snapd.apparmor.service                                                                   
  11ms systemd-remount-fs.service                                                               
  10ms systemd-update-utmp.service                                                              
  10ms bluetooth.service                                                                        
   9ms wpa_supplicant.service                                                                   
   8ms systemd-sysctl.service                                                                   
   7ms systemd-update-done.service                                                              
   7ms dev-hugepages.mount                                                                      
   7ms home.mount                                                                               
   6ms dev-mqueue.mount                                                                         
   6ms sys-kernel-debug.mount                                                                   
   5ms kmod-static-nodes.service                                                                
   5ms rtkit-daemon.service                                                                     
   3ms tmp.mount                                                                                
   2ms sys-kernel-config.mount                                                                  
   1ms snapd.socket                          

I didn't mean that part. The optimus-manager status...

I deactivated it and masked it that I don't think it would help me, and I was left with only the optimus-switch

Thanks anyway for the support given

I'm not sure if masking is enough. Optimus-manager tweaks systemd somehow so if you have competing solutions, they are most likely broken and won't work. The only way is to follow-up instruction how to uninstall optimus-manager and clean up the install:

To uninstall the program, simply remove the optimus-manager package. The auto-generated Xorg config file will be automatically cleaned up.

You can also force cleanup by running optimus-manager --cleanup

Also, you need to restore other configurations manually like mhwd one. So simply look for the configs you disabled for optimus-manager and if they are not regenerated automatically, enable them back.

So unless you get optimus-manager out of the system correctly, you may get problems with alternative solutions.

1 Like

So I tried this again on XPS 9560. Was working fine on Intel mode. Tied sudo and my laptop fails to boot.

I get an error saying "Failed to Start Simple Desktop Display Manager. Here's a photo of the output for systemctl status sddm.service:20200420_210131

Managed to go back to Intel only mode and again everything is working fine. Any ideas on how to fix this?

Hey, really great thing you did, I switched to linux as my main OS from a month and have been using optimus-manager but recently discovered that the gpu was still active so I tried optimus-switch and it is working really good, I did some testing and it works in both modes.

info with nvidia running

Graphics:  Device-1: Intel UHD Graphics 630 vendor: Micro-Star MSI driver: i915 v: kernel 
           bus ID: 00:02.0 chip ID: 8086:3e9b 
           Device-2: NVIDIA GP104M [GeForce GTX 1070 Mobile] vendor: Micro-Star MSI driver: nvidia 
           v: 435.21 bus ID: 01:00.0 chip ID: 10de:1ba1 
           Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia resolution: 1920x1080~144Hz 
           OpenGL: renderer: GeForce GTX 1070 with Max-Q Design/PCIe/SSE2 v: 4.6.0 NVIDIA 435.21 
           direct render: Yes
1 Like

yeah man i had this issue this morning but not cause of Nvidia but I can tell you have to set up your optimus laptop like I did i'll help u on discord Emmanuel#7551

post these outputs from intel mode as preformatted text (not pictures). use the </> above the post entry box or put 3 backtics above and below the pasted terminal output.

inxi -Fxxxza
mhwd -li
ls -laR /etc/X11 ; cat /etc/X11/xorg.conf.d/*.conf
ls -la /etc/modprobe.d ; cat /etc/modprobe.d/*.conf
ls -la /etc/modules-load.d ; cat /etc/modules-load.d/*.conf
pacman -Qs | grep -Ei 'xrandr|nvidia|acpi_call|xf86-video|bumble|bbswitch|primus|optimus|prime'

i'll see if i notice anything wrong.

Here you go

[omar@xps9560 ~]$ inxi -Fxxxza
System:    Host: xps9560 Kernel: 5.6.5-3-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.6-x86_64 root=UUID=261c2a3e-d668-467a-825c-903b9bcd849a rw quiet 
           Desktop: KDE Plasma 5.18.4 tk: Qt 5.14.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Laptop System: Dell product: XPS 15 9560 v: N/A serial: <filter> Chassis: type: 10 serial: <filter> 
           Mobo: Dell model: 0YH90J v: A00 serial: <filter> UEFI: Dell v: 1.18.0 date: 11/17/2019 
Battery:   ID-1: BAT0 charge: 62.8 Wh condition: 62.8/97.0 Wh (65%) volts: 12.6/11.4 model: SMP DELL GPM0365 type: Li-ion 
           serial: <filter> status: Full 
CPU:       Topology: Quad Core model: Intel Core i7-7700HQ bits: 64 type: MT MCP arch: Kaby Lake family: 6 model-id: 9E (158) 
           stepping: 9 microcode: CA L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44817 
           Speed: 896 MHz min/max: 800/3800 MHz Core speeds (MHz): 1: 900 2: 900 3: 900 4: 900 5: 900 6: 900 7: 900 8: 900 
           Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel HD Graphics 630 vendor: Dell driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:591b 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: N/A bus ID: 01:00.0 chip ID: 10de:1c8d 
           Display: x11 server: X.Org 1.20.8 driver: intel compositor: kwin_x11 resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 20.0.4 direct render: Yes 
Audio:     Device-1: Intel CM238 HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:a171 
           Sound Server: ALSA v: k5.6.5-3-MANJARO 
Network:   Device-1: Intel Wireless-AC 9260 driver: iwlwifi v: kernel port: e000 bus ID: 02:00.0 chip ID: 8086:2526 
           IF: wlp2s0 state: up mac: <filter> 
Drives:    Local Storage: total: 894.25 GiB used: 105.09 GiB (11.8%) 
           ID-1: /dev/nvme0n1 vendor: Corsair model: Force MP510 size: 894.25 GiB block size: physical: 512 B logical: 512 B 
           speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: ECFM12.2 scheme: GPT 
Partition: ID-1: / raw size: 893.75 GiB size: 878.70 GiB (98.32%) used: 105.09 GiB (12.0%) fs: ext4 dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 45.5 C mobo: N/A 
           Fan Speeds (RPM): cpu: 2522 fan-2: 2512 
Info:      Processes: 264 Uptime: 13h 35m Memory: 15.49 GiB used: 1.84 GiB (11.9%) Init: systemd v: 244 Compilers: gcc: 9.3.0 
           Shell: bash v: 5.0.16 running in: konsole inxi: 3.0.37 

[omar@xps9560 ~]$ mhwd -li
Warning: No installed PCI configs!
Warning: No installed USB configs!

[omar@xps9560 ~]$ ls -laR /etc/X11 ; cat /etc/X11/xorg.conf.d/*.conf
total 20
drwxr-xr-x  5 root root 4096 Apr 10 08:26 .
drwxr-xr-x 88 root root 4096 Apr 20 21:07 ..
drwxr-xr-x  2 root root 4096 Apr 18 15:19 mhwd.d
drwxr-xr-x  3 root root 4096 Apr 10 08:26 xinit
drwxr-xr-x  2 root root 4096 Apr 20 21:02 xorg.conf.d

total 8
drwxr-xr-x 2 root root 4096 Apr 18 15:19 .
drwxr-xr-x 5 root root 4096 Apr 10 08:26 ..

total 20
drwxr-xr-x 3 root root 4096 Apr 10 08:26 .
drwxr-xr-x 5 root root 4096 Apr 10 08:26 ..
-rw-r--r-- 1 root root  739 Mar  4  2019 xinitrc
drwxr-xr-x 2 root root 4096 Apr 10 08:26 xinitrc.d
-rw-r--r-- 1 root root   45 Mar  4  2019 xserverrc

total 16
drwxr-xr-x 2 root root 4096 Apr 10 08:26 .
drwxr-xr-x 3 root root 4096 Apr 10 08:26 ..
-rwxr-xr-x 1 root root  318 Nov  9  2018
-rwxr-xr-x 1 root root  199 Mar 30 00:14

total 20
drwxr-xr-x 2 root root 4096 Apr 20 21:02 .
drwxr-xr-x 5 root root 4096 Apr 10 08:26 ..
-rw-r--r-- 1 root root  344 Apr 10 22:50 00-keyboard.conf
-rw-r--r-- 1 root root  131 Apr 10 08:27 30-touchpad.conf
-rw-r--r-- 1 root root  672 Apr 20 21:02 99-intel.conf
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbModel" "dell"
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
# xorg configuration for use with intel driver.
# xf86-video-intel package required
# 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" "3"             # DRI2 and DRI1 are alternatives if DRI3 performs performs poorly
        Option      "TearFree" "true"
        #Option      "AccelMethod"  "sna" # default
        #Option      "AccelMethod"  "uxa" # fallback

[omar@xps9560 ~]$ ls -la /etc/modprobe.d ; cat /etc/modprobe.d/*.conf
total 12
drwxr-xr-x  2 root root 4096 Apr 20 21:02 .
drwxr-xr-x 88 root root 4096 Apr 20 21:07 ..
-rw-r--r--  1 root root  558 Apr 20 21:02 99-intel.conf
#blacklists all nouveau/nvidia modules
#so they are not loaded.

blacklist nouveau
blacklist ttm
install nvidia /bin/false
install nvidia-modeset /bin/false
install nvidia-drm /bin/false
install nvidia-uvm /bin/false

#this following section can be removed#
#if you plan to use the modesetting   #
#driver intead of the intel driver    #

#stops display from "blinking" or "flashing"
#during boot when using the intel driver.

options i915 enable_fbc=1
options i915 fastboot=1

[omar@xps9560 ~]$ ls -la /etc/modules-load.d ; cat /etc/modules-load.d/*.conf
total 12
drwxr-xr-x  2 root root 4096 Apr 20 21:02 .
drwxr-xr-x 88 root root 4096 Apr 20 21:07 ..
-rw-r--r--  1 root root   34 Nov 19 15:24 modules.conf
# List of modules to load at boot

[omar@xps9560 ~]$ pacman -Qs | grep -Ei 'xrandr|nvidia|acpi_call|xf86-video|bumble|bbswitch|primus|optimus|prime'
local/acpi_call-dkms 1.1.0-287
local/lib32-libxrandr 1.5.2-1
local/lib32-nvidia-cg-toolkit 3.1-7
    NVIDIA Cg libraries
    Nvidia VDPAU library
local/libxrandr 1.5.2-2
local/mhwd-nvidia-340xx 340.108-1
    MHWD module-ids for nvidia 340.108
local/mhwd-nvidia-390xx 390.132-1
    MHWD module-ids for nvidia 390.132
local/mhwd-nvidia-418xx 418.113-1
    MHWD module-ids for nvidia-418xx 418.113
local/mhwd-nvidia-430xx 430.64-1.0
    MHWD module-ids for nvidia-430xx 430.64
local/mhwd-nvidia-435xx 435.21-1.0
    MHWD module-ids for nvidia 435.21
local/mhwd-nvidia-440xx 440.82-1
    MHWD module-ids for nvidia 440.82
local/nvidia-cg-toolkit 3.1-5
    NVIDIA Cg libraries
local/xf86-video-intel 1:2.99.917+901+gf2a54e25-1 (xorg-drivers)
local/xorg-xrandr 1.5.1-1 (xorg-apps xorg)

i think you might of missed one important step. the nvidia drivers :dizzy_face:

run these commands:

sudo mhwd -i pci video-nvidia-440xx
sudo rm /etc/modprobe.d/mhwd-gpu.conf
sudo rm /etc/modules-load.d/mhwd-gpu.conf
sudo rm /etc/X11/xorg.conf.d/90-mhwd.conf

after thats done without any issues, set nvidia mode


Forum kindly sponsored by