Optimus-manager can't switch to Nvidia GPU

Hello everyone!
I have installed Manjaro once again and I have troubles with Nvidia GPU.
I have installed some Nvidia packages like nvidia-prime, nvidia-settings, nvidia-utils, optimus-manager, bumblebee via pamac later on in hopes it would fix an issue.
During “nvidia” package installation it shows the following:

sudo pacman -S nvidia

[sudo] password for jakus: 
warning: linux61-nvidia-535.104.05-6 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) linux61-nvidia-535.104.05-6

Total Installed Size:  52,97 MiB
Net Upgrade Size:       0,00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                         [############################] 100%
(1/1) checking package integrity                       [############################] 100%
(1/1) loading package files                            [############################] 100%
(1/1) checking for file conflicts                      [############################] 100%
(1/1) checking available disk space                    [############################] 100%
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
:: Processing package changes...
(1/1) reinstalling linux61-nvidia                      [############################] 100%
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Updating module dependencies...
(3/4) Updating Kernel initcpios for Nvidia-DRM...
==> Building image from preset: /etc/mkinitcpio.d/linux61.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.1-x86_64 -g /boot/initramfs-6.1-x86_64.img --microcode /boot/intel-ucode.img
==> Starting build: '6.1.51-1-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-6.1-x86_64.img'
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux61.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.1-x86_64 -g /boot/initramfs-6.1-x86_64-fallback.img -S autodetect --microcode /boot/intel-ucode.img
==> Starting build: '6.1.51-1-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-6.1-x86_64-fallback.img'
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux65-rt.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.5-rt-x86_64 -g /boot/initramfs-6.5-rt-x86_64.img --microcode /boot/intel-ucode.img
==> Starting build: '6.5.0-1-rt6-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-6.5-rt-x86_64.img'
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux65-rt.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.5-rt-x86_64 -g /boot/initramfs-6.5-rt-x86_64-fallback.img -S autodetect --microcode /boot/intel-ucode.img
==> Starting build: '6.5.0-1-rt6-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-6.5-rt-x86_64-fallback.img'
==> Image generation successful
(4/4) Refreshing PackageKit...

I switch the graphics card with optimus-manager, session restarts, I type the following to check if I have switched the videocard:

optimus-manager --status

ERROR: the active card is "integrated" but it should be "nvidia".
Something went wrong during the last GPU setup...
Log at /var/log/optimus-manager/switch/switch-20230914T125738.log
Cannot execute command because of previous errors.

Here is what it says in the .log file:

[12] INFO: # Xorg pre-start hook
[12] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'nvidia', 'current_mode': 'integrated'}
[12] INFO: Requested mode is: nvidia
[59] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[59] INFO: Unloading modules ['nouveau'] (if loaded)
[65] INFO: switching=none, nothing to do
[1447] INFO: Loading module nvidia
[1453] INFO: Loading module nvidia_drm
[3224] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[3225] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20230914T125738', 'requested_mode': 'nvidia'}
[3225] INFO: Xorg pre-start hook completed successfully.
[11] INFO: # Xorg post-start hook
[15] INFO: Running xrandr commands
[308] INFO: Running /etc/optimus-manager/xsetup-nvidia.sh
[362] INFO: Writing state {'type': 'done', 'switch_id': '20230914T125738', 'current_mode': 'nvidia'}
[363] INFO: Xorg post-start hook completed successfully.

Here is some information about the system:

inxi -Fazy

System:
  Kernel: 6.5.0-1-rt6-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-rt-x86_64
    root=UUID=b8c4b3ed-7cd5-40f1-92ff-7eecccaff893 rw quiet splash
    udev.log_priority=3
  Desktop: KDE Plasma v: 5.27.7 tk: Qt v: 5.15.10 wm: kwin_wayland vt: 1
    dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: GL752VW v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: GL752VW v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: GL752VW.303 date: 04/29/2019
Graphics:
  Device-1: Intel HD Graphics 530 vendor: ASUSTeK driver: i915 v: kernel
    arch: Gen-9 process: Intel 14n built: 2015-16 ports: active: eDP-1
    empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2, HDMI-A-3 bus-ID: 00:02.0
    chip-ID: 8086:191b class-ID: 0300
  Device-2: NVIDIA GM107M [GeForce GTX 960M] vendor: ASUSTeK driver: nvidia
    v: 535.104.05 alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-08) arch: Maxwell code: GMxxx
    process: TSMC 28nm built: 2014-19 pcie: gen: 1 speed: 2.5 GT/s lanes: 8
    link-max: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:139b
    class-ID: 0302
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.2.0
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915,nvidia display-ID: 0
  Monitor-1: eDP-1 res: 1920x1080 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 23.1.6-3 renderer: Mesa Intel HD Graphics 530 (SKL
    GT2) direct-render: Yes

mhwd -l

> 0000:01:00.0 (0302:10de:139b) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2023.03.23               false            PCI
video-hybrid-intel-nvidia-390xx-bumblebee            2023.03.23               false            PCI
          video-nvidia            2023.03.23               false            PCI
    video-nvidia-470xx            2023.03.23               false            PCI
    video-nvidia-390xx            2023.03.23               false            PCI
           video-linux            2018.05.04                true            PCI

> 0000:00:02.0 (0300:8086:191b) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2023.03.23               false            PCI
video-hybrid-intel-nvidia-390xx-bumblebee            2023.03.23               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

mhwd -li

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
     video-modesetting            2020.01.13                true            PCI


Warning: No installed USB configs!

I am still a noob to Manjaro, so I am just following video tutorials and go through Arch wiki when I really have no choice. Previous nvidia drivers installation was successful, like a year ago, and I didnt have such struggles.
Thanks in advance to anyone who replies to this post. I hope I have given the info you need about my system, if not, I will provide some more details.

First, you’re running RT kernel. That alone could be the source of trouble.

Boot into kernel 6.1 and see if optimus works.
Remove linux65-rt and install linux65

1 Like

I have switched to kernel Linux 6.5.1-1, re-installed nvidia package, tried switching GPU on optimus-manager:
optimus-manager --status

ERROR: the active card is "integrated" but it should be "nvidia".
Something went wrong during the last GPU setup...
Log at /var/log/optimus-manager/switch/switch-20230914T145743.log
Cannot execute command because of previous errors.

switch-20230914T145743.log:

[12] INFO: # Xorg pre-start hook
[12] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'nvidia', 'current_mode': 'integrated'}
[12] INFO: Requested mode is: nvidia
[44] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[44] INFO: Unloading modules ['nouveau'] (if loaded)
[49] INFO: switching=none, nothing to do
[80] INFO: Loading module nvidia
[85] INFO: Loading module nvidia_drm
[437] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[438] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20230914T145743', 'requested_mode': 'nvidia'}
[438] INFO: Xorg pre-start hook completed successfully.
[10] INFO: # Xorg post-start hook
[10] INFO: Running xrandr commands
[291] INFO: Running /etc/optimus-manager/xsetup-nvidia.sh
[320] INFO: Writing state {'type': 'done', 'switch_id': '20230914T145743', 'current_mode': 'nvidia'}
[321] INFO: Xorg post-start hook completed successfully.

I am trying to switch to different Settings in optimus-manager, trying things out like Switching method (didnt work), PCI reset (about to try this out).

By the way I have this message every time I try to setup the Nvidia GPU:
“Wayland session found.
Session 1000, started by jakus, is a Wayland session. Wayland is not supported by Optimus Manager, so GPU switching may fail.
Continue anyway?”

Looks like optimus-manager doesn’t support Wayland

Only Xorg sessions are supported (no Wayland)

1 Like

I think it has actually created the issue, I’m on a similar optimus system with Geforce 860M and it’s not needed.

I cant delete it
sudo pamac remove bumblebee

[sudo] password for jakus: 
Preparing...
Checking dependencies...
Error: Failed to prepare transaction:
could not satisfy dependencies:
- removing bumblebee breaks dependency 'bumblebee' required by primus

As far as I have read, yes, no support for Wayland. I will try to uninstall optimus-manager and install envycontrol

Manjaro ships with a default configuration for SDDM (the default login manager for KDE) which overrides some keys needed by optimus-manager. To use optimus-manager, you need to edit the file /etc/sddm.conf and simply put a # before the line starting with DisplayCommandand the one starting with DisplayStopCommand.

a simple alternative is envycontrol

I might try that now, then do everythig I said above… Oh, wait, I already have that commented out, I did that already:

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

Remove primus first, it’s also not needed.

Will do.

Ok, so you have to remove them at the same time, since they depend on each other:
sudo pacman -R primus bumblebee

checking dependencies...
warning: dependency cycle detected:
warning: bumblebee will be removed after its primus dependency

Packages (2) bumblebee-3.2.1-23  primus-20151110-9

Total Removed Size:  0,36 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/2) removing primus                                  [############################] 100%
(2/2) removing bumblebee                               [############################] 100%
warning: /etc/bumblebee/xorg.conf.nvidia saved as /etc/bumblebee/xorg.conf.nvidia.pacsave
:: Running post-transaction hooks...
(1/4) Reloading system manager configuration...
(2/4) Reloading device manager configuration...
(3/4) Arming ConditionNeedsUpdate...
(4/4) Refreshing PackageKit...

Uninstalled optimus-manager:
sudo pacman -R optimus-manager optimus-manager-plasma

Installed envycontrol:
pamac install envycontrol

Set Nvidia GPU
sudo envycontrol -s nvidia
Then reboot to apply changes
reboot

Ok, now, how do I check what GPU is in use?

run the following command

glxinfo | grep server

SGI = Intel
nvidia = this terrible sucking thing …

glxinfo | grep server

server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

Ugh. Its still on integrated GPU.

are you still on wayland ? check that first

echo $XDG_SESSION_TYPE

Yes, Wayland

you HAVE to use X11 !!! wayland does not work with nvidia. it was already recommended in this thread ! there is a option-menu at the login (left bottom corner). switch to x11.

Ok, wait a moment.

Now I am on “X11”

glxinfo | grep server
echo $XDG_SESSION_TYPE

glxinfo | grep server

server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

echo $XDG_SESSION_TYPE

x11