Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version not functioning; fails at pre-xorg-start hook. #477

Open
salperinlea opened this issue Feb 20, 2022 · 8 comments
Open

Latest version not functioning; fails at pre-xorg-start hook. #477

salperinlea opened this issue Feb 20, 2022 · 8 comments

Comments

@salperinlea
Copy link

Describe the bug
Post reboot after installing optimus-manager-git via the AUR, the package is not usable and the nvidia gpu seems to be powered off. All commands return the error posted below:

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

System info
Please include :

  • Arch, kernel 5.16.10.
  • KDE 5.24.1
  • SDDM
  • Hp Envy 15 ep1020 -- intel tigerlake iGPU, Nvidia RTX 3060 dGPU.
    Notably, this has a 4k OLED screen, which has been a stumbling block for linux until fairly recently.
  • optimus-manager-git (because optimus-manager itself prevents me from even logging in!)
  • no configuration performed.

Logs
The log mentioned in the error given is as follows:

[14] INFO: # Xorg pre-start hook
[14] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
[14] INFO: Requested mode is: integrated
[1037] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[1038] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[1041] INFO: Cannot unload modules: None
[1042] INFO: Waiting 1s and retrying.
[2049] INFO: Cannot unload modules: None
[2049] INFO: Waiting 1s and retrying.
[3057] INFO: Cannot unload modules: None
[3057] INFO: Waiting 1s and retrying.
[4066] INFO: Cannot unload modules: None
[4066] INFO: Waiting 1s and retrying.
[5074] INFO: Cannot unload modules: None
[5075] INFO: Waiting 1s and retrying.
[6083] INFO: Max tries (6) exceeded
[6084] ERROR: Xorg pre-start setup error
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 269, in _unload_modules
    subprocess.check_call(
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia' 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 25, in setup_kernel_state
    _nvidia_down(config)
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 104, in _nvidia_down
    _unload_nvidia_modules(available_modules)
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 214, in _unload_nvidia_modules
    _unload_modules(available_modules, ["nvidia_drm", "nvidia_modeset", "nvidia_uvm", "nvidia"])
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 277, in _unload_modules
    raise KernelSetupError(f"Cannot unload modules {modules_to_unload}: {e.stderr}") from e
optimus_manager.kernel.KernelSetupError: Cannot unload modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia']: None
[6084] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[6084] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20220219T221409', 'requested_mode': 'integrated'}
@bejucoo
Copy link

bejucoo commented Mar 14, 2022

Same error here:

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

System info:

  • Manjaro, kernel 5.16.14-1
  • KDE 5.24.2
  • SDDM
  • Asus K501LX
  • Intel HD Graphics 5500 and Nvidia GTX 950M
  • optimus-manager 1.4-4 installed from the AUR

@idanoo
Copy link

idanoo commented Mar 16, 2022

I had a similar issue with same specs as @salperinlea

I enabled PCI Power Control + PCI Reset: Hot reset inside optimus-manager-qt and it changed these in optimus-manager.conf.

I have a feeling by default the card is booting powered down and can't load the kernel module until it's alive. This seemed to resolve it for me

...
[optimus]
pci_power_control=yes
pci_reset=hot_reset
...

@bejucoo
Copy link

bejucoo commented Mar 19, 2022

Same error here:

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

System info:

* Manjaro, kernel 5.16.14-1

* KDE 5.24.2

* SDDM

* Asus K501LX

* Intel HD Graphics 5500 and Nvidia GTX 950M

* optimus-manager 1.4-4 installed from the AUR

The last Manjaro update fixed whatever error I had. Maybe the nvidia-utils 510.54-2?

@thamudi
Copy link

thamudi commented Mar 23, 2022

same issue here, although I am running on kernel 5.15 LTS

@nPHYN1T3
Copy link

nPHYN1T3 commented Apr 23, 2022

I'm also seeing this. Keep reading the no login manager FAQ like the errors say but can't find anything relevant but feel like I'm so spread thin I'm missing something obvious. 5.15.35 LTS (Garuda / Arch) here and ye olde nVidia 390 installed (from the nVidia website since the AUR version is broken due to mismatched packages).

Again I've read through the FAQ and docs the message says too about if you don't use a greeter but there is no mention of it. Looking at the service file I see WantedBy=graphical.target so I'm guess this is the issue for me. Now the question will it function if I change that to multi-user.target?! (nope)

@yuceltoluyag
Copy link

yuceltoluyag commented May 11, 2022

Linux Jason 5.17.5-arch1-2 #1 SMP PREEMPT Fri, 06 May 2022 18:29:03 +0000 x86_64 GNU/Linux
i3 version 4.20.1 (2021-11-03) � 2009 Michael Stapelberg and contributors
lightdm 1.30.0
01:00.0 VGA compatible controller: NVIDIA Corporation GF106GLM [Quadro 2000M] (rev a1)
	Subsystem: Lenovo Device 21d1
	Kernel driver in use: nvidia

Optimus Manager (Client) version 1.4
optimus-manager-qt Version 1.6.6

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 269, in _unload_modules
    subprocess.check_call(
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)

this problem happens to me too, i solve it like this Every time you update the kernel, you need to update the nvidia packages. (It can happen to you even if you use the lts kernel.)

  1. prime-offload run this command
  2. reinstall linux and linux-headers
  3. sudo mkinitcpio -p linux
  4. İnstall nvidia packaages again.
  5. reboot
  6. problem should be solved

If you do not want to do all these operations, you should install the dkms packages. For example nvidia-390xx-dkms When the kernel is updated it will automatically introduce the nvidia kernel modules.

If you don't want to install the dkms package, you can create a hook file

/etc/pacman.d/hooks/nvidia.hook

[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux
# Change the linux part above and in the Exec line if a different kernel is used

[Action]
Description=Update Nvidia module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'

When the kernel is updated, it will automatically reinstall the packages.

If you are using an old card like mine, you will get this error every time you update the kernel. I was currently using kernel version 5.15, I'm updating my kernel to show you :)
2022-05-12-01:26:43

If you don't understand anything from what I wrote, check these resources

  1. https://wiki.archlinux.org/title/NVIDIA#pacman_hook
  2. https://wiki.archlinux.org/title/PRIME#PRIME_GPU_offloading

I updated the kernel, now I will restart my computer and take a screenshot. I'll have edited my answer again in 2 minutes :D Please wait

it works ,hope it helps you too
2022-05-12-01:43:09
.

- Do not forget that every time you update the kernel, you must reinstall your graphics card packages, or you can automate it by trying the methods I mentioned above.
+ This is how I always solve this problem, I hope someone finds it useful

@nPHYN1T3
Copy link

None of that is relevant. There is no issue with the drivers, the issue is with the switchers pre-hook (not pacmans hooks) and lack of actual docs for running with no greeter.

@GamingLiamStudios
Copy link

I found that stopping the nvidia-persistanced & nvidia-powerd services before switching to integrated solves this, as nvidia_drm was being held captive by them & couldn't be unloaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants