Optimus-manager failed to switch to nvidia

I have a nvidia graphics card and installed optimus-manager following this guide but when i tried to switch to nvidia using optimus-manager-qt, it didn't switch.

when i ran optimus-manager --switch nvidia it gave the following errors :


$ optimus-manager --switch nvidia
ERROR: the latest GPU setup attempt failed at Xorg pre-start hook.
Log at /var/log/optimus-manager/switch/switch-20200602T115618.log

Cannot execute command because of previous errors.

Here is the log:


[16] INFO: # Xorg pre-start hook
[16] INFO: Requested mode is: nvidia
[16] INFO: Checking for GDM display servers
[450] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[450] INFO: Unloading modules ['nouveau'] (if loaded)
[496] INFO: Loading module nvidia
[955] ERROR: Xorg pre-start setup error
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/optimus_manager/bash.py", line 11, in exec_bash
    out = subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['bash', '-c', 'modprobe nvidia NVreg_UsePageAttributeTable=1']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 179, in _load_module
    exec_bash("modprobe %s %s" % (module, options))
  File "/usr/lib/python3.8/site-packages/optimus_manager/bash.py", line 18, in exec_bash
    raise BashError(
optimus_manager.bash.BashError: Failed to execute 'modprobe nvidia NVreg_UsePageAttributeTable=1' :
modprobe: ERROR: could not insert 'nvidia': No such device


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/optimus_manager/hooks/pre_xorg_start.py", line 33, in main
    setup_kernel_state(config, prev_state, requested_mode)
  File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 21, in setup_kernel_state
    _nvidia_up(config)
  File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 56, in _nvidia_up
    _load_nvidia_modules(config, available_modules)
  File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 109, in _load_nvidia_modules
    _load_module(available_modules, "nvidia", options="NVreg_UsePageAttributeTable=%d" % pat_value)
  File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 181, in _load_module
    raise KernelSetupError("error running modprobe for %s : %s" % (module, str(e)))
optimus_manager.kernel.KernelSetupError: error running modprobe for nvidia : Failed to execute 'modprobe nvidia NVreg_UsePageAttributeTable=1' :
modprobe: ERROR: could not insert 'nvidia': No such device

[958] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[958] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20200602T115618', 'requested_mode': 'nvidia'}

other outputs :


$ systemctl status 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 Tue 2020-06-02 11:47:58 IST; 32min ago
    Process: 790 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_daemon_start (code=exited, status=0/SUCCESS)
    Process: 966 ExecStartPre=/usr/bin/python3 -u -m optimus_manager.hooks.pre_xorg_start (code=exited, status=0/SUCCESS)
   Main PID: 1022 (python3)
      Tasks: 1 (limit: 4615)
     Memory: 31.7M
     CGroup: /system.slice/optimus-manager.service
             └─1022 /usr/bin/python3 -u -m optimus_manager.daemon

Jun 02 11:56:47 fermion python3[1022]:     "type": "switch"
Jun 02 11:56:47 fermion python3[1022]: }
Jun 02 11:56:47 fermion python3[1022]: [528987] INFO: Writing requested GPU mode nvidia
Jun 02 11:56:47 fermion python3[1022]: [528987] ERROR: Invalid command  "{
Jun 02 11:56:47 fermion python3[1022]:     "args": {
Jun 02 11:56:47 fermion python3[1022]:         "mode": "nvidia"
Jun 02 11:56:47 fermion python3[1022]:     },
Jun 02 11:56:47 fermion python3[1022]:     "type": "switch"
Jun 02 11:56:47 fermion python3[1022]: }
Jun 02 11:56:47 fermion python3[1022]: " ! Key error : 'current_mode'

mhwd -li

$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-440xx-prime            2019.10.25               false            PCI


Warning: No installed USB configs!

inxi -G

$ inxi -G
Graphics:  Device-1: Intel Haswell-ULT Integrated Graphics driver: i915 v: kernel 
           Device-2: NVIDIA GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] driver: N/A 
           Display: x11 server: X.Org 1.20.8 driver: modesetting resolution: 1366x768~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4400 (HSW GT2) v: 4.5 Mesa 20.0.7 

other

 Kernel: 5.6.15-1-MANJARO x86_64
 wm: i3

so how can i correct this problem?

1 Like

This driver doesn't support this card. Install:

video-hybrid-intel-nvidia-390xx-bumblebee

Then proceed again with the guide, disable bumblebee (or uninstall it), configure optimus-manager. Check if it's working this time.

Obviously you won't have hybrid mode for this driver. If optimimus-manager-qt will show hybrid mode, it will just work like intel, so no use of trying to switch to it.

By the way, You are the first person giving all needed info right away in a flawless manner! Kudos!

2 Likes

Thank you, this worked.

As a side question, I selected nonfree at the time of OS installation so shouldn't mhwd have automatically installed the correct driver for my GPU (GeForce 820M)?

yes, i have learned visiting various forums that this is the best way.

In theory, yes, but the scrip is based hardware lists (as far I understand it), and if something is not on the list or not recognized, things may not work out that well. This happens very rarely and sadly, you hit the jackpot this time :wink: .

I would suggest trying to contact some of the manjaro devs like @philm or @oberon to show them your hardware, so the mhwd list would be improved.

I'm not sure why do you ask about GeForce 820M. Above you showed GeForce 610M. What the GPU recognized mistakenly as GeForce 820M during installation? If so, this would be also a bug worth to report.

No my gpu is actually GeForce 820M. I dont know why inxi -G just lists all the other ones here

Ah, OK. I saw that first one and the rest was invisible to me :stuck_out_tongue: . Probably the reason why inxi was not specific enough also caused mhwd confusion.

Anyway, it's good that the issue is solved.

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

Forum kindly sponsored by