Optimus manager stopped working

A week ago, I have installed Optimus Manager and all its dependencies on my laptop. All worked fine, and I was able to switch from the iGPU to the NVIDIA graphics card I have. I also rebooted, noticed the iGPU was used by default, selected the NVIDIA graphics card to be used, logged out, and found out that effectively Optimus Manager switched to the NVIDIA graphics card.

Today, I started again to use my laptop, and discovered that Optimus Manager didn’t show its icon on the tray icon bar. I then ran optimus-manager from the console, and I got this error message.

ERROR: the latest GPU setup attempt failed at Xorg pre-start hook.
Log at /var/log/optimus-manager/switch/switch-20221118T100210.log
Cannot execute command because of previous errors.

I ran also optimus-manager-qt, which returned the following error.

Unable to read current mode from Optimus Manager state file
zsh: IOT instruction (core dumped)  optimus-manager-qt

The /var/log/optimus-manager/switch/switch-20221118T100210.log file’s content is the following.

[91] INFO: # Xorg pre-start hook
[91] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'nvidia', 'current_mode': None}
[92] INFO: Requested mode is: nvidia
[525] INFO: Available modules: ['nouveau']
[525] INFO: Unloading modules ['nouveau'] (if loaded)
[529] INFO: switching=none, nothing to do
[617] INFO: Setting Nvidia PCI power state to on
[634] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.0/power/control
[706] INFO: Loading module nvidia
[706] ERROR: Xorg pre-start setup error
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/optimus_manager/hooks/pre_xorg_start.py", line 51, in main
    setup_kernel_state(config, prev_state, requested_mode)
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 22, in setup_kernel_state
    _nvidia_up(config, hybrid=(requested_mode == "hybrid"))
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 95, in _nvidia_up
    _load_nvidia_modules(config, available_modules)
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 164, in _load_nvidia_modules
    _load_module(available_modules, "nvidia", options=nvidia_options)
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 241, in _load_module
    raise KernelSetupError(
optimus_manager.kernel.KernelSetupError: module nvidia is not available for current kernel. Is the corresponding package installed ?
[706] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[706] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20221118T100210', 'requested_mode': 'nvidia'}

I verified the nvidia package was installed with yay -Ss nvidia; these are the installed packages.

multilib/lib32-libvdpau 1.5-1 (23.0 KiB 86.5 KiB) (Installed)
    Nvidia VDPAU library
extra/nvidia-utils 520.56.06-2 (254.4 MiB 626.2 MiB) (Installed)
    NVIDIA drivers utilities
extra/nvidia 520.56.06-10 (42.0 MiB 42.1 MiB) (Installed)
    NVIDIA drivers for linux
extra/libvdpau 1.5-1 (63.3 KiB 288.0 KiB) (Installed)
    Nvidia VDPAU library
extra/egl-wayland 2:1.1.11-2 (31.1 KiB 85.3 KiB) (Installed)
    EGLStream-based Wayland external platform

Still, inxi -Ga gives this output.

Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: ASUSTeK
    driver: i915 v: kernel arch: Gen-5.75 process: Intel 45nm built: 2010 ports:
    active: HDMI-A-2,eDP-1 empty: DP-1,HDMI-A-1 bus-ID: 00:02.0
    chip-ID: 8086:0416 class-ID: 0300
  Device-2: NVIDIA GM107M [GeForce GTX 950M] vendor: ASUSTeK driver: N/A
    alternate: nouveau non-free: 520.xx+ status: current (as of 2022-10)
    arch: Maxwell code: GMxxx process: TSMC 28nm built: 2014-19 pcie: gen: 3
    speed: 8 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:139a class-ID: 0302
  Device-3: Chicony HD WebCam (Asus N-series) type: USB driver: uvcvideo
    bus-ID: 1-7:4 chip-ID: 04f2:b3fd class-ID: 0e02 serial: 0x0001
  Display: x11 server: X.Org v: 21.1.4 compositor: kwin_x11 driver: X:
    loaded: intel unloaded: modesetting alternate: fbdev,vesa dri: i965
    gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1013x285mm (39.88x11.22")
    s-diag: 1052mm (41.43")
  Monitor-1: HDMI-A-2 mapped: HDMI2 pos: primary,right
    model: LG (GoldStar) FULL HD built: 2016 res: 1920x1080 dpi: 102 gamma: 1.2
    size: 480x270mm (18.9x10.63") diag: 551mm (21.7") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  Monitor-2: eDP-1 mapped: eDP1 pos: left model: LG Display 0x042c
    built: 2013 res: 1920x1080 hz: 60 dpi: 139 gamma: 1.2
    size: 350x190mm (13.78x7.48") diag: 396mm (15.6") ratio: 16:9
    modes: 1920x1080
  API: OpenGL v: 4.6 Mesa 22.2.3 renderer: Mesa Intel HD Graphics 4600 (HSW
    GT2) direct render: Yes

I guess the question at this point is: Why isn’t the nvidia driver used even if it’s installed?
I installed all the packages I needed before, but are there packages that are now missing and that I should re-install?

try to rebuild optimus manager .?

since its a python package mayby need a rebuild

2 Likes

try also rebuild mkinitcpio -P , make sure you runb linux kernel not linux-zen :slight_smile:

2 Likes

You have package nvidia installed. I recommend uninstalling it, and install nvidia-dkms instead.
Note that you’ll need kernel headers package(s) too.

1 Like

The first time I installed Optimus Manager, it didn’t work with the nvidia-dkms package, so I had to install nvidia. Now, Optimus Manager works with nvidia-dkms and not with nvidia.

1 Like

It didn’t work, but this is a good suggestion the same. I will keep in mind for issues with AUR packages. (I didn’t remember Optimus Manager is an AUR package.)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.