You are not logged in.

#1 2022-08-24 18:57:49

reikdas
Member
Registered: 2019-01-11
Posts: 18

Unable to use Optimus Manager

Similar to - https://bbs.archlinux.org/viewtopic.php?id=255752

I used to switch between Nvidia GPU and AMD GPU using optimus-manager

After I updated all packages yesterday, I am no longer able to boot into Nvidia and Optimus Manager does not work as well.

Whenever I try to use Optimus manager (using a command like - optimus-manager --switch nvidia or optimus-manager --print-mode), I get the following error logs -

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

The contents of /var/log/optimus-manager/switch/switch-20220824T143825.log are -

[10] INFO: # Xorg pre-start hook
[10] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'nvidia', 'current_mode': None}
[10] INFO: Requested mode is: nvidia
[108] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[109] INFO: Unloading modules ['nouveau'] (if loaded)
[111] INFO: switching=none, nothing to do
[147] INFO: Setting Nvidia PCI power state to on
[174] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.0/power/control
[175] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.1/power/control
[206] INFO: Loading module nvidia
[1519] ERROR: Xorg pre-start setup error
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 245, in _load_module
    subprocess.check_call(
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'modprobe nvidia NVreg_UsePageAttributeTable=1 NVreg_DynamicPowerManagement=0x02' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

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 249, in _load_module
    raise KernelSetupError(f"Error running modprobe for {module}: {e.stderr}") from e
optimus_manager.kernel.KernelSetupError: Error running modprobe for nvidia: None
[1520] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[1520] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20220824T143825', 'requested_mode': 'nvidia'}

Looking at the logs, I tried modprobe nvidia and got the error - modprobe: ERROR: could not insert 'nvidia': Invalid argument

The contents of optimus-manager.conf are - https://pastebin.com/UK0AUnri
Display manager - sddm
I have tried playing around with prime-offload and prime-switch but to no avail.
How can I fix this?

Offline

#2 2022-08-24 19:28:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Re: Unable to use Optimus Manager

Do you use nvidia-dkms?

Offline

#3 2022-08-24 19:34:28

reikdas
Member
Registered: 2019-01-11
Posts: 18

Re: Unable to use Optimus Manager

seth wrote:

Do you use nvidia-dkms?

Yes.

Name            : nvidia-dkms
Version         : 515.65.01-2
Description     : NVIDIA drivers - module sources
Architecture    : x86_64
URL             : http://www.nvidia.com/
Licenses        : custom
Groups          : None
Provides        : NVIDIA-MODULE  nvidia
Depends On      : dkms  nvidia-utils=515.65.01  libglvnd
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : NVIDIA-MODULE  nvidia
Replaces        : None
Installed Size  : 52.48 MiB
Packager        : Sven-Hendrik Haase <svenstaro@gmail.com>
Build Date      : Sun 07 Aug 2022 11:04:53 AM EDT
Install Date    : Fri 19 Aug 2022 01:01:48 PM EDT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Offline

#4 2022-08-24 19:36:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Offline

#5 2022-08-24 19:43:09

reikdas
Member
Registered: 2019-01-11
Posts: 18

Re: Unable to use Optimus Manager

seth wrote:

Update the system, rebuild the dkms, https://bbs.archlinux.org/viewtopic.php … 1#p2053501

pacman -Syu tells me that there are no packages to be updated.

Offline

#6 2022-08-24 19:52:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Re: Unable to use Optimus Manager

pacman -Qi pahole

Offline

#7 2022-08-24 20:03:06

reikdas
Member
Registered: 2019-01-11
Posts: 18

Re: Unable to use Optimus Manager

Name            : pahole
Version         : 1:1.23-1
Description     : Pahole and other DWARF utils
Architecture    : x86_64
URL             : https://git.kernel.org/pub/scm/devel/pahole/pahole.git
Licenses        : GPL2
Groups          : None
Provides        : libdwarves.so=1-64  libdwarves_emit.so=1-64  libdwarves_reorganize.so=1-64
Depends On      : libelf  python
Optional Deps   : None
Required By     : linux-headers  linux-lts-headers
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 867.94 KiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Wed 24 Aug 2022 08:40:28 AM EDT
Install Date    : Wed 24 Aug 2022 11:50:37 AM EDT
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

Offline

#8 2022-08-24 20:08:20

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Re: Unable to use Optimus Manager

Ok, that's the good one.
Did you rebuild the dkms packages after installing this version ~4h ago?

Offline

#9 2022-08-24 20:10:23

reikdas
Member
Registered: 2019-01-11
Posts: 18

Re: Unable to use Optimus Manager

Oh.. I think I did not. How do I rebuild all my dkms packages?
Or by rebuild do you just mean reinstall all the packages with dkms in the name?

Last edited by reikdas (2022-08-24 20:25:21)

Offline

#10 2022-08-24 20:26:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Offline

#11 2022-08-24 20:43:37

reikdas
Member
Registered: 2019-01-11
Posts: 18

Re: Unable to use Optimus Manager

sudo dkms autoinstall did not do anything sad

Offline

#12 2022-08-24 21:02:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Re: Unable to use Optimus Manager

# dkms build nvidia/515.65
# dkms install nvidia/515.65

Offline

#13 2022-08-24 21:16:00

reikdas
Member
Registered: 2019-01-11
Posts: 18

Re: Unable to use Optimus Manager

seth wrote:

# dkms build nvidia/515.65
# dkms install nvidia/515.65

Module nvidia/515.65.01 already built for kernel 5.15.62-1-lts (x86_64).

Module nvidia/515.65.01 already installed on kernel 5.15.62-1-lts (x86_64).

Don't think it did anything.

Do I need to remove it first using dkms remove nvidia/515.65.01?

Offline

#14 2022-08-24 21:37:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,514

Re: Unable to use Optimus Manager

Yup

# dkms unbuild nvidia/515.65
# dkms install nvidia/515.65

Offline

Board footer

Powered by FluxBB